@nx/remix 23.0.0-rc.4 → 23.1.0-beta.0
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/README.md +1 -2
- package/dist/src/generators/application/application.impl.js +1 -1
- package/dist/src/generators/init/init.js +2 -0
- package/dist/src/generators/library/library.impl.js +2 -0
- package/dist/src/generators/setup/setup.impl.js +2 -0
- package/dist/src/migrations/update-23-1-0/remove-remix-eslint-config.d.ts +11 -0
- package/dist/src/migrations/update-23-1-0/remove-remix-eslint-config.js +72 -0
- package/dist/src/utils/assert-and-pin-remix-typescript.d.ts +21 -0
- package/dist/src/utils/assert-and-pin-remix-typescript.js +36 -0
- package/dist/src/utils/versions.d.ts +1 -1
- package/dist/src/utils/versions.js +1 -1
- package/migrations.json +6 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
<div style="text-align: center;">
|
|
9
9
|
|
|
10
|
-
[](https://circleci.com/gh/nrwl/nx)
|
|
11
10
|
[]()
|
|
12
11
|
[](https://www.npmjs.com/package/nx)
|
|
13
12
|
[]()
|
|
14
13
|
[](http://commitizen.github.io/cz-cli/)
|
|
15
|
-
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
16
14
|
[](https://go.nx.dev/community)
|
|
15
|
+
[](https://nx.dev/docs/features/ci-features/sandboxing)
|
|
17
16
|
|
|
18
17
|
</div>
|
|
19
18
|
|
|
@@ -23,6 +23,7 @@ function remixApplicationGenerator(tree, options) {
|
|
|
23
23
|
async function remixApplicationGeneratorInternal(tree, _options) {
|
|
24
24
|
(0, versions_1.assertSupportedRemixVersion)(tree);
|
|
25
25
|
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(tree, _options.addPlugin, _options.useTsSolution);
|
|
26
|
+
// initGenerator enforces the TS pin and hard-errors on TS6.
|
|
26
27
|
const tasks = [
|
|
27
28
|
await (0, init_1.default)(tree, {
|
|
28
29
|
skipFormat: true,
|
|
@@ -68,7 +69,6 @@ async function remixApplicationGeneratorInternal(tree, _options) {
|
|
|
68
69
|
reactDomVersion: versions_1.reactDomVersion,
|
|
69
70
|
typesReactVersion: versions_1.typesReactVersion,
|
|
70
71
|
typesReactDomVersion: versions_1.typesReactDomVersion,
|
|
71
|
-
eslintVersion: versions_1.eslintVersion,
|
|
72
72
|
typescriptVersion: versions_1.typescriptVersion,
|
|
73
73
|
viteVersion: versions_1.viteVersion,
|
|
74
74
|
};
|
|
@@ -5,6 +5,7 @@ exports.remixInitGeneratorInternal = remixInitGeneratorInternal;
|
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
|
+
const assert_and_pin_remix_typescript_1 = require("../../utils/assert-and-pin-remix-typescript");
|
|
8
9
|
const versions_1 = require("../../utils/versions");
|
|
9
10
|
function remixInitGenerator(tree, options) {
|
|
10
11
|
return remixInitGeneratorInternal(tree, { addPlugin: false, ...options });
|
|
@@ -12,6 +13,7 @@ function remixInitGenerator(tree, options) {
|
|
|
12
13
|
async function remixInitGeneratorInternal(tree, options) {
|
|
13
14
|
(0, versions_1.assertSupportedRemixVersion)(tree);
|
|
14
15
|
const tasks = [];
|
|
16
|
+
tasks.push((0, assert_and_pin_remix_typescript_1.assertAndPinRemixTypescript)(tree));
|
|
15
17
|
if (!options.skipPackageJson) {
|
|
16
18
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
17
19
|
'@remix-run/serve': versions_1.remixVersion,
|
|
@@ -7,6 +7,7 @@ const js_1 = require("@nx/js");
|
|
|
7
7
|
const react_1 = require("@nx/react");
|
|
8
8
|
const lib_1 = require("./lib");
|
|
9
9
|
const internal_1 = require("@nx/js/internal");
|
|
10
|
+
const assert_and_pin_remix_typescript_1 = require("../../utils/assert-and-pin-remix-typescript");
|
|
10
11
|
const update_dependencies_1 = require("../utils/update-dependencies");
|
|
11
12
|
const versions_1 = require("../../utils/versions");
|
|
12
13
|
async function remixLibraryGenerator(tree, schema) {
|
|
@@ -19,6 +20,7 @@ async function remixLibraryGenerator(tree, schema) {
|
|
|
19
20
|
async function remixLibraryGeneratorInternal(tree, schema) {
|
|
20
21
|
(0, versions_1.assertSupportedRemixVersion)(tree);
|
|
21
22
|
const tasks = [];
|
|
23
|
+
tasks.push((0, assert_and_pin_remix_typescript_1.assertAndPinRemixTypescript)(tree));
|
|
22
24
|
const addTsPlugin = (0, internal_1.shouldConfigureTsSolutionSetup)(tree, schema.addPlugin);
|
|
23
25
|
const installTask = (0, update_dependencies_1.updateDependencies)(tree);
|
|
24
26
|
tasks.push(installTask);
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
|
+
const assert_and_pin_remix_typescript_1 = require("../../utils/assert-and-pin-remix-typescript");
|
|
6
7
|
const versions_1 = require("../../utils/versions");
|
|
7
8
|
async function default_1(tree) {
|
|
8
9
|
(0, versions_1.assertSupportedRemixVersion)(tree);
|
|
9
10
|
const tasks = [];
|
|
11
|
+
tasks.push((0, assert_and_pin_remix_typescript_1.assertAndPinRemixTypescript)(tree));
|
|
10
12
|
const jsInitTask = await (0, js_1.initGenerator)(tree, {
|
|
11
13
|
skipFormat: true,
|
|
12
14
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Removes the `@remix-run/eslint-config` dependency when no ESLint config
|
|
4
|
+
* references it. Earlier Nx versions force-added this Remix-native preset to
|
|
5
|
+
* generated workspaces (a behavior dropped in #26568), yet the generated lint
|
|
6
|
+
* setup uses `@nx/eslint` flat config and never extends it. The preset peers
|
|
7
|
+
* ESLint v8 only and has no v9-compatible release, so once ESLint v9 is the floor
|
|
8
|
+
* the leftover dependency breaks installs. Workspaces that genuinely extend the
|
|
9
|
+
* preset keep it.
|
|
10
|
+
*/
|
|
11
|
+
export default function update(tree: Tree): Promise<void>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const PACKAGE = '@remix-run/eslint-config';
|
|
6
|
+
// Basenames of ESLint config files, eslintrc and flat including the Nx base
|
|
7
|
+
// variants, mirroring @nx/eslint's canonical lists. A reference to
|
|
8
|
+
// @remix-run/eslint-config in any of these means the workspace uses the preset,
|
|
9
|
+
// so the dependency must be kept.
|
|
10
|
+
const ESLINT_CONFIG_FILES = new Set([
|
|
11
|
+
'.eslintrc',
|
|
12
|
+
'.eslintrc.js',
|
|
13
|
+
'.eslintrc.cjs',
|
|
14
|
+
'.eslintrc.yaml',
|
|
15
|
+
'.eslintrc.yml',
|
|
16
|
+
'.eslintrc.json',
|
|
17
|
+
'.eslintrc.base.json',
|
|
18
|
+
'eslint.config.js',
|
|
19
|
+
'eslint.config.cjs',
|
|
20
|
+
'eslint.config.mjs',
|
|
21
|
+
'eslint.config.ts',
|
|
22
|
+
'eslint.config.cts',
|
|
23
|
+
'eslint.config.mts',
|
|
24
|
+
'eslint.base.js',
|
|
25
|
+
'eslint.base.ts',
|
|
26
|
+
'eslint.base.config.js',
|
|
27
|
+
'eslint.base.config.cjs',
|
|
28
|
+
'eslint.base.config.mjs',
|
|
29
|
+
'eslint.base.config.ts',
|
|
30
|
+
'eslint.base.config.cts',
|
|
31
|
+
'eslint.base.config.mts',
|
|
32
|
+
]);
|
|
33
|
+
/**
|
|
34
|
+
* Removes the `@remix-run/eslint-config` dependency when no ESLint config
|
|
35
|
+
* references it. Earlier Nx versions force-added this Remix-native preset to
|
|
36
|
+
* generated workspaces (a behavior dropped in #26568), yet the generated lint
|
|
37
|
+
* setup uses `@nx/eslint` flat config and never extends it. The preset peers
|
|
38
|
+
* ESLint v8 only and has no v9-compatible release, so once ESLint v9 is the floor
|
|
39
|
+
* the leftover dependency breaks installs. Workspaces that genuinely extend the
|
|
40
|
+
* preset keep it.
|
|
41
|
+
*/
|
|
42
|
+
async function update(tree) {
|
|
43
|
+
if (!isDeclared(tree) || isReferencedByEslintConfig(tree)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
(0, devkit_1.removeDependenciesFromPackageJson)(tree, [PACKAGE], [PACKAGE]);
|
|
47
|
+
devkit_1.logger.info(`Removed the unused "${PACKAGE}" dependency, which only supports ESLint v8.`);
|
|
48
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
49
|
+
}
|
|
50
|
+
function isDeclared(tree) {
|
|
51
|
+
if (!tree.exists('package.json')) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
55
|
+
return !!dependencies?.[PACKAGE] || !!devDependencies?.[PACKAGE];
|
|
56
|
+
}
|
|
57
|
+
function isReferencedByEslintConfig(tree) {
|
|
58
|
+
let referenced = false;
|
|
59
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
60
|
+
if (referenced) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const basename = filePath.split('/').pop() ?? '';
|
|
64
|
+
if (!ESLINT_CONFIG_FILES.has(basename)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (tree.read(filePath, 'utf-8')?.includes(PACKAGE)) {
|
|
68
|
+
referenced = true;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return referenced;
|
|
72
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Remix has no TypeScript 6-capable release, so Remix generators must keep the
|
|
4
|
+
* workspace on TS 5.x. It keys off the DECLARED `typescript` version, consulting
|
|
5
|
+
* the installed version only when it satisfies that declared range, and:
|
|
6
|
+
* - throws a hard, actionable error when the workspace resolves to TS >= 6 (the
|
|
7
|
+
* declared floor is >= 6, or an open range like `>=5.9.0` is satisfied by an
|
|
8
|
+
* installed >= 6);
|
|
9
|
+
* - pins TS to Remix's own `~5.9.2` only when `typescript` is absent, never
|
|
10
|
+
* overwriting an existing (5.x) pin. A typescript present only transitively
|
|
11
|
+
* (hoisted, no direct declaration) is treated as absent and gets the pin.
|
|
12
|
+
*
|
|
13
|
+
* Dist-tags (`latest`/`next`) and unparseable ranges have no resolvable floor,
|
|
14
|
+
* so the throw is skipped for them, consistent with devkit's
|
|
15
|
+
* `assertSupportedPackageVersion`.
|
|
16
|
+
*
|
|
17
|
+
* Call before any dependency install in Remix generators that install deps;
|
|
18
|
+
* generators that delegate to the init generator (e.g. application) inherit
|
|
19
|
+
* the guard from it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assertAndPinRemixTypescript(tree: Tree): GeneratorCallback;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertAndPinRemixTypescript = assertAndPinRemixTypescript;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
|
+
const versions_1 = require("./versions");
|
|
7
|
+
/**
|
|
8
|
+
* Remix has no TypeScript 6-capable release, so Remix generators must keep the
|
|
9
|
+
* workspace on TS 5.x. It keys off the DECLARED `typescript` version, consulting
|
|
10
|
+
* the installed version only when it satisfies that declared range, and:
|
|
11
|
+
* - throws a hard, actionable error when the workspace resolves to TS >= 6 (the
|
|
12
|
+
* declared floor is >= 6, or an open range like `>=5.9.0` is satisfied by an
|
|
13
|
+
* installed >= 6);
|
|
14
|
+
* - pins TS to Remix's own `~5.9.2` only when `typescript` is absent, never
|
|
15
|
+
* overwriting an existing (5.x) pin. A typescript present only transitively
|
|
16
|
+
* (hoisted, no direct declaration) is treated as absent and gets the pin.
|
|
17
|
+
*
|
|
18
|
+
* Dist-tags (`latest`/`next`) and unparseable ranges have no resolvable floor,
|
|
19
|
+
* so the throw is skipped for them, consistent with devkit's
|
|
20
|
+
* `assertSupportedPackageVersion`.
|
|
21
|
+
*
|
|
22
|
+
* Call before any dependency install in Remix generators that install deps;
|
|
23
|
+
* generators that delegate to the init generator (e.g. application) inherit
|
|
24
|
+
* the guard from it.
|
|
25
|
+
*/
|
|
26
|
+
function assertAndPinRemixTypescript(tree) {
|
|
27
|
+
const declared = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'typescript');
|
|
28
|
+
const minimum = declared ? (0, internal_1.getRangeMinimum)(declared) : undefined;
|
|
29
|
+
if (minimum && (0, internal_1.isTypescriptVersionAtLeast)(tree, '6.0.0')) {
|
|
30
|
+
throw new Error(`Remix does not support TypeScript 6 (detected \`typescript@${declared}\`).\n\n` +
|
|
31
|
+
`Keep \`typescript\` on a 5.x version to continue using Remix, or migrate to ` +
|
|
32
|
+
`React Router v7 by generating an application with the @nx/react generator: ` +
|
|
33
|
+
`\`nx g @nx/react:application <name> --routing --useReactRouter\`.`);
|
|
34
|
+
}
|
|
35
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { typescript: versions_1.typescriptVersion }, undefined, true);
|
|
36
|
+
}
|
|
@@ -8,7 +8,7 @@ export declare const reactVersion = "^18.2.0";
|
|
|
8
8
|
export declare const reactDomVersion = "^18.2.0";
|
|
9
9
|
export declare const typesReactVersion = "^18.2.0";
|
|
10
10
|
export declare const typesReactDomVersion = "^18.2.0";
|
|
11
|
-
export declare const eslintVersion = "^8.
|
|
11
|
+
export declare const eslintVersion = "^9.8.0";
|
|
12
12
|
export declare const typescriptVersion = "~5.9.2";
|
|
13
13
|
export declare const postcssVersion = "^8.4.38";
|
|
14
14
|
export declare const autoprefixerVersion = "^10.4.19";
|
|
@@ -19,7 +19,7 @@ exports.reactVersion = '^18.2.0';
|
|
|
19
19
|
exports.reactDomVersion = '^18.2.0';
|
|
20
20
|
exports.typesReactVersion = '^18.2.0';
|
|
21
21
|
exports.typesReactDomVersion = '^18.2.0';
|
|
22
|
-
exports.eslintVersion = '^8.
|
|
22
|
+
exports.eslintVersion = '^9.8.0';
|
|
23
23
|
exports.typescriptVersion = '~5.9.2';
|
|
24
24
|
exports.postcssVersion = '^8.4.38';
|
|
25
25
|
exports.autoprefixerVersion = '^10.4.19';
|
package/migrations.json
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
"description": "Rename imports of `createNodesV2` from `@nx/remix/plugin` to the canonical `createNodes` export.",
|
|
6
6
|
"implementation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes",
|
|
7
7
|
"documentation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md"
|
|
8
|
+
},
|
|
9
|
+
"update-23-1-0-remove-remix-eslint-config": {
|
|
10
|
+
"version": "23.1.0-beta.0",
|
|
11
|
+
"description": "Remove the unused @remix-run/eslint-config dependency (ESLint v8 only) that earlier Nx versions added but never wired into the generated lint setup.",
|
|
12
|
+
"implementation": "./dist/src/migrations/update-23-1-0/remove-remix-eslint-config"
|
|
8
13
|
}
|
|
9
14
|
},
|
|
10
15
|
"packageJsonUpdates": {
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
},
|
|
34
39
|
"@remix-run/eslint-config": {
|
|
35
40
|
"version": "2.17.3",
|
|
36
|
-
"alwaysAddToPackageJson":
|
|
41
|
+
"alwaysAddToPackageJson": false
|
|
37
42
|
},
|
|
38
43
|
"@remix-run/server-runtime": {
|
|
39
44
|
"version": "2.17.3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/remix",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.1.0-beta.0",
|
|
4
4
|
"description": "The Remix plugin for Nx contains executors and generators for managing Remix applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Jest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, routes, loaders, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"tslib": "^2.3.0",
|
|
58
58
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
59
|
-
"@nx/
|
|
60
|
-
"@nx/
|
|
61
|
-
"@nx/react": "23.
|
|
62
|
-
"@nx/web": "23.
|
|
59
|
+
"@nx/devkit": "23.1.0-beta.0",
|
|
60
|
+
"@nx/js": "23.1.0-beta.0",
|
|
61
|
+
"@nx/react": "23.1.0-beta.0",
|
|
62
|
+
"@nx/web": "23.1.0-beta.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@nx/eslint": "23.
|
|
66
|
-
"nx": "23.
|
|
67
|
-
"@nx/vitest": "23.
|
|
65
|
+
"@nx/eslint": "23.1.0-beta.0",
|
|
66
|
+
"nx": "23.1.0-beta.0",
|
|
67
|
+
"@nx/vitest": "23.1.0-beta.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@remix-run/dev": "^2.0.0"
|