Skip to content

Commit

Permalink
build: update Nx 19 & other dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Vojtech Masek <[email protected]>
  • Loading branch information
vmasek committed Sep 5, 2024
1 parent 4f304f2 commit bf7a22d
Show file tree
Hide file tree
Showing 15 changed files with 8,881 additions and 7,816 deletions.
13 changes: 10 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,21 @@
"rules": {
"vitest/consistent-test-filename": [
"warn",
{ "pattern": ".*\\.(unit|integration|e2e)\\.test\\.[tj]sx?$" }
]
{
"pattern": ".*\\.(unit|integration|e2e)\\.test\\.[tj]sx?$"
}
],
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript", "@code-pushup"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": "*.json",
Expand Down
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
- 'esbuild.config.js'
- '.github/ISSUE_TEMPLATE/**'
- '.husky/**'
- 'commitlint.config.js'
- 'commitlint.config.ts'
- '.verdaccio/config.yml'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Thumbs.db
**/.code-pushup

# Nx workspace cache
.nx/cache
.nx
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
/.nx
__snapshots__
37 changes: 0 additions & 37 deletions commitlint.config.js

This file was deleted.

40 changes: 40 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import config from '@commitlint/config-conventional';
import { RuleConfigSeverity, type UserConfig } from '@commitlint/types';
import { getProjects } from '@nx/devkit';
import { FsTree } from 'nx/src/generators/tree';

const projects = getProjects(new FsTree(process.cwd(), false));
const scopes = [
...[...projects]
.filter(
([, { projectType }]) =>
projectType === 'library' || projectType === 'application',
)
.map(([name]) => name),
'tools',
'workflows',
'testing',
].sort();

const configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-tense'],
rules: {
'scope-enum': [RuleConfigSeverity.Error, 'always', scopes],
'type-enum': () => {
const defaultTypes = config.rules['type-enum'][2];
const types = [
...defaultTypes,
'release', // custom type for release commits
];
return [RuleConfigSeverity.Error, 'always', types];
},
'tense/subject-tense': [
RuleConfigSeverity.Error,
'always',
{ firstOnly: true, allowedTenses: ['present-imperative'] },
],
},
};

module.exports = configuration;
1 change: 1 addition & 0 deletions esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = {

try {
await promisify(exec)(
// `npx tsc --emitDeclarationOnly --project ${tsConfig} --outDir dist`,
`tsc --emitDeclarationOnly --project ${tsConfig} --outDir dist`,
);
} catch (err) {
Expand Down
7 changes: 4 additions & 3 deletions examples/react-todos-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "examples/react-todos-app/src",
"projectType": "application",
"tags": ["scope:internal", "type:app"],
"targets": {
"build": {
"executor": "@nx/vite:build",
Expand Down Expand Up @@ -58,7 +59,8 @@
"production": {
"buildTarget": "react-todos-app:build:production"
}
}
},
"dependsOn": ["build"]
},
"run-collect": {
"executor": "nx:run-commands",
Expand All @@ -73,6 +75,5 @@
}
]
}
},
"tags": ["scope:internal", "type:app"]
}
}
2 changes: 1 addition & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const withNxStandards = (): KnipConfigPlugin => () => {
project: ['**/*.{ts,js,tsx,jsx}'],
ignore: ['tmp/**', 'node_modules/**'],
commitlint: {
config: ['commitlint.config.js'],
config: ['commitlint.config.ts'],
},
exclude: ['duplicates'],
entry: [
Expand Down
15 changes: 11 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,22 @@
"./tools/src/debug/debug.plugin.ts",
{
"plugin": "./tools/src/npm/npm.plugin.ts",
"options": { "verbose": true }
"options": {
"verbose": true
}
},
{
"plugin": "./tools/src/publish/publish.plugin.ts",
"options": { "verbose": true }
"options": {
"verbose": true
}
},
{
"plugin": "./tools/src/verdaccio/verdaccio.plugin.ts",
"options": { "verbose": true }
"options": {
"verbose": true
}
}
]
],
"useInferencePlugins": false
}
Loading

0 comments on commit bf7a22d

Please sign in to comment.