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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

40 changes: 0 additions & 40 deletions .eslintrc.json

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ testem.log
Thumbs.db

.nx

vite.config.*.timestamp*
vitest.config.*.timestamp*
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.1.0
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"eslint.validate": ["json"]
"eslint.validate": ["json"],
"kiroAgent.configureMCP": "Disabled"
}
158 changes: 158 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import nxEslintPlugin from '@nx/eslint-plugin';
import jestExtendedPlugin from 'eslint-plugin-jest-extended';
import jsoncParser from 'jsonc-eslint-parser';
import fs from 'node:fs';
import tseslint from 'typescript-eslint';
import node from '@code-pushup/eslint-config/node.js';
import typescript from '@code-pushup/eslint-config/typescript.js';
import vitest from '@code-pushup/eslint-config/vitest.js';

export default tseslint.config(
...typescript,
...node,
...vitest,
{
settings: {
'import/resolver': {
typescript: {
project: 'tsconfig.base.json',
alwaysTryTypes: true,
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
},
node: {
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
},
},
},
},
{ plugins: { '@nx': nxEslintPlugin } },
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [
String.raw`^.*/eslint(\.base)?\.config\.[cm]?js$`,
String.raw`^.*/code-pushup\.(config|preset)(\.m?[jt]s)?$`,
'^[./]+/tools/.*$',
String.raw`^[./]+/(testing/)?test-setup-config/src/index\.js$`,
],
depConstraints: [
{
sourceTag: 'scope:shared',
onlyDependOnLibsWithTags: ['scope:shared'],
},
{
sourceTag: 'scope:core',
onlyDependOnLibsWithTags: ['scope:core', 'scope:shared'],
},
{
sourceTag: 'scope:plugin',
onlyDependOnLibsWithTags: ['scope:shared'],
},
{
sourceTag: 'scope:tooling',
onlyDependOnLibsWithTags: ['scope:tooling', 'scope:shared'],
},
{
sourceTag: 'type:e2e',
onlyDependOnLibsWithTags: [
'type:app',
'type:feature',
'type:util',
'type:testing',
],
},
{
sourceTag: 'type:app',
onlyDependOnLibsWithTags: [
'type:feature',
'type:util',
'type:testing',
],
},
{
sourceTag: 'type:feature',
onlyDependOnLibsWithTags: [
'type:feature',
'type:util',
'type:testing',
],
},
{
sourceTag: 'type:util',
onlyDependOnLibsWithTags: ['type:util', 'type:testing'],
},
{
sourceTag: 'type:testing',
onlyDependOnLibsWithTags: ['type:util', 'type:testing'],
},
],
},
],
},
},
{
files: ['**/*.test.ts', '**/*.spec.ts'],
plugins: { 'jest-extended': jestExtendedPlugin },
rules: {
'vitest/consistent-test-filename': [
'warn',
{
pattern: String.raw`.*\.(bench|type|unit|int|e2e)\.test\.[tj]sx?$`,
},
],
'jest-extended/prefer-to-be-array': 'warn',
'jest-extended/prefer-to-be-false': 'warn',
'jest-extended/prefer-to-be-object': 'warn',
'jest-extended/prefer-to-be-true': 'warn',
'jest-extended/prefer-to-have-been-called-once': 'warn',
},
},
{
files: ['**/*.type.test.ts'],
rules: {
'vitest/expect-expect': 'off',
},
},
{
files: ['**/*.json'],
languageOptions: { parser: jsoncParser },
},
{
files: ['**/*.ts', '**/*.js'],
rules: {
'n/file-extension-in-import': ['error', 'always'],
'unicorn/number-literal-case': 'off',
},
},
{
files: ['**/perf/**/*.ts'],
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
'sonarjs/no-duplicate-string': 'off',
},
},
{
// tests need only be compatible with local Node version
// publishable packages should pick up version range from "engines" in their package.json
files: ['e2e/**/*.ts', 'testing/**/*.ts', '**/*.test.ts'],
settings: {
node: {
version: fs.readFileSync('.node-version', 'utf8'),
},
},
},
{
ignores: [
'**/*.mock.*',
'**/code-pushup.config.ts',
'**/mocks/fixtures/**',
'**/__snapshots__/**',
'**/dist',
'**/*.md',
],
},
);
40 changes: 26 additions & 14 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
{
"migrations": [
{
"cli": "nx",
"version": "19.2.0-beta.2",
"description": "Updates the default workspace data directory to .nx/workspace-data",
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory",
"version": "22.0.0-beta.1",
"description": "Updates release version config based on the breaking changes in Nx v22",
"implementation": "./src/migrations/update-22-0-0/release-version-config-changes",
"package": "nx",
"name": "22-0-0-release-version-config-changes"
},
{
"version": "22.0.0-beta.2",
"description": "Consolidates releaseTag* options into nested releaseTag object structure",
"implementation": "./src/migrations/update-22-0-0/consolidate-release-tag-config",
"package": "nx",
"name": "19-2-0-move-graph-cache-directory"
"name": "22-0-0-consolidate-release-tag-config"
},
{
"cli": "nx",
"version": "19.2.2-beta.0",
"version": "22.1.0-beta.5",
"description": "Updates the nx wrapper.",
"implementation": "./src/migrations/update-17-3-0/update-nxw",
"implementation": "./src/migrations/update-22-1-0/update-nx-wrapper",
"package": "nx",
"name": "19-2-2-update-nx-wrapper"
"name": "22-1-0-update-nx-wrapper"
},
{
"version": "19.2.4-beta.0",
"description": "Set project name in nx.json explicitly",
"implementation": "./src/migrations/update-19-2-4/set-project-name",
"x-repair-skip": true,
"package": "nx",
"name": "19-2-4-set-project-name"
"version": "22.0.0-beta.0",
"description": "Remove the deprecated `external` and `externalBuildTargets` options from the `@nx/js:swc` and `@nx/js:tsc` executors.",
"factory": "./src/migrations/update-22-0-0/remove-external-options-from-js-executors",
"package": "@nx/js",
"name": "remove-external-options-from-js-executors"
},
{
"version": "22.1.0-rc.1",
"description": "Removes redundant TypeScript project references from project's tsconfig.json files when runtime tsconfig files (e.g., tsconfig.lib.json, tsconfig.app.json) exist.",
"factory": "./src/migrations/update-22-1-0/remove-redundant-ts-project-references",
"package": "@nx/js",
"name": "remove-redundant-ts-project-references"
}
]
}
96 changes: 89 additions & 7 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,102 @@
"appsDir": "packages",
"libsDir": "packages"
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"os": [{ "runtime": "node -e \"console.log(require('os').platform())\"" }],
"production": [
"default",
"!{projectRoot}/README.md",
"!{projectRoot}/CHANGELOG.md",
"!{projectRoot}/perf/**/*",
"!{projectRoot}/tools/**/*",
"!{projectRoot}/zod2md.config.ts",
"!{projectRoot}/eslint.config.?(c)js",
"!{workspaceRoot}/**/.code-pushup/**/*",
"!{projectRoot}/code-pushup.config.?(m)[jt]s",
"!{projectRoot}/code-pushup.config.bundled_*.mjs",
"!{projectRoot}/@(test|mocks|mock)/**/*",
"!{projectRoot}/**/?(*.)test.[jt]s?(x)?(.snap)",
"!{projectRoot}/**/?(*.)mocks.[jt]s?(x)",
"!{projectRoot}/**/?(*.)mock.[jt]s?(x)",
"!{projectRoot}/vitest.@(unit|int|e2e).config.[jt]s",
"!{projectRoot}/dist/**/*",
"!{projectRoot}/tsconfig.@(test|tools).json",
"!{workspaceRoot}/**/(*.)coverage/**/*"
],
"test-vitest-inputs": [
"os",
{ "env": "NX_VERBOSE_LOGGING" },
{ "externalDependencies": ["vitest"] }
],
"lint-eslint-inputs": [{ "externalDependencies": ["eslint"] }],
"typecheck-typescript-inputs": [{ "externalDependencies": ["typescript"] }],
"code-pushup-inputs": [
{ "env": "NODE_OPTIONS" },
{ "env": "TSX_TSCONFIG_PATH" }
],
"sharedGlobals": [{ "runtime": "node -v" }, { "runtime": "npm -v" }]
},
"targetDefaults": {
"@nx/esbuild:esbuild": {
"lint": {
"inputs": ["default", "lint-eslint-inputs"],
"outputs": ["{projectRoot}/.eslint/**/*"],
"cache": true,
"executor": "nx:run-commands",
"options": {
"command": "eslint",
"args": [
"'{projectRoot}/**/*.ts'",
"{projectRoot}/package.json",
"--config={projectRoot}/eslint.config.js",
"--max-warnings=0",
"--error-on-unmatched-pattern=false"
]
}
},
"build": {
"dependsOn": ["^build"],
"inputs": ["default", "^default"]
"inputs": ["production", "^production"],
"cache": true,
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist",
"main": "{projectRoot}/src/index.ts",
"tsConfig": "{projectRoot}/tsconfig.lib.json",
"assets": ["{projectRoot}/*.md"]
}
},
"@nx/vite:test": {
"unit-test": {
"cache": true,
"inputs": ["default", "^default"]
"inputs": ["default", "^production", "test-vitest-inputs"],
"outputs": [
"{workspaceRoot}/coverage/{projectName}/unit-tests/lcov.info"
],
"executor": "@nx/vitest:test",
"options": {
"configFile": "{projectRoot}/vitest.unit.config.ts",
"coverage": {
"enabled": true
}
}
},
"@nx/js:tsc": {
"int-test": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["default", "^default"]
"inputs": ["default", "^production", "test-vitest-inputs"],
"outputs": ["{workspaceRoot}/coverage/{projectName}/int-tests/lcov.info"],
"executor": "@nx/vitest:test",
"options": {
"configFile": "{projectRoot}/vitest.int.config.ts",
"coverage": {
"enabled": true
}
}
},
"e2e": {
"cache": true,
"inputs": ["default", "test-vitest-inputs"],
"dependsOn": ["^build"]
}
},
"plugins": []
Expand Down
Loading
Loading