-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Publish Package to npmjs | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.4 | ||
# Setup .npmrc file to publish to npm | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.12 | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: pnpm i --frozen-lockfile | ||
- run: pnpm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,80 @@ | ||
# omnicalculator-eslint-config | ||
# Omni Calculator eslint config ⚙️ | ||
|
||
This is eslint configuration meant to be used across different projects and/or repositories within [Omni Calculator](https://www.omnicalculator.com) company | ||
|
||
## Usage | ||
|
||
### Prerequisites | ||
- [eslint](https://www.npmjs.com/package/eslint) — version 9.x must be installed in your projext. | ||
|
||
### Installation | ||
Simply install omnicalculator-eslint-config with your favorite package manager as **development dependency** | ||
```bash | ||
npm install -D omnicalculator-eslint-config | ||
|
||
#or | ||
pnpm i -D omnicalculator-eslint-config | ||
|
||
#or | ||
yarn add -D omnicalculator-eslint-config | ||
``` | ||
|
||
### Usage | ||
Use this configuration preset in you `eslint.config.js` file. If you do not need to extend this configuration simply reexport: | ||
```js | ||
// eslint.config.js | ||
const omniCalculatorEslintConfig = require(' omnicalculator-eslint-config'); | ||
|
||
module.exports = omniCalculatorEslintConfig; | ||
``` | ||
|
||
In case yoy need to extend thuis configuration simply add your config at the end to exported array: | ||
```js | ||
// eslint.config.js | ||
const omniCalculatorEslintConfig = require(' omnicalculator-eslint-config'); | ||
|
||
module.exports = [ | ||
...omniCalculatorEslintConfig, | ||
{ | ||
files: ['**/legacy'], | ||
rules: { complexity: 'off'}, | ||
} | ||
]; | ||
|
||
``` | ||
|
||
## Development | ||
|
||
### Prerequisites | ||
|
||
- [Node.js](https://nodejs.org) — version 20.x | ||
- [pnpm](https://pnpm.io/) — version 9.x | ||
|
||
|
||
### Install | ||
|
||
Install dependencies with: | ||
|
||
```sh | ||
$ pnpm install | ||
``` | ||
|
||
### Running | ||
|
||
Once you installed depedencies you are good to start development, no other action is required. | ||
|
||
```sh | ||
$ pnpm knex-migrate | ||
``` | ||
|
||
> **Note** | ||
> | ||
> To run migrations you need to supply the .env file. For the development purposes you can use thre .env.development, just rename it to .env | ||
|
||
## Publication | ||
|
||
To publish next version of this npm package first create a branch from `main`. Release branch should be named: `release-[versionTag]`, where `[versionTag]` is tag of version you want to publish. | ||
|
||
Push such branch to github and follow github instructions on [creating and publishing release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) in github GUI. | ||
|