Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ancss/nodets-shared
https://github.com/ancss/nodets-shared
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ancss/nodets-shared
- Owner: Ancss
- Created: 2024-02-28T13:23:26.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-02-28T15:39:18.000Z (11 months ago)
- Last Synced: 2024-11-22T00:46:43.680Z (about 2 months ago)
- Language: TypeScript
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Shared Library
* The shared library contains codes that are used acrossed the microservices.
* The idea behind this was to prevent code duplication.
* The library is published as an npm package to `github package registry`.
* You need to publish this `shared library` to `github package registry` to be able to use it.### Steps required to publish your package
* Clone or download this repo
* Open the project in a terminal and remove `.git` folder from the package
* On Unix, run `rm -rf .git`
* On Windows, you can use git bash or show hiddens files
* Execute `git init` command inside the project.
* Create a `personal access token` on github.
* Export the token locally with key `NPM_TOKEN`.
* Keep the `personal access token` because it will be needed.
* In your `.npmrc` file, add
```sh
@:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
```
* Replace `` with your github username.
* In your `Package.json` file, add the value to the following fields
* `name`: `@/`
* `author`: ``
* `url`: `git+.git`
* You can update the `dependencies` and `devDependencies`.
* In the `.github/workflows` folder, replace `` inside the `publish.yml` with your own github username.
* You can change the `node-version` to something higher.
* Create your own github project for the package.
* Push the code to github.
* Once you push, a github actions build will be triggered. If no error, your package will be published.## Import
Whenever you make any change to the shared library folder, make sure to increment the `version` number inside `Package.json` file.