Giter Club home page Giter Club logo

giget's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

giget's Issues

CLI can not be used

Environment

❯ node -v
v20.10.0

❯ npm -v
10.2.3

Reproduction

❯ npx [email protected] gh:unjs/template

/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 1: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 2: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 3: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 4: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 5: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 6: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 7: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 8: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 9: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 10: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 11: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 12: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 13: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 14: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 15: import: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 17: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 18: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 19: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 20: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 21: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 22: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 23: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 24: const: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 25: .:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 26: import:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 27: types:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 28: default:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 29: },: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 30: require:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 31: types:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 32: default:: command not found
/Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 33: syntax error near unexpected token }' /Users/byron/.npm/_npx/a37ce48c408dc016/node_modules/.bin/giget: line 33: }'

Describe the bug

Look like the cli file not run in node environment.

I think the reason for that is in here.

Additional context

No response

Logs

No response

Support custom github/gitlab domain

From what I have tested so far for private gitlab repo is

  1. I need to set export NODE_EXTRA_CA_CERTS=/path/to/cert.pem in .zshrc
  2. For example, my private repo is a self hosted gitlab then I need to modify the domain on line 87 & 88 in /giget/shared/gitget.xxxx.mjs
    url: https://gitlab.domain.com/${parsed.repo}/tree/${parsed.ref}${parsed.subdir},
    tar: https://gitlab.domain.com/${parsed.repo}/-/archive/${parsed.ref}.tar.gz

is there anything I can do for gitlab custom domain, for example to set GIGET_GITLAB_URL in .env so that it will pick up custom domain?

  1. set GIGET_REGISTRY, GIGET_AUTH in .env

The only downside is I need to modify the gitlab domain myself.

_Originally posted by @hanzoz in nuxt/nuxt#13367

issue with private bitbucket repo

Environment

OS: Windows 10
Node: v16.17.0

Reproduction

i created a new private empty bitbucket repo for this issue, so i don't mind sharing the key :).

npx giget bitbucket:riad_hachemane/test-giget-bitbucket --auth kuhyURjJB7gMoqURJMIP

Describe the bug

@pi0
am having trouble with a private bitbucket repo, the auth token is not working,
i created a new private empty bitbucket repo for this issue, so i don't mind sharing the key :).
steps i made to get to this issue:

1) make public bitbucket repo, and used giget, works as expected ✅

2023-01-16 09_36_43-Window

2) made that repo private, also as expected ✅

2023-01-16 09_41_04-Window

3) add a "Repository Access Token" from bitbucket dashboard, and give it all permissions ✅

2023-01-16 09_55_22-Window

4) use it with --auth, doesn't work ❌

2023-01-16 09_55_55-Window

Additional context

No response

Logs

No response

Option to throw if fetching a template fails

Describe the feature

Hello 👋

I'm using a Nuxt layer with the GitHub repo approach which lacks the versioning we would get if it were a npm package.
Hence I want to make sure that I'm using the latest layer commit and otherwise fail to catch bugs as early as possible.
Currently, If I set any incorrect GIGET_AUTH env (Repo is private) it doesn't throw an error and uses the currently folder in node_modules.
A flag that throws an error and/or warning if fetching the repo fails would be great! Thanks a lot!

Additional information

  • Would you be willing to help implement this feature?

Readme section on differences between degit/tiged

Hey! After seeing this being published, definitely gonna be my default cloner after using degit/tiged. Curious what are the differences between other packages? I'd love to help contribute the readme.

Unable to fetch private Bitbucket repository

Environment

Node: v18.15.0
Nuxt: v3.7.0

Reproduction

Using nuxt:

  1. Create a private Bitbucket repository
  2. Initialize a new nuxt project
  3. Extend your project with the Bitbucket repository (see code below)

Using pure giget:

  1. Create a private Bitbucket repository
  2. Try to fetch the private repository

Either way the fetch will fail

Describe the bug

I am working on a Nuxt Layers project. Nuxt uses uses unjs/giget internally to fetch remote git repositories, but is unable to fetch private Bitbucket repositories. I already raised an issue at the Nuxt repository, but was forwarded to create an issue here.

nuxt setup:

  • .env-file:
GIGET_AUTH=XXXXXXXXXXXXXXXX`
  • nuxt.config.ts:
export default defineNuxtConfig({
 extends: [
   'bitbucket:user_name/project_name#branch_name', 
 ],
 // ...
})



Internally unjs/giget converts this to https://bitbucket.org/user_name/project_name/get/branch_name.tar.gz.
If I try to execute this with npx, the fetch fails:

npx giget@latest https://bitbucket.org/user_name/project_name/get/branch_name.tar.gz --auth XXXXXXXXXXXXXXXX

In my opionion something like https://api.bitbucket.org/2.0/repositories/user_name/project_name/src/branch_name/ would be more correct.


I found an issue for private Github repos which seems pretty similar to my problem. The issue was fixed but is not published yet. Someone also already addressed the problem with private Bitbucket repositories. However the response was insufficient to me.


Am I missing something? Is this a known bug? If so, will it be fixed in a future release? Any help is appreciated.

Additional context

No response

Logs

No response

Get git commit id from tarball

Describe the feature

I'd like to inform the user what is the git commit hash that is being downloaded when a branch or tag is passed.

Since giget doesn't depend on git, we'd need to assume that the tarball downloaded from the providers are generated using git archive.

If that's the case, the commit id could be retrieved from the tarball.

Example:

wget https://codeload.github.com/unjs/giget/tar.gz/tags/v1.1.2
zcat v1.1.2 | git get-tar-commit-id
8ddd2a4eb6045710c1bac9761e97152cf6af4b8a

8ddd2a4

Additional information

  • Would you be willing to help implement this feature?

Improve docs for vendor specific private tokens + github fine-grained tokens

Describe the feature

I've been happy to see that you've added support for accessing private repos via Token.
In our organisation we use the new fine-graded tokens. Which permissions do we need to set in order to use giget?
Content + Metadata readonly doesn't seem to work (returns a 404 error).

Would be great to get some documentation

Thanks a lot! :)

Additional information

  • Would you be willing to help implement this feature?

parseGitURI is not working for tags containing `@` characters

Environment

  • Node.js: >= 18
  • Giget: ^1.2.1

Reproduction

In your terminal, run:

npx giget@latest --verbose github:bigcommerce/catalyst/apps/core#@bigcommerce/[email protected]

Expected Result:
Giget should successfully clone bigcommerce-catalyst to bigcommerce-catalyst at commit SHA 5955b5aeb0894ddb6748e4b60745899f1720f6ec (the commit SHA associated with tag @bigcommerce/[email protected]).

Actual Result:
Giget clones main instead of the desired tag. You'll notice the logs confirm this:

npx giget@latest --verbose github:bigcommerce/catalyst/apps/core#@bigcommerce/[email protected]
[giget] Downloaded https://api.github.com/repos/bigcommerce/catalyst/tarball/main to /Users/matt.volk/.cache/giget/github/bigcommerce-catalyst/main.tar.gz in 537ms

Describe the bug

parseGitURI's inputRegex is as follows:

/^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./-]+)?/;

We have a repository (bigcommerce/catalyst) containing tags with @ characters (example: https://github.com/bigcommerce/catalyst/tree/@bigcommerce/[email protected])

Since the @ character is not included in the <ref> character set [\w./-], the tag above won't be matched by this pattern, and will fallback to main.

Even if we try to URI encode the tag name (so that it turns into %40bigcommerce%2Fcatalyst-core%400.1.0), the character % is also not included in the <ref> character set, so it still falls back to main.

Additional context

The following change seems to fix the issue, though I'm not sure if there was an intentional reason to omit @ from the inputRegex string:

diff --git a/src/_utils.ts b/src/_utils.ts
index 6e6d8c4..f6d56db 100644
--- a/src/_utils.ts
+++ b/src/_utils.ts
@@ -46,7 +46,7 @@ export async function download(
 }
 
 const inputRegex =
-  /^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./-]+)?/;
+  /^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./@-]+)?/;
 
 export function parseGitURI(input: string): GitInfo {
   const m = input.match(inputRegex)?.groups || {};

Logs

[giget] Downloaded https://api.github.com/repos/bigcommerce/catalyst/tarball/main to /Users/matt.volk/.cache/giget/github/bigcommerce-catalyst/main.tar.gz in 537ms
[giget] Extracted to /Users/matt.volk/code/bigcommerce-catalyst in 105ms
✨ Successfully cloned bigcommerce-catalyst to bigcommerce-catalyst

Auto install dependendencies after clone

Ref #2

This can be easier than experimental --shell because we only need to change cwd of current process in order to run install command.

This feature also unlocks unjs/c12 to support auto installing dependencies of remote sources.

Support multiple registries

Describe the feature

Hello,

Currently, there is a default registry for unjs template. To use a custom registry, we have to use --registry and pass a long URL like https://raw.githubusercontent.com/unjs/giget/main/templates.

I'm currently creating my own registry. To fetch from my registry, I've to pass the long URL which is annoying. I could put it in a var env but this will overwrite the unjs registry.

Using a config file with unjs/rc9, we could easily support multiple registries. We could also support multiple registries in var env using a separator like a comma.

If it's ok for you, I'm ok to try to implement this feature.

Additional information

  • Would you be willing to help implement this feature?

`downloadTemplate` broken since last update

Environment

Node v16.19.0, pnpm, macOS

Reproduction

Your own CI

Describe the bug

Since the latest update (1.1.0), downloadTemplate returns a 400 on Node 16 while hitting GitHub. This happens in giget CI, but is also breaking people downstream, including create-astro.

image

The original PR (#77) also had this test fail.

Additional context

No response

Logs

Failed to download https://github.com/unjs/template/archive/main.tar.gz: 400 Bad Request

Dispose: delete pre-created folders when the template does not exist

Describe the feature

When trying to giget a template that doesn't exist,

$ giget gh:unjs/empty

the folder ends up being created:

|- unjs-empty

Should we make the behavior of giget and git consistent, Clear the pre-created folder when the template doesn't exist ?

Additional information

  • Would you be willing to help implement this feature?

Allow install in current dir `.`

Environment

/

Reproduction

try pnpm dlx giget@latest nitro . to view how it fails

Describe the bug

/

Additional context

No response

Logs

No response

URL download option

Describe the feature

Hey Pooya,

Congrats on another exceptionally useful repository.

I regularly have need to download examples – not templates – from repos, for example:

These kind of examples folder setups are pretty common; I wonder if a direct URL download option could be added to the package, such as:

# download single folder
npx giget@latest https://github.com/wxt-dev/wxt-examples/tree/main/examples/vue

# download several folders
https://github.com/wxt-dev/wxt-examples/tree/main/examples/vue*

That way it's a super-easy copy/paste job.

Could perhaps the folders be filtered after the download of the main repo?

I took a look at the source files, and perhaps it might even be manageable for me to produce a PR!

LMK, and thanks again for all the great code 🙏

Additional information

  • Would you be willing to help implement this feature?

Disable `--install` until `nypm` has better ways of detecting the package manager

Environment

[email protected]
Node 20.7.0
npm 10.1.0
pnpm 8.15.1

Reproduction

npx giget@latest nitro nitro-app --install
or
pnpx giget@latest nitro nitro-app --install

Describe the bug

Because nypm's package manager detection depends on either the lockfile being present or the package manager being specified in package.json, following the quick start guide for Nitro, which uses --install, causes it to complain that no package managers were detected.

Additional context

No response

Logs

> pnpm dlx giget@latest nitro --install
Packages: +34
++++++++++++++++++++++++++++++++++
Progress: resolved 34, reused 34, downloaded 0, added 34, done

 ERROR  No package manager auto-detected.

GitLab Subgroups

Environment

Reproduction

Try to install any GitLab repository that is located in a subgroup.

Describe the bug

In GitLab, you can seperate your projects into subgroups. Currently its not possible to download projects in subgroups due to how repository urls are resolved.
For example runningnpx giget@latest gitlab:group/subgroup/project will try download the repository from https://gitlab.com/group/subgroup/-/archive/main.tar.gz.

Additional context

No response

Logs

No response

custom registry provider can't access private Github repo.

Environment

any

Reproduction

Try to fetch a file that is within a private repo using the registry provider.

Describe the bug

Cannot fetch json to then download template since registry is private and needs auth token to access.

Additional context

No response

Logs

No response

git refs that include slashes do not get parsed correctly

Environment

Shouldn't make a difference, tested with Node v18.15.0

Reproduction

Attempt a download of any git branch that includes slashes.

Describe the bug

The ref capturing group of inputRegex used by parseGitURI is too strict, does not include /.
This can result in failed download attempts.

This might not technically be a bug, but there's no downside to adjusting the regex to allow slashes afaik.

It would be nice to get this working as org/repo#user/ABC-123 is a pretty common pattern.

Additional context

I have adjusted the regex and added a test for it, only opening this issue to reference it in the PR.

Resolved by #102

Logs

No response

support `file://` protocol

Describe the feature

If I already have a template project locally, can I get a new project by copying the template?
Does giget support it?

Additional information

  • Would you be willing to help implement this feature?

built-in `git:` provider

Normally giget uses tarbal snapshot downloads. But for supporting a 3rd party provider, we might support generic git provider supporting git: and git via HTTPS (.git).

We might need some internal refactors too for providers giving a directory instead of tarball path OR that this git providers makes a tarbal after cloning.

parseGitURI is not working for repositories in sub directory

Hi :) Let's say we have a repository name within a directory in GitLab, such as xxx/dir/website-1#master. The regular expression you are using here is not working for this type of repository name.

/^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./-]+)?/;

resulting:
"url": "https://git.xxx.com/xxx/dir/tree/master/website-1",

and should be
"url": "https://git.xxx.com/xxx/dir/website-1/tree/master/website-1-master.tar.bz"

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/autofix.yml
  • actions/checkout v4
  • actions/setup-node v4
  • autofix-ci/action ea32e3a12414e6d3183163c3424a7d7a8631ad84
.github/workflows/ci.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4
  • codecov/codecov-action v4
npm
package.json
  • citty ^0.1.6
  • consola ^3.2.3
  • defu ^6.1.4
  • node-fetch-native ^1.6.4
  • nypm ^0.3.8
  • ohash ^1.1.3
  • pathe ^1.1.2
  • tar ^6.2.1
  • @types/node ^20.12.7
  • @types/tar ^6.1.13
  • @vitest/coverage-v8 ^1.5.0
  • changelogen ^0.5.5
  • eslint ^8.57.0
  • eslint-config-unjs ^0.2.1
  • jiti ^1.21.0
  • prettier ^3.2.5
  • typescript ^5.4.5
  • unbuild ^2.0.0
  • vitest ^1.5.0
  • pnpm 9.0.5

  • Check this box to trigger a request for Renovate to run again on this repository

Status message after cloning showing hyphen (-) instead of slash (/)

Environment

Node: v18.12.1
Package: npx giget@latest

Reproduction

npx giget@latest gh:TechAkayy/icones

Describe the bug

image

Look closely at this screenshot:

Cloned repo - gh:TechAkayy/icones
Status message - Successfully cloned TechAkayy-icones to TechAkayy-icones

Additional context

No response

Logs

No response

Failed to download template 404

Environment

v16.13.1
v18.16.0
v20.5.0

Reproduction

npx giget@latest gh:withastro/astro/examples/basics my-project
npx giget@latest gh:unjs/template

Describe the bug

Screenshot 2023-08-08 at 10 56 01

Additional context

The github link can be downloaded using wget or browser

Logs

No response

[bun] No matching export in "node_modules/node-fetch-native/dist/proxy.cjs"

Bun: 1.0.25

Git repo: https://github.com/tkjaergaard/giget-bun-reproduction

Steps to reproduce

  1. Clone repository
  2. Install Bun version 1.0.25 (https://bun.sh)
  3. Run bun install to install dependencies
  4. Run build command
$ bun build index.ts --outdir=dist --target=node

Error

11 | import { fetch } from 'node-fetch-native/proxy';
              ^
error: No matching export in "node_modules/node-fetch-native/dist/proxy.cjs" for import "fetch"
    at /Users/thomaskjaergaard/projects/internal/giget-bun-reproduction/node_modules/giget/dist/index.mjs:11:10

Originally posted by @tkjaergaard in #140 (comment)

Does not use http proxy on node 20

Environment

node 20.6.1
giget 1.1.3

Reproduction

  1. Start any proxy server with logging:

    // https://github.com/berstend/straightforward
    $ npx straightforward
    
          straightforward forward-proxy running on localhost:9191
  2. Set environment variable

    $env:HTTPS_PROXY="http://127.0.0.1:9191"
    export HTTPS_PROXY="http://127.0.0.1:9191"
  3. Run curl -x http://127.0.0.1:9191 https://example.com to confirm the proxy is working and is printing proxy connections:

             CONNECT         example.com:443
    
  4. Run npx giget github:withastro/astro/examples/basics#latest ./output --force-clean --verbose.

No connection is made through the proxy.

Describe the bug

giget should use the proxy set in environment variable.

https://github.com/unjs/node-fetch-native/blob/47e92fdae1356d3970e40dfafa5614d2c0f68a87/src/index.ts#L22-L29
giget by default is using node's built in fetch in node 20.

The built-in fetch is the same as undici.fetch.
https://github.com/nodejs/node/blob/3e14cfbbcfcedbb18235ffd5cc28983ac5d5ca52/lib/internal/process/pre_execution.js#L314-L316

undici does not support http.Agent but uses a different API: https://undici.nodejs.org/#/docs/api/ProxyAgent

Additional context

Workaround: set the environment variable FORCE_NODE_FETCH.

Logs

No response

Cannot resolve "node-fetch-native/native/proxy" from "..." and externals are not allowed!

Environment

giget 1.2.1
Node 18
Nuxt 3.8.2, 3.9.0, 3.9.1
Nitro 2.8.1

Reproduction

Sorry unable to provide repro as this only appears in workers environment
This was reported on Cloudflare, Vercel

Does not appear in NodeJS, local environments

Describe the bug

Initial bug report was filed in Nuxt-Security there
We initially thought the issue was on our side but were unable to reproduce

Then one user filed logs, and we realized the error was triggered by giget while trying to use node-fetch-native in Workers environments

Additional context

  • The error did not exist before Nuxt 3.8.2
  • Nuxt 3.8.2 upgraded nitropack to 2.8.1
  • [email protected] upgraded node-fetch-native to 1.6.1
  • The log report shows that giget is trying to use node-fetch-native's proxy feature, which was not available in 1.4.1
  • Nuxt-Security uses node-fetch-native 1.4.1

This looks like a version dependency mismatch on node-fetch-native
This is very strange because package managers should usually be able to resolve the correct version without any issue
In fact, in NodeJS environments the issue does not exist

However for some unknown reason, it seems to affect Workers environment

Logs

(node-resolve plugin) Could not resolve import "node-fetch-native/native/proxy" in /opt/_work/myproject/node_modules/.pnpm/[email protected]/node_modules/giget/dist/index.mjs using exports defined in /opt/_work/myproject/node_modules/.pnpm/[email protected]/node_modules/node-fetch-native/package.json.
Error:  [nitro] Error: Cannot resolve "node-fetch-native/native/proxy" from "/opt/_work/myproject/node_modules/.pnpm/[email protected]/node_modules/giget/dist/index.mjs" and externals are not allowed!


undefined
Error:  Cannot resolve "node-fetch-native/native/proxy" from "/opt/_work/myproject/node_modules/.pnpm/[email protected]/node_modules/giget/dist/index.mjs" and externals are not allowed!
  at Object.resolveId (node_modules/.pnpm/[email protected]/node_modules/nitropack/dist/shared/nitro.4ea992bc.mjs:1973:17)
  at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18542:28)
  at async resolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17211:26)
  at async ModuleLoader.resolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17625:15)
  at async Object.resolveId (node_modules/.pnpm/@[email protected][email protected]/node_modules/@rollup/plugin-commonjs/dist/es/index.js:588:10)
  at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18542:28)
  at async resolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17211:26)
  at async ModuleLoader.resolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17625:15)
  at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18542:28)
  at async resolveId (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17211:26) 

Error:  Cannot resolve "node-fetch-native/native/proxy" from "/opt/_work/myproject/node_modules/.pnpm/[email protected]/node_modules/giget/dist/index.mjs" and externals are not allowed!
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.

Try using `gh` cli token as fallback when cloning github sources

Describe the feature

Github already provides this locally if you auth with gh in this case it can cover most private repo cases without creating a new token . This can used by trying to run it with execa fallbacks to undefined

E.g

options.auth = options.auth || (await execa('gh', ['auth', 'token']).then(r => r.stdout).catch(() => undefined))

Maybe it can be a CLI param like --use-gh-auth that enables this function to that might be more viable.

Additional information

  • Would you be willing to help implement this feature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.