Skip to content

Commit

Permalink
added publishing and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
prztrz committed Aug 30, 2024
1 parent b06be56 commit 8e4d7c6
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
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 }}
81 changes: 80 additions & 1 deletion README.md
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.

0 comments on commit 8e4d7c6

Please sign in to comment.