@trackunit/iris-app 2.14.13 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/package.json +6 -6
- package/src/executors/submit/executor.d.ts +1 -0
- package/src/executors/submit/executor.js +2 -1
- package/src/generators/create/generator.js +10 -2
- package/src/generators/extend/files/react-app/src/index.tsx__template__ +1 -1
- package/src/generators/extend/generator.js +11 -1
- package/src/generators/preset/generator.js +30 -6
- package/src/generators/preset/root-files/eslint.config.cjs__template__ +20 -0
- package/src/generators/utils/uses-trackunit-eslint-plugin.d.ts +12 -0
- package/src/generators/utils/uses-trackunit-eslint-plugin.js +23 -0
- package/src/generators/utils/write-trackunit-project-eslint-config.d.ts +10 -0
- package/src/generators/utils/write-trackunit-project-eslint-config.js +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
+
## 2.15.1 (2026-10-29)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- ⚠️ **iris-app-build-utilities:** one migrate suggestion instead of per-package version warnings [SDK-569] ([#27025](https://github.com/Trackunit/manager/pull/27025))
|
|
6
|
+
|
|
7
|
+
### ⚠️ Breaking Changes
|
|
8
|
+
|
|
9
|
+
- **iris-app-build-utilities:** one migrate suggestion instead of per-package version warnings [SDK-569] ([#27025](https://github.com/Trackunit/manager/pull/27025))
|
|
10
|
+
|
|
11
|
+
### 🧱 Updated Dependencies
|
|
12
|
+
|
|
13
|
+
- Updated iris-app-build-utilities to 3.0.0
|
|
14
|
+
- Updated iris-app-api to 2.12.17
|
|
15
|
+
- Updated react-vite-test-setup to 0.0.187
|
|
16
|
+
- Updated css-classname-utils to 0.0.95
|
|
17
|
+
- Updated react-graphql-tools to 1.23.17
|
|
18
|
+
- Updated shared-utils to 1.22.14
|
|
19
|
+
|
|
20
|
+
### ❤️ Thank You
|
|
21
|
+
|
|
22
|
+
- Mikkel Thorbjørn Andersen @mta-trackunit
|
|
23
|
+
|
|
24
|
+
## 2.15.0 (2026-10-29)
|
|
25
|
+
|
|
26
|
+
### 🚀 Features
|
|
27
|
+
|
|
28
|
+
- **iris-app:** e2e proves new workspaces lint with zero problems [SDK-572] ([59bcb7644aa](https://github.com/Trackunit/manager/commit/59bcb7644aa))
|
|
29
|
+
- **iris-app:** extend generator follows the workspace's lint setup [SDK-572] ([c2d205700c3](https://github.com/Trackunit/manager/commit/c2d205700c3))
|
|
30
|
+
- **iris-app:** create generator follows the workspace's lint setup [SDK-572] ([7486293ef6c](https://github.com/Trackunit/manager/commit/7486293ef6c))
|
|
31
|
+
- **iris-app:** detect whether a workspace uses the Trackunit ESLint plugin [SDK-572] ([28f9254308e](https://github.com/Trackunit/manager/commit/28f9254308e))
|
|
32
|
+
- **iris-app:** set up Trackunit linting in new IrisX workspaces [SDK-572] ([32ac46eb642](https://github.com/Trackunit/manager/commit/32ac46eb642))
|
|
33
|
+
- **iris-app:** fix generated UI extension code that fails lint [SDK-572] ([f40a8519e90](https://github.com/Trackunit/manager/commit/f40a8519e90))
|
|
34
|
+
|
|
35
|
+
### 🩹 Fixes
|
|
36
|
+
|
|
37
|
+
- **iris-app:** address phase review for Trackunit lint generators [SDK-572] ([faaa54c25b8](https://github.com/Trackunit/manager/commit/faaa54c25b8))
|
|
38
|
+
|
|
39
|
+
### 🧱 Updated Dependencies
|
|
40
|
+
|
|
41
|
+
- Updated iris-app-build-utilities to 2.10.16
|
|
42
|
+
- Updated iris-app-api to 2.12.16
|
|
43
|
+
- Updated react-vite-test-setup to 0.0.186
|
|
44
|
+
- Updated css-classname-utils to 0.0.94
|
|
45
|
+
- Updated react-graphql-tools to 1.23.16
|
|
46
|
+
- Updated shared-utils to 1.22.13
|
|
47
|
+
|
|
48
|
+
### ❤️ Thank You
|
|
49
|
+
|
|
50
|
+
- Mikkel Thorbjørn Andersen
|
|
51
|
+
|
|
52
|
+
## 2.14.15 (2026-10-29)
|
|
53
|
+
|
|
54
|
+
### 🧱 Updated Dependencies
|
|
55
|
+
|
|
56
|
+
- Updated iris-app-build-utilities to 2.10.15
|
|
57
|
+
- Updated iris-app-api to 2.12.15
|
|
58
|
+
- Updated react-vite-test-setup to 0.0.185
|
|
59
|
+
- Updated css-classname-utils to 0.0.93
|
|
60
|
+
- Updated react-graphql-tools to 1.23.15
|
|
61
|
+
- Updated shared-utils to 1.22.12
|
|
62
|
+
|
|
63
|
+
## 2.14.14 (2026-10-29)
|
|
64
|
+
|
|
65
|
+
### 🩹 Fixes
|
|
66
|
+
|
|
67
|
+
- **react-components,iris-app-playwright:** key migrations to the release that shipped the change ([#27004](https://github.com/Trackunit/manager/pull/27004))
|
|
68
|
+
|
|
69
|
+
### 🧱 Updated Dependencies
|
|
70
|
+
|
|
71
|
+
- Updated iris-app-build-utilities to 2.10.14
|
|
72
|
+
- Updated iris-app-api to 2.12.14
|
|
73
|
+
- Updated react-vite-test-setup to 0.0.184
|
|
74
|
+
- Updated css-classname-utils to 0.0.92
|
|
75
|
+
- Updated react-graphql-tools to 1.23.14
|
|
76
|
+
- Updated shared-utils to 1.22.11
|
|
77
|
+
|
|
78
|
+
### ❤️ Thank You
|
|
79
|
+
|
|
80
|
+
- Michael Buss Rønne @man-trackunit
|
|
81
|
+
|
|
1
82
|
## 2.14.13 (2026-10-28)
|
|
2
83
|
|
|
3
84
|
### 🩹 Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"generators": "./generators.json",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"node": ">=24.x"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@trackunit/css-classname-utils": "0.0.
|
|
13
|
+
"@trackunit/css-classname-utils": "0.0.95",
|
|
14
14
|
"@typescript-eslint/types": "8.71.2",
|
|
15
15
|
"@typescript-eslint/typescript-estree": "8.71.2",
|
|
16
16
|
"pacote": "^21.5.1",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@nx/react": "23.3.0",
|
|
27
27
|
"@npmcli/arborist": "^9.1.9",
|
|
28
28
|
"win-ca": "^3.5.1",
|
|
29
|
-
"@trackunit/iris-app-build-utilities": "
|
|
30
|
-
"@trackunit/react-graphql-tools": "1.23.
|
|
31
|
-
"@trackunit/shared-utils": "1.22.
|
|
32
|
-
"@trackunit/iris-app-api": "2.12.
|
|
29
|
+
"@trackunit/iris-app-build-utilities": "3.0.0",
|
|
30
|
+
"@trackunit/react-graphql-tools": "1.23.17",
|
|
31
|
+
"@trackunit/shared-utils": "1.22.14",
|
|
32
|
+
"@trackunit/iris-app-api": "2.12.17",
|
|
33
33
|
"tslib": "^2.6.2",
|
|
34
34
|
"@clack/prompts": "^1.8.1",
|
|
35
35
|
"@npm/types": "^1.0.2",
|
|
@@ -4,6 +4,7 @@ import { SubmitExecutorSchema } from "./schema";
|
|
|
4
4
|
*
|
|
5
5
|
* @param {SubmitExecutorSchema} options The options provided to the executor.
|
|
6
6
|
* @returns {Promise<{ success: boolean }>} The result of the submit.
|
|
7
|
+
* @throws {Error} When `@trackunit/*` dependencies are a major version behind or cannot be looked up; nothing is published.
|
|
7
8
|
*/
|
|
8
9
|
export default function runExecutor(options: SubmitExecutorSchema): Promise<{
|
|
9
10
|
success: boolean;
|
|
@@ -100,9 +100,10 @@ function isRetryableApproveError(statusCode, code, type) {
|
|
|
100
100
|
*
|
|
101
101
|
* @param {SubmitExecutorSchema} options The options provided to the executor.
|
|
102
102
|
* @returns {Promise<{ success: boolean }>} The result of the submit.
|
|
103
|
+
* @throws {Error} When `@trackunit/*` dependencies are a major version behind or cannot be looked up; nothing is published.
|
|
103
104
|
*/
|
|
104
105
|
async function runExecutor(options) {
|
|
105
|
-
await (0, iris_app_build_utilities_1.checkPackageVersion)(true);
|
|
106
|
+
await (0, iris_app_build_utilities_1.checkPackageVersion)({ report: true, block: true });
|
|
106
107
|
const settings = (0, irisAppServerSettings_1.getSettings)();
|
|
107
108
|
const linkToTerms = "https://trackunit.com/terms-conditions-marketplace/";
|
|
108
109
|
try {
|
|
@@ -6,6 +6,8 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const path = tslib_1.__importStar(require("path"));
|
|
8
8
|
const get_package_manifest_1 = require("../utils/get-package-manifest");
|
|
9
|
+
const uses_trackunit_eslint_plugin_1 = require("../utils/uses-trackunit-eslint-plugin");
|
|
10
|
+
const write_trackunit_project_eslint_config_1 = require("../utils/write-trackunit-project-eslint-config");
|
|
9
11
|
function normalizeOptions(tree, options) {
|
|
10
12
|
const name = (0, devkit_1.names)(options.name).fileName;
|
|
11
13
|
const projectDirectory = options.directory ? path.join(options.directory, name) : name;
|
|
@@ -25,7 +27,7 @@ function normalizeOptions(tree, options) {
|
|
|
25
27
|
npmScope,
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
|
-
function addFiles(tree, options, packageJson) {
|
|
30
|
+
function addFiles(tree, options, packageJson, useTrackunitLint) {
|
|
29
31
|
const nodeVersion = packageJson?.engines?.node ?? ">=20.x";
|
|
30
32
|
const templateOptions = {
|
|
31
33
|
...options,
|
|
@@ -35,6 +37,10 @@ function addFiles(tree, options, packageJson) {
|
|
|
35
37
|
nodeVersion,
|
|
36
38
|
};
|
|
37
39
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, "files"), options.projectRoot, templateOptions);
|
|
40
|
+
if (useTrackunitLint) {
|
|
41
|
+
// Must run after "files" so it replaces the default eslint.config.cjs.
|
|
42
|
+
(0, write_trackunit_project_eslint_config_1.writeTrackunitProjectEslintConfig)(tree, options.projectRoot, options.toNxRoot);
|
|
43
|
+
}
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Iris App Generator.
|
|
@@ -46,6 +52,7 @@ function addFiles(tree, options, packageJson) {
|
|
|
46
52
|
*/
|
|
47
53
|
const IrisAppGenerator = async function (tree, options) {
|
|
48
54
|
const normalizedOptions = normalizeOptions(tree, options);
|
|
55
|
+
const useTrackunitLint = (0, uses_trackunit_eslint_plugin_1.usesTrackunitEslintPlugin)(tree);
|
|
49
56
|
const packageJsonFromNpm = await (0, get_package_manifest_1.getPackageManifest)("@trackunit/iris-app");
|
|
50
57
|
const packageJsonLocally = (0, devkit_1.readJsonFile)(path.join(__dirname, "..", "..", "..", "package.json"));
|
|
51
58
|
if (options.updatePackageJson) {
|
|
@@ -109,6 +116,7 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
109
116
|
root: normalizedOptions.projectRoot,
|
|
110
117
|
projectType: "application",
|
|
111
118
|
sourceRoot: `${normalizedOptions.projectRoot}/src`,
|
|
119
|
+
...(useTrackunitLint ? { tags: ["type:app"] } : {}),
|
|
112
120
|
targets: {
|
|
113
121
|
build: {
|
|
114
122
|
executor: "@trackunit/iris-app-sdk-vite:build",
|
|
@@ -154,7 +162,7 @@ const IrisAppGenerator = async function (tree, options) {
|
|
|
154
162
|
},
|
|
155
163
|
},
|
|
156
164
|
});
|
|
157
|
-
addFiles(tree, normalizedOptions, packageJsonLocally);
|
|
165
|
+
addFiles(tree, normalizedOptions, packageJsonLocally, useTrackunitLint);
|
|
158
166
|
// enforcing engine versions specified in package.json
|
|
159
167
|
tree.write(".npmrc", "engine-strict=true\n");
|
|
160
168
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -17,7 +17,7 @@ const lifeCycle = singleSpaReact({
|
|
|
17
17
|
React,
|
|
18
18
|
ReactDOMClient,
|
|
19
19
|
rootComponent: RootComponent,
|
|
20
|
-
errorBoundary(
|
|
20
|
+
errorBoundary() {
|
|
21
21
|
return (
|
|
22
22
|
<div className="flex h-full items-center justify-center">An error occurred in the <%= projectName %> app!</div>
|
|
23
23
|
);
|
|
@@ -14,6 +14,8 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
14
14
|
const string_ts_1 = require("string-ts");
|
|
15
15
|
const ts_morph_1 = require("ts-morph");
|
|
16
16
|
const get_package_manifest_1 = require("../utils/get-package-manifest");
|
|
17
|
+
const uses_trackunit_eslint_plugin_1 = require("../utils/uses-trackunit-eslint-plugin");
|
|
18
|
+
const write_trackunit_project_eslint_config_1 = require("../utils/write-trackunit-project-eslint-config");
|
|
17
19
|
const dependencies_1 = require("./dependencies");
|
|
18
20
|
const addGraphqlDependency = (target) => {
|
|
19
21
|
if (!target) {
|
|
@@ -106,8 +108,12 @@ const IrisAppExtensionGenerator = async function (tree, options) {
|
|
|
106
108
|
if (!tree.exists(manifestPath)) {
|
|
107
109
|
throw new Error(`The app does not have an iris-app-manifest.ts: ${manifestPath} make sure you enter the right app name, which has an iris-app-manifest.ts`);
|
|
108
110
|
}
|
|
111
|
+
const useTrackunitLint = (0, uses_trackunit_eslint_plugin_1.usesTrackunitEslintPlugin)(tree);
|
|
109
112
|
if (normalizedOptions.updatePackageJson) {
|
|
110
|
-
|
|
113
|
+
const uiExtensionDependencies = iris_app_api_1.nonUiExtensionTypes.includes(irisAppExtensionType)
|
|
114
|
+
? {}
|
|
115
|
+
: { "@trackunit/iris-app-runtime-core": await getPackageVersion("@trackunit/iris-app-runtime-core") };
|
|
116
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, uiExtensionDependencies, {
|
|
111
117
|
...dependencies_1.spaDependencies,
|
|
112
118
|
...dependencies_1.testDependencies,
|
|
113
119
|
"@trackunit/react-vite-test-setup": await getPackageVersion("@trackunit/react-vite-test-setup"),
|
|
@@ -124,6 +130,7 @@ const IrisAppExtensionGenerator = async function (tree, options) {
|
|
|
124
130
|
directory: normalizedOptions.projectRoot,
|
|
125
131
|
skipTsConfig: false,
|
|
126
132
|
skipPackageJson: true,
|
|
133
|
+
...(useTrackunitLint ? { tags: "type:extension" } : {}),
|
|
127
134
|
};
|
|
128
135
|
await (0, react_1.libraryGenerator)(tree, schema);
|
|
129
136
|
tree.delete((0, devkit_1.joinPathFragments)(normalizedOptions.projectRoot, "vite.config.mts"));
|
|
@@ -137,6 +144,9 @@ const IrisAppExtensionGenerator = async function (tree, options) {
|
|
|
137
144
|
tree.write("vitest.empty-stub.ts", "export default {};\n");
|
|
138
145
|
}
|
|
139
146
|
}
|
|
147
|
+
if (useTrackunitLint) {
|
|
148
|
+
(0, write_trackunit_project_eslint_config_1.writeTrackunitProjectEslintConfig)(tree, normalizedOptions.projectRoot, templateOptions.offsetFromRoot);
|
|
149
|
+
}
|
|
140
150
|
tree.delete((0, devkit_1.joinPathFragments)(normalizedOptions.projectRoot, "jest.config.ts"));
|
|
141
151
|
tree.delete((0, devkit_1.joinPathFragments)(normalizedOptions.projectRoot, "jest.config.cts"));
|
|
142
152
|
tree.delete((0, devkit_1.joinPathFragments)(normalizedOptions.projectRoot, "test", "config", "jest.setup.tsx"));
|
|
@@ -8,6 +8,7 @@ const react_1 = require("@nx/react");
|
|
|
8
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
9
|
const get_package_manifest_1 = require("../utils/get-package-manifest");
|
|
10
10
|
const link_claude_skills_1 = require("../utils/link-claude-skills");
|
|
11
|
+
const uses_trackunit_eslint_plugin_1 = require("../utils/uses-trackunit-eslint-plugin");
|
|
11
12
|
/**
|
|
12
13
|
* Preset generator for Iris apps workspace.
|
|
13
14
|
* Use with create-nx-workspace to create a new workspace for developing Iris apps.
|
|
@@ -23,7 +24,7 @@ async function presetGenerator(tree, options) {
|
|
|
23
24
|
tree.write(extensionsPath, "{}");
|
|
24
25
|
}
|
|
25
26
|
(0, devkit_1.generateFiles)(tree, path_1.default.join(__dirname, "files"), ".", {});
|
|
26
|
-
(0, devkit_1.generateFiles)(tree, path_1.default.join(__dirname, "root-files"), ".", {});
|
|
27
|
+
(0, devkit_1.generateFiles)(tree, path_1.default.join(__dirname, "root-files"), ".", { template: "" });
|
|
27
28
|
if (!tree.exists("vitest.empty-stub.ts")) {
|
|
28
29
|
tree.write("vitest.empty-stub.ts", "export default {};\n");
|
|
29
30
|
}
|
|
@@ -32,7 +33,7 @@ async function presetGenerator(tree, options) {
|
|
|
32
33
|
value.recommendations = [];
|
|
33
34
|
}
|
|
34
35
|
value.recommendations = value.recommendations.filter((recommendation) => recommendation !== "firsttris.vscode-jest-runner");
|
|
35
|
-
value.recommendations.push("graphql.vscode-graphql", "graphql.vscode-graphql-syntax", "bradlc.vscode-tailwindcss", "vitest.explorer");
|
|
36
|
+
value.recommendations.push("graphql.vscode-graphql", "graphql.vscode-graphql-syntax", "bradlc.vscode-tailwindcss", "vitest.explorer", "dbaeumer.vscode-eslint");
|
|
36
37
|
return value;
|
|
37
38
|
});
|
|
38
39
|
const jsInitTask = await (0, js_1.initGenerator)(tree, {
|
|
@@ -50,17 +51,26 @@ async function presetGenerator(tree, options) {
|
|
|
50
51
|
tsconfig.compilerOptions.esModuleInterop = true;
|
|
51
52
|
tsconfig.compilerOptions.resolveJsonModule = true;
|
|
52
53
|
tsconfig.compilerOptions.moduleResolution = "bundler";
|
|
54
|
+
tsconfig.compilerOptions.strict = true;
|
|
53
55
|
return tsconfig;
|
|
54
56
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
const [migrationsManifest, eslintPluginTrackunitManifest] = await Promise.all([
|
|
58
|
+
(0, get_package_manifest_1.getPackageManifest)("@trackunit/migrations"),
|
|
59
|
+
(0, get_package_manifest_1.getPackageManifest)(uses_trackunit_eslint_plugin_1.TRACKUNIT_ESLINT_PLUGIN),
|
|
60
|
+
]);
|
|
58
61
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
59
62
|
react: "19.3.0",
|
|
60
63
|
"react-dom": "19.3.0",
|
|
61
64
|
}, {
|
|
62
|
-
|
|
65
|
+
// Ships the generator that upgrades every @trackunit/* dependency, so a new
|
|
66
|
+
// workspace can run the documented upgrade flow without installing it first.
|
|
67
|
+
"@trackunit/migrations": migrationsManifest.version,
|
|
68
|
+
[uses_trackunit_eslint_plugin_1.TRACKUNIT_ESLINT_PLUGIN]: eslintPluginTrackunitManifest.version,
|
|
69
|
+
"@typescript-eslint/parser": "8.71.2",
|
|
70
|
+
eslint: "9.33.0",
|
|
71
|
+
"@nx/eslint": "23.3.0",
|
|
63
72
|
});
|
|
73
|
+
registerEslintPlugin(tree);
|
|
64
74
|
// This react generator adds react 19 and react-dom 19 to the package.json if we don't add react 18 above.
|
|
65
75
|
const initReact = await (0, react_1.reactInitGenerator)(tree, {});
|
|
66
76
|
// Post-flush task: symlink .claude/skills -> ../.agents/skills so Claude Code
|
|
@@ -82,4 +92,18 @@ function updateWorkspaceLayout(tree) {
|
|
|
82
92
|
};
|
|
83
93
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
84
94
|
}
|
|
95
|
+
// Nx's own ESLint init skips this setup once a root config exists, so the preset does it.
|
|
96
|
+
function registerEslintPlugin(tree) {
|
|
97
|
+
const nxJson = (0, devkit_1.readNxJson)(tree) ?? {};
|
|
98
|
+
const plugins = nxJson.plugins ?? [];
|
|
99
|
+
const isRegistered = plugins.some(plugin => (typeof plugin === "string" ? plugin : plugin.plugin) === "@nx/eslint/plugin");
|
|
100
|
+
if (!isRegistered) {
|
|
101
|
+
nxJson.plugins = [...plugins, { plugin: "@nx/eslint/plugin", options: { targetName: "lint" } }];
|
|
102
|
+
}
|
|
103
|
+
const production = nxJson.namedInputs?.production;
|
|
104
|
+
if (nxJson.namedInputs && production) {
|
|
105
|
+
nxJson.namedInputs.production = Array.from(new Set([...production, "!{projectRoot}/eslint.config.cjs"]));
|
|
106
|
+
}
|
|
107
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
108
|
+
}
|
|
85
109
|
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { defineConfig } = require('eslint/config');
|
|
2
|
+
const { configs } = require('@trackunit/eslint-plugin-trackunit');
|
|
3
|
+
|
|
4
|
+
module.exports = defineConfig([
|
|
5
|
+
{
|
|
6
|
+
ignores: ['**/dist', '**/out-tsc', '**/vitest.config.*.timestamp*'],
|
|
7
|
+
},
|
|
8
|
+
...configs.base,
|
|
9
|
+
...configs.react,
|
|
10
|
+
{
|
|
11
|
+
// playwright/tsconfig.json (from @trackunit/iris-app-playwright) includes these
|
|
12
|
+
// files; the project tsconfigs cover Playwright set up some other way.
|
|
13
|
+
files: ['**/playwright.config.ts', '**/playwright/**/*.ts'],
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parserOptions: {
|
|
16
|
+
project: ['./playwright/tsconfig*.json', './tsconfig.*?.json'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
export declare const TRACKUNIT_ESLINT_PLUGIN = "@trackunit/eslint-plugin-trackunit";
|
|
3
|
+
/**
|
|
4
|
+
* Returns true when the workspace root `package.json` declares
|
|
5
|
+
* `@trackunit/eslint-plugin-trackunit` in `dependencies` or `devDependencies`
|
|
6
|
+
* and the workspace has a root `eslint.config.cjs`.
|
|
7
|
+
*
|
|
8
|
+
* Generated project configs `require` the root `eslint.config.cjs`, so a workspace
|
|
9
|
+
* with the plugin but another root config (e.g. Nx's `eslint.config.mjs`) is
|
|
10
|
+
* treated as not using it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usesTrackunitEslintPlugin(tree: Tree): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TRACKUNIT_ESLINT_PLUGIN = void 0;
|
|
4
|
+
exports.usesTrackunitEslintPlugin = usesTrackunitEslintPlugin;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
exports.TRACKUNIT_ESLINT_PLUGIN = "@trackunit/eslint-plugin-trackunit";
|
|
7
|
+
/**
|
|
8
|
+
* Returns true when the workspace root `package.json` declares
|
|
9
|
+
* `@trackunit/eslint-plugin-trackunit` in `dependencies` or `devDependencies`
|
|
10
|
+
* and the workspace has a root `eslint.config.cjs`.
|
|
11
|
+
*
|
|
12
|
+
* Generated project configs `require` the root `eslint.config.cjs`, so a workspace
|
|
13
|
+
* with the plugin but another root config (e.g. Nx's `eslint.config.mjs`) is
|
|
14
|
+
* treated as not using it.
|
|
15
|
+
*/
|
|
16
|
+
function usesTrackunitEslintPlugin(tree) {
|
|
17
|
+
if (!tree.exists("package.json") || !tree.exists("eslint.config.cjs")) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, "package.json");
|
|
21
|
+
return (dependencies?.[exports.TRACKUNIT_ESLINT_PLUGIN] !== undefined || devDependencies?.[exports.TRACKUNIT_ESLINT_PLUGIN] !== undefined);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=uses-trackunit-eslint-plugin.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
/**
|
|
3
|
+
* Writes a project `eslint.config.cjs` that only extends the workspace root
|
|
4
|
+
* `eslint.config.cjs`, for workspaces where `usesTrackunitEslintPlugin` is true.
|
|
5
|
+
*
|
|
6
|
+
* @param tree the nx tree
|
|
7
|
+
* @param projectRoot the project directory, relative to the workspace root
|
|
8
|
+
* @param offsetFromRoot relative path from the project directory to the workspace root, ending in `/`
|
|
9
|
+
*/
|
|
10
|
+
export declare function writeTrackunitProjectEslintConfig(tree: Tree, projectRoot: string, offsetFromRoot: string): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeTrackunitProjectEslintConfig = writeTrackunitProjectEslintConfig;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* Writes a project `eslint.config.cjs` that only extends the workspace root
|
|
7
|
+
* `eslint.config.cjs`, for workspaces where `usesTrackunitEslintPlugin` is true.
|
|
8
|
+
*
|
|
9
|
+
* @param tree the nx tree
|
|
10
|
+
* @param projectRoot the project directory, relative to the workspace root
|
|
11
|
+
* @param offsetFromRoot relative path from the project directory to the workspace root, ending in `/`
|
|
12
|
+
*/
|
|
13
|
+
function writeTrackunitProjectEslintConfig(tree, projectRoot, offsetFromRoot) {
|
|
14
|
+
// ESLint prefers eslint.config.mjs over a sibling eslint.config.cjs.
|
|
15
|
+
tree.delete((0, devkit_1.joinPathFragments)(projectRoot, "eslint.config.mjs"));
|
|
16
|
+
tree.write((0, devkit_1.joinPathFragments)(projectRoot, "eslint.config.cjs"), `module.exports = [...require('${offsetFromRoot}eslint.config.cjs')];\n`);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=write-trackunit-project-eslint-config.js.map
|