Skip to content

Commit 8c41e56

Browse files
authored
Update workflows, dependencies, and code structure for consistency (#34)
* 🔧 chore: update dependencies ## Dependencies - Update @localazy/languages from ^0.1.6 to ^0.1.11 - Update @localazy/eslint-config from ^1.0.0-beta.2 to ^1.3.0 - Update @localazy/prettier-config from ^1.0.0-beta.2 to ^1.2.0 - Update @localazy/tsconfig from ^1.0.0-beta.4 to ^1.1.1 - Update @types/node from ^22.17.1 to ^22.18.0 - Update eslint from ^9.32.0 to ^9.34.0 - Update fetch-mock from ^12.5.3 to ^12.5.4 - Update unplugin-replace from ^0.2.1 to ^0.6.1 - Update vite from ^6.3.5 to ^7.1.3 - Update vite-plugin-node-polyfills from ^0.23.0 to ^0.24.0 * 🔧 chore: update configurations for ESLint, Prettier, and TypeScript - Replace `.prettierrc.js` with `"prettier"` key in `package.json` - Update `tsconfig.json` to use `tsconfig.package.json` and new compiler options - Adjust ESLint config syntax for correct options import * 🔧 chore(types): convert imports to `import type` where applicable - Refactor all imports across types and test files to use `import type` for TypeScript type-only declarations. - Replace `fs` import with `node:fs` for consistency. * 💄 style(prettier): Fix formatting across the codebase * ♻️ refactor(tests): Add `assertNotNull` utility for improved null handling - Replace direct null/undefined checks with `assertNotNull` in test files. - Ensure stricter type safety and add consistency across file and API tests. - Add missing `assertNotNull` utility function under `@tests/support`. * ♻️ refactor(imports): Use explicit `.js` extensions in all imports - Enforce `.js` extension for both absolute and relative imports for better compatibility. - Update ESLint to enforce `forceJsExtensions`. - Remove unused `nodePolyfills` plugin in `vite.config.ts`. * 🔧 chore(scripts): introduce Node.js test matrix and update workflows - Add `scripts/node-test-matrix.sh` for running tests across Node.js versions (20, 22, 24). - Update `.github/workflows/qa.yml` to utilize a Node.js version matrix in CI. - Add new `test:matrix` script to `package.json` for local testing. - Refine `package.json` by simplifying `files` and adding Node.js engine requirement. * 🔧 chore: Update CI
1 parent 1ae3dc1 commit 8c41e56

File tree

81 files changed

+3857
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3857
-705
lines changed

.github/workflows/qa.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,39 @@ on:
77

88
jobs:
99
qa:
10-
name: Code Quality
10+
name: Code Quality Node ${{ matrix.node }}
1111
runs-on: [self-hosted, Linux]
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
node: [20, 22, 24]
1216
steps:
1317
- name: Checkout repository
1418
uses: actions/checkout@v4
1519

16-
- name: Setup Node
20+
- name: Setup Node ${{ matrix.node }}
1721
uses: actions/setup-node@v4
1822
with:
19-
node-version-file: .nvmrc
23+
node-version: ${{ matrix.node }}
2024

2125
- name: Install dependencies
2226
run: npm ci
2327

24-
- name: Lint source files
25-
run: npm run lint
26-
2728
- name: Run Prettier
2829
run: npm run prettier
2930

31+
- name: Lint source files
32+
run: npm run lint
33+
3034
- name: Check types
3135
run: npm run typecheck
3236

33-
- name: Run tests
34-
run: npm run test:coverage
35-
3637
- name: Build package
3738
run: npm run build
3839

40+
- name: Run tests with coverage
41+
run: npm run test:coverage
42+
3943
- name: 'Report Coverage'
40-
if: always()
44+
if: matrix.node == 22 && always()
4145
uses: davelosert/vitest-coverage-report-action@v2

.prettierrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/api-client-reference.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,13 @@ await api.webhooks.update({
674674
customId: '1',
675675
description: 'This is a test webhook',
676676
url: 'https://example.com/webhook',
677-
events: ['comment_added', 'import_finished', 'import_finished_empty', 'project_published', 'tag_promoted'],
677+
events: [
678+
'comment_added',
679+
'import_finished',
680+
'import_finished_empty',
681+
'project_published',
682+
'tag_promoted',
683+
],
678684
},
679685
],
680686
});

eslint.config.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import localazy from '@localazy/eslint-config';
1+
import { localazy } from '@localazy/eslint-config';
22

3-
export default localazy({
3+
/** @type {import('@localazy/eslint-config').LocalazyOptions} */
4+
const config = {
45
ignoreDefinitions: ['.gitignore'],
6+
features: {
7+
forcePathAliases: true,
8+
forceJsExtensions: true,
9+
},
510
userConfigs: [
611
{
712
ignores: ['examples'],
@@ -15,4 +20,6 @@ export default localazy({
1520
},
1621
},
1722
],
18-
});
23+
};
24+
25+
export default localazy(config);

0 commit comments

Comments
 (0)