From 441c226fbbf8f1af6a49836ada2f5653134de171 Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Tue, 4 Jun 2024 23:35:46 +0200 Subject: [PATCH] Add documentation for bun and deno using private registry (#4661) * Add documentation for bun and deno using private registry * Update setup-bun.md * update docs --- website/docs/setup-bun.md | 46 +++++++++++++++++++ website/docs/setup-deno.md | 44 ++++++++++++++++++ website/sidebars.js | 9 +++- .../versioned_docs/version-5.x/setup-bun.md | 46 +++++++++++++++++++ .../versioned_docs/version-5.x/setup-deno.md | 44 ++++++++++++++++++ .../versioned_docs/version-6.x/setup-bun.md | 46 +++++++++++++++++++ .../versioned_docs/version-6.x/setup-deno.md | 44 ++++++++++++++++++ .../version-5.x-sidebars.json | 9 +++- .../version-6.x-sidebars.json | 9 +++- 9 files changed, 294 insertions(+), 3 deletions(-) create mode 100644 website/docs/setup-bun.md create mode 100644 website/docs/setup-deno.md create mode 100644 website/versioned_docs/version-5.x/setup-bun.md create mode 100644 website/versioned_docs/version-5.x/setup-deno.md create mode 100644 website/versioned_docs/version-6.x/setup-bun.md create mode 100644 website/versioned_docs/version-6.x/setup-deno.md diff --git a/website/docs/setup-bun.md b/website/docs/setup-bun.md new file mode 100644 index 000000000..7716d63cf --- /dev/null +++ b/website/docs/setup-bun.md @@ -0,0 +1,46 @@ +--- +id: setup-bun +title: 'bun' +--- + +# bun {#bun} + +- [Example repository](https://github.com/juanpicado/verdaccio-with-bun) + +## Using registry for a specific project {#specific} + +Create a `bunfig.toml` file at the root of the project and set + +```toml +[install] +registry = "http://localhost:4873" + +``` + +On run `bun install` command the installation will be done from the local registry. + +To enable authenticated access to the registry, you can set the token in the `bunfig.toml` file. + +```toml +[install.scopes] + +# as an object with token +"@scope" = { token = "$npm_token", url = "https://localhost:4873/" } +``` + +Bun provides other ways to configure the registry, you can find more information in the official documentation. + +- [Override the default npm registry for bun install](https://bun.sh/guides/install/custom-registry) +- [Configure a private registry for an organization scope with bun install](https://bun.sh/guides/install/registry-scope) + +## Troubleshooting {#troubleshooting} + +### Clear cache with `bun` + +To remove the cache, seems that you need to remove the `bun.lock` file, this file is created when you run `bun install` and it's located in the root of the project. + +> It may be a better way to do this, please share new solutions. + +```bash +rm bun.lockb +``` diff --git a/website/docs/setup-deno.md b/website/docs/setup-deno.md new file mode 100644 index 000000000..fda066d15 --- /dev/null +++ b/website/docs/setup-deno.md @@ -0,0 +1,44 @@ +--- +id: setup-deno +title: 'deno' +--- + +- [Example repository](https://github.com/juanpicado/verdaccio-with-deno) + +# deno {#deno} + +The minimum supported [deno](https://deno.com/blog/v1.44) version is >1.44.0 + +## Using registry for a specific project {#specific} + +Create a `.npmrc` file and set + +```bash +registry=http://localhost:4873 +``` + +On run `deno` command the installation will be done from the local registry. + +## Troubleshooting {#troubleshooting} + +### Clear cache with `deno` + +```bash +> deno info + +DENO_DIR location: /Users/user/Library/Caches/deno +Remote modules cache: /Users/user/Library/Caches/deno/deps +npm modules cache: /Users/user/Library/Caches/deno/npm +Emitted modules cache: /Users/user/Library/Caches/deno/gen +Language server registries cache: /Users/user/Library/Caches/deno/registries +Origin storage: /Users/user/Library/Caches/deno/location_data +``` + +And remove the local cache for th specific registry you have set (by default is `localhost_4873`) + +```bash +// for MAC OS users (other OS may vary) +rm -Rf /Users/user/Library/Caches/deno/npm/localhost_4873 +``` + +> It's not clear if there is a better way to do this, please refer to the [following discussion](https://github.com/denoland/deno/discussions/9419) for more information. diff --git a/website/sidebars.js b/website/sidebars.js index b578b1ac9..e37dcc488 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -12,7 +12,14 @@ module.exports = { { type: 'category', label: 'Setting up Verdaccio', - items: ['cli-registry', 'setup-npm', 'setup-yarn', 'setup-pnpm'], + items: [ + 'cli-registry', + 'setup-npm', + 'setup-yarn', + 'setup-pnpm', + 'setup-deno', + 'setup-bun', + ], }, 'who-is-using', 'best', diff --git a/website/versioned_docs/version-5.x/setup-bun.md b/website/versioned_docs/version-5.x/setup-bun.md new file mode 100644 index 000000000..7716d63cf --- /dev/null +++ b/website/versioned_docs/version-5.x/setup-bun.md @@ -0,0 +1,46 @@ +--- +id: setup-bun +title: 'bun' +--- + +# bun {#bun} + +- [Example repository](https://github.com/juanpicado/verdaccio-with-bun) + +## Using registry for a specific project {#specific} + +Create a `bunfig.toml` file at the root of the project and set + +```toml +[install] +registry = "http://localhost:4873" + +``` + +On run `bun install` command the installation will be done from the local registry. + +To enable authenticated access to the registry, you can set the token in the `bunfig.toml` file. + +```toml +[install.scopes] + +# as an object with token +"@scope" = { token = "$npm_token", url = "https://localhost:4873/" } +``` + +Bun provides other ways to configure the registry, you can find more information in the official documentation. + +- [Override the default npm registry for bun install](https://bun.sh/guides/install/custom-registry) +- [Configure a private registry for an organization scope with bun install](https://bun.sh/guides/install/registry-scope) + +## Troubleshooting {#troubleshooting} + +### Clear cache with `bun` + +To remove the cache, seems that you need to remove the `bun.lock` file, this file is created when you run `bun install` and it's located in the root of the project. + +> It may be a better way to do this, please share new solutions. + +```bash +rm bun.lockb +``` diff --git a/website/versioned_docs/version-5.x/setup-deno.md b/website/versioned_docs/version-5.x/setup-deno.md new file mode 100644 index 000000000..fda066d15 --- /dev/null +++ b/website/versioned_docs/version-5.x/setup-deno.md @@ -0,0 +1,44 @@ +--- +id: setup-deno +title: 'deno' +--- + +- [Example repository](https://github.com/juanpicado/verdaccio-with-deno) + +# deno {#deno} + +The minimum supported [deno](https://deno.com/blog/v1.44) version is >1.44.0 + +## Using registry for a specific project {#specific} + +Create a `.npmrc` file and set + +```bash +registry=http://localhost:4873 +``` + +On run `deno` command the installation will be done from the local registry. + +## Troubleshooting {#troubleshooting} + +### Clear cache with `deno` + +```bash +> deno info + +DENO_DIR location: /Users/user/Library/Caches/deno +Remote modules cache: /Users/user/Library/Caches/deno/deps +npm modules cache: /Users/user/Library/Caches/deno/npm +Emitted modules cache: /Users/user/Library/Caches/deno/gen +Language server registries cache: /Users/user/Library/Caches/deno/registries +Origin storage: /Users/user/Library/Caches/deno/location_data +``` + +And remove the local cache for th specific registry you have set (by default is `localhost_4873`) + +```bash +// for MAC OS users (other OS may vary) +rm -Rf /Users/user/Library/Caches/deno/npm/localhost_4873 +``` + +> It's not clear if there is a better way to do this, please refer to the [following discussion](https://github.com/denoland/deno/discussions/9419) for more information. diff --git a/website/versioned_docs/version-6.x/setup-bun.md b/website/versioned_docs/version-6.x/setup-bun.md new file mode 100644 index 000000000..7716d63cf --- /dev/null +++ b/website/versioned_docs/version-6.x/setup-bun.md @@ -0,0 +1,46 @@ +--- +id: setup-bun +title: 'bun' +--- + +# bun {#bun} + +- [Example repository](https://github.com/juanpicado/verdaccio-with-bun) + +## Using registry for a specific project {#specific} + +Create a `bunfig.toml` file at the root of the project and set + +```toml +[install] +registry = "http://localhost:4873" + +``` + +On run `bun install` command the installation will be done from the local registry. + +To enable authenticated access to the registry, you can set the token in the `bunfig.toml` file. + +```toml +[install.scopes] + +# as an object with token +"@scope" = { token = "$npm_token", url = "https://localhost:4873/" } +``` + +Bun provides other ways to configure the registry, you can find more information in the official documentation. + +- [Override the default npm registry for bun install](https://bun.sh/guides/install/custom-registry) +- [Configure a private registry for an organization scope with bun install](https://bun.sh/guides/install/registry-scope) + +## Troubleshooting {#troubleshooting} + +### Clear cache with `bun` + +To remove the cache, seems that you need to remove the `bun.lock` file, this file is created when you run `bun install` and it's located in the root of the project. + +> It may be a better way to do this, please share new solutions. + +```bash +rm bun.lockb +``` diff --git a/website/versioned_docs/version-6.x/setup-deno.md b/website/versioned_docs/version-6.x/setup-deno.md new file mode 100644 index 000000000..fda066d15 --- /dev/null +++ b/website/versioned_docs/version-6.x/setup-deno.md @@ -0,0 +1,44 @@ +--- +id: setup-deno +title: 'deno' +--- + +- [Example repository](https://github.com/juanpicado/verdaccio-with-deno) + +# deno {#deno} + +The minimum supported [deno](https://deno.com/blog/v1.44) version is >1.44.0 + +## Using registry for a specific project {#specific} + +Create a `.npmrc` file and set + +```bash +registry=http://localhost:4873 +``` + +On run `deno` command the installation will be done from the local registry. + +## Troubleshooting {#troubleshooting} + +### Clear cache with `deno` + +```bash +> deno info + +DENO_DIR location: /Users/user/Library/Caches/deno +Remote modules cache: /Users/user/Library/Caches/deno/deps +npm modules cache: /Users/user/Library/Caches/deno/npm +Emitted modules cache: /Users/user/Library/Caches/deno/gen +Language server registries cache: /Users/user/Library/Caches/deno/registries +Origin storage: /Users/user/Library/Caches/deno/location_data +``` + +And remove the local cache for th specific registry you have set (by default is `localhost_4873`) + +```bash +// for MAC OS users (other OS may vary) +rm -Rf /Users/user/Library/Caches/deno/npm/localhost_4873 +``` + +> It's not clear if there is a better way to do this, please refer to the [following discussion](https://github.com/denoland/deno/discussions/9419) for more information. diff --git a/website/versioned_sidebars/version-5.x-sidebars.json b/website/versioned_sidebars/version-5.x-sidebars.json index 54e1abfed..12f624850 100644 --- a/website/versioned_sidebars/version-5.x-sidebars.json +++ b/website/versioned_sidebars/version-5.x-sidebars.json @@ -10,7 +10,14 @@ { "type": "category", "label": "Setting up Verdaccio", - "items": ["cli-registry", "setup-npm", "setup-yarn", "setup-pnpm"] + "items": [ + "cli-registry", + "setup-npm", + "setup-yarn", + "setup-pnpm", + "setup-deno", + "setup-bun" + ] }, "configuration", "who-is-using", diff --git a/website/versioned_sidebars/version-6.x-sidebars.json b/website/versioned_sidebars/version-6.x-sidebars.json index fa9ca57fd..aafd24d06 100644 --- a/website/versioned_sidebars/version-6.x-sidebars.json +++ b/website/versioned_sidebars/version-6.x-sidebars.json @@ -10,7 +10,14 @@ { "type": "category", "label": "Setting up Verdaccio", - "items": ["cli-registry", "setup-npm", "setup-yarn", "setup-pnpm"] + "items": [ + "cli-registry", + "setup-npm", + "setup-yarn", + "setup-pnpm", + "setup-deno", + "setup-bun" + ] }, "who-is-using", "best",