Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup NodeJS
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: 18
node-version: 24
- name: Install node dependencies
run: npm ci
- name: Run code-style
run: npm run check:code-style -ws
- name: Run type check
run: npm run typecheck
- name: Run linter
run: npm run lint
- name: Run tests
run: npm test -ws
run: npm test

release:
name: Create release and publish
Expand All @@ -32,17 +34,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup NodeJS
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: 18
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Install node dependencies
run: npm ci
- name: Build
run: npm run build -ws
- name: Release and publish using lerna with conventional commits
run: npm run build
- name: Check that the tag matches the package version
run: test "${{ github.ref_name }}" = "v$(node -p "require('./package.json').version")"
- name: Publish packages
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: npx lerna publish from-package --yes
run: npm publish --workspaces
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

## Creating a release

Run `npx lerna version --no-private` to create a new release. It will be automatically published via CI.
All packages share one version. Run `npm run release -- <major|minor|patch|x.y.z>` to bump every package, commit and
tag the release, then push it with `git push --follow-tags`. The tag is published to npm via CI.

The release also sets the peer dependencies of the formatter and the plugins on `@brainbits/node-logger` to the new
version, as they are built against the core package of the same release.
66 changes: 66 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import vitest from '@vitest/eslint-plugin';
import { defineConfig } from 'eslint/config';
import importX from 'eslint-plugin-import-x';
import tseslint from 'typescript-eslint';

const testFiles = ['**/*.test.ts'];

export default defineConfig([
{
ignores: ['**/dist/', '**/coverage/', 'examples/'],
},
js.configs.recommended,
tseslint.configs.recommendedTypeChecked,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
stylistic.configs.customize({
indent: 4,
semi: true,
braceStyle: '1tbs',
quoteProps: 'as-needed',
}),
{
settings: {
'import-x/resolver': {
// Resolve workspace packages to their sources, so no build is needed for linting
typescript: { conditionNames: ['@brainbits/source', 'types', 'import', 'node', 'default'] },
},
},
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['eslint.config.js'],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
eqeqeq: ['error', 'always', { null: 'ignore' }],
'@stylistic/max-len': ['error', 120, 2, {
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
'import-x/no-extraneous-dependencies': ['error', { devDependencies: ['*.config.{js,ts}'] }],
// Flags the documented default imports of typescript-eslint and import-x; TypeScript checks imports anyway
'import-x/no-named-as-default': 'off',
'import-x/no-named-as-default-member': 'off',
},
},
{
files: testFiles,
...vitest.configs.recommended,
rules: {
...vitest.configs.recommended.rules,
// expect(obj.method) and vi.mocked(obj.method) only pass the method around,
// which the vitest variant of the rule knows.
'@typescript-eslint/unbound-method': 'off',
'vitest/unbound-method': 'error',
// The tooling is installed in the workspace root, which the rule does not consider for package files
'import-x/no-extraneous-dependencies': 'off',
},
},
]);
Loading
Loading