diff --git a/env.example b/.gitea.env.example similarity index 100% rename from env.example rename to .gitea.env.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/README.md b/README.md index e0a417c..dd73292 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,21 @@ -# Setting up yarn v3 to work with Gitea +# Setting up `npm`or `yarn` v3 to work with Gitea -Instead of using Yarn Classic (V1), we are using V3 for working with new projects. This is for the reason that Yarn Classic is annoying when working with Gitea repositories and shouldn't really be bothered with. +This is a guide to working with Gitea Tornado packages. -The guide to installing and configuring Yarn V3 follows. +We can either use NPM or Yarn V3 for working with new projects. Yarn classic does not support other registries nicely. Using Yarn V3 requires more time (you have to know how to write the config), but Yarn is much more powerful and allow smoother dependency management. -# Install guide +The guide to installing and configuring NPM and Yarn V3 follows. + +## Short `npm` solution + +```bash +# Replace T-Hax with tornadocash if the packages (in future) are under the org +# This should be updated manually though +# For any package add into your .npmrc +@tornado:registry=https://development.tornadocash.community/api/packages/T-Hax/npm/ +``` + +## Proper `yarn` solution (more privacy) Checkout [tl;dr](./TLDR.md) if you are about to fall asleep. @@ -40,7 +51,13 @@ This is similar to python packaging (pip and venvs) and is preferable for workin In any case check out the [sample config for this gitea, it will be kept updated.](./yarnrc.yml). -## Tip +## Tips + +### Errors + +If you are installing packages and you meet `Invalid authentication (as an unknown user)` then try to comment out the AUTH token for the install process. + +### Breaking changes Yarn V1 renaming a package: diff --git a/TLDR.md b/TLDR.md index b40b9c9..129457f 100644 --- a/TLDR.md +++ b/TLDR.md @@ -1,3 +1,14 @@ +repeating the short npm solution + +```yaml +# For any package add into your .npmrc +# Replace T-Hax with tornadocash if the packages (in future) are under the org +# This should be updated manually though +@tornado:registry=https://development.tornadocash.community/api/packages/T-Hax/npm/ +``` + +otherwise if ready to use yarn 3: + install ```bash diff --git a/gitignore b/gitignore index c8600e0..48bbb70 100644 --- a/gitignore +++ b/gitignore @@ -1,3 +1,6 @@ +# The below config will determine whether you are using Zero-Installs or not. You should read about +# Zero-Installs on https://yarnpkg.com/features/zero-installs + # If you're using Zero-Installs: # .yarn/* diff --git a/yarnrc.yml b/yarnrc.yml index 2e9a700..8b17868 100644 --- a/yarnrc.yml +++ b/yarnrc.yml @@ -1,11 +1,12 @@ # So basically, we want to selectively download packages from the Gitea repository but still allow the -# main repositories, so we are going to have to scope OUR packages properly. This means, unless the tornadocash -# Gitea organization defines a default scope, that we'll have to add every user scope. Including my own below. -# Note that all scopes are after @ prefix. So my prefix is @thax +# main repositories, so we are going to have to scope our packages properly. npmScopes: - thax: + tornado: + # The @tornado scope can just be set to the right registry by editing the "T-Hax" here. + # I could even make it an env var but it seems too much, env is better for secrets. npmPublishRegistry: "https://development.tornadocash.community/api/packages/T-Hax/npm/" npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/" + # The below can be EXPORTED via some env file which actually exports the variables though # Check the env.example, you will notice it's not a regular env # So split your env files up, since this is only for manual actions @@ -16,10 +17,5 @@ npmScopes: # If you want to use the new linkers uncomment or change the following nodeLinker: "node-modules" -# So the tornadocash org, the person who maintains it, might setup something (in future) like, -# tornadocash: -# npmPublishRegistry: "https://development.tornadocash.community/api/packages/tornadocash/npm/" -# npmRegistryServer: "https://development.tornadocash.community/api/packages/tornadocash/npm/" - # We disable telemetry for obvious reasons. enableTelemetry: false \ No newline at end of file