@nx/remix 23.3.0 → 24.0.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 +10 -7
- package/dist/generators.d.ts +1 -13
- package/dist/generators.js +3 -28
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +1 -2
- package/dist/plugins/component-testing/index.d.ts +1 -0
- package/dist/plugins/component-testing/index.js +1 -0
- package/dist/readme-template.md +10 -4
- package/dist/src/generators/convert-to-inferred/convert-to-inferred.js +2 -0
- package/dist/src/migrations/update-24-0-0/convert-to-inferred.d.ts +2 -0
- package/dist/src/migrations/update-24-0-0/convert-to-inferred.js +26 -0
- package/dist/src/migrations/update-24-0-0/migrate-to-react-router.md +50 -0
- package/dist/src/plugins/plugin.d.ts +5 -3
- package/dist/src/plugins/plugin.js +8 -7
- package/dist/src/utils/create-watch-paths.d.ts +1 -0
- package/dist/src/utils/create-watch-paths.js +1 -0
- package/dist/src/utils/deprecation.d.ts +2 -4
- package/dist/src/utils/deprecation.js +11 -13
- package/dist/src/utils/versions.d.ts +1 -19
- package/dist/src/utils/versions.js +1 -28
- package/generators.json +2 -79
- package/migrations.json +10 -0
- package/package.json +8 -19
- package/readme-template.md +10 -4
- package/dist/src/executors/build/build.impl.d.ts +0 -5
- package/dist/src/executors/build/build.impl.js +0 -121
- package/dist/src/executors/build/schema.d.ts +0 -8
- package/dist/src/executors/build/schema.json +0 -47
- package/dist/src/executors/serve/schema.d.ts +0 -9
- package/dist/src/executors/serve/schema.json +0 -43
- package/dist/src/executors/serve/serve.impl.d.ts +0 -6
- package/dist/src/executors/serve/serve.impl.js +0 -79
- package/dist/src/generators/action/action.impl.d.ts +0 -3
- package/dist/src/generators/action/action.impl.js +0 -37
- package/dist/src/generators/action/schema.d.ts +0 -3
- package/dist/src/generators/action/schema.json +0 -18
- package/dist/src/generators/application/application.impl.d.ts +0 -5
- package/dist/src/generators/application/application.impl.js +0 -239
- package/dist/src/generators/application/files/common/app/entry.client.tsx__tmpl__ +0 -18
- package/dist/src/generators/application/files/common/app/entry.server.tsx__tmpl__ +0 -139
- package/dist/src/generators/application/files/common/app/root.tsx__tmpl__ +0 -47
- package/dist/src/generators/application/files/common/app/routes/_index.tsx__tmpl__ +0 -9
- package/dist/src/generators/application/files/common/public/favicon.ico +0 -0
- package/dist/src/generators/application/files/common/tests/routes/_index.spec.tsx__tmpl__ +0 -17
- package/dist/src/generators/application/files/common/tsconfig.app.json__tmpl__ +0 -25
- package/dist/src/generators/application/files/common/tsconfig.json__tmpl__ +0 -27
- package/dist/src/generators/application/files/common/vite.config.mts__tmpl__ +0 -25
- package/dist/src/generators/application/files/non-root/.gitignore__tmpl__ +0 -4
- package/dist/src/generators/application/files/non-root/package.json__tmpl__ +0 -20
- package/dist/src/generators/application/files/nx-welcome/claimed/app/nx-welcome.tsx__tmpl__ +0 -868
- package/dist/src/generators/application/files/nx-welcome/not-configured/app/nx-welcome.tsx__tmpl__ +0 -868
- package/dist/src/generators/application/files/nx-welcome/unclaimed/app/nx-welcome.tsx__tmpl__ +0 -866
- package/dist/src/generators/application/files/ts-solution/package.json__tmpl__ +0 -20
- package/dist/src/generators/application/files/ts-solution/tsconfig.app.json__tmpl__ +0 -41
- package/dist/src/generators/application/files/ts-solution/tsconfig.json__tmpl__ +0 -10
- package/dist/src/generators/application/lib/add-e2e.d.ts +0 -3
- package/dist/src/generators/application/lib/add-e2e.js +0 -117
- package/dist/src/generators/application/lib/ignore-vite-temp-files.d.ts +0 -2
- package/dist/src/generators/application/lib/ignore-vite-temp-files.js +0 -50
- package/dist/src/generators/application/lib/index.d.ts +0 -4
- package/dist/src/generators/application/lib/index.js +0 -7
- package/dist/src/generators/application/lib/normalize-options.d.ts +0 -12
- package/dist/src/generators/application/lib/normalize-options.js +0 -40
- package/dist/src/generators/application/lib/update-unit-test-config.d.ts +0 -2
- package/dist/src/generators/application/lib/update-unit-test-config.js +0 -57
- package/dist/src/generators/application/schema.d.ts +0 -18
- package/dist/src/generators/application/schema.json +0 -70
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.impl.d.ts +0 -5
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.impl.js +0 -35
- package/dist/src/generators/cypress-component-configuration/files/cypress.config.ts__tmpl__ +0 -6
- package/dist/src/generators/cypress-component-configuration/schema.d.ts +0 -6
- package/dist/src/generators/cypress-component-configuration/schema.json +0 -41
- package/dist/src/generators/error-boundary/error-boundary.impl.d.ts +0 -3
- package/dist/src/generators/error-boundary/error-boundary.impl.js +0 -14
- package/dist/src/generators/error-boundary/lib/add-v2-error-boundary.d.ts +0 -3
- package/dist/src/generators/error-boundary/lib/add-v2-error-boundary.js +0 -37
- package/dist/src/generators/error-boundary/lib/index.d.ts +0 -2
- package/dist/src/generators/error-boundary/lib/index.js +0 -5
- package/dist/src/generators/error-boundary/lib/normalize-options.d.ts +0 -3
- package/dist/src/generators/error-boundary/lib/normalize-options.js +0 -13
- package/dist/src/generators/error-boundary/schema.d.ts +0 -4
- package/dist/src/generators/error-boundary/schema.json +0 -26
- package/dist/src/generators/init/init.d.ts +0 -5
- package/dist/src/generators/init/init.js +0 -67
- package/dist/src/generators/init/schema.d.ts +0 -7
- package/dist/src/generators/init/schema.json +0 -33
- package/dist/src/generators/library/lib/add-tsconfig-entry-points.d.ts +0 -3
- package/dist/src/generators/library/lib/add-tsconfig-entry-points.js +0 -20
- package/dist/src/generators/library/lib/add-unit-testing.d.ts +0 -3
- package/dist/src/generators/library/lib/add-unit-testing.js +0 -31
- package/dist/src/generators/library/lib/index.d.ts +0 -4
- package/dist/src/generators/library/lib/index.js +0 -7
- package/dist/src/generators/library/lib/normalize-options.d.ts +0 -8
- package/dist/src/generators/library/lib/normalize-options.js +0 -31
- package/dist/src/generators/library/lib/update-buildable-config.d.ts +0 -3
- package/dist/src/generators/library/lib/update-buildable-config.js +0 -23
- package/dist/src/generators/library/library.impl.d.ts +0 -6
- package/dist/src/generators/library/library.impl.js +0 -78
- package/dist/src/generators/library/schema.d.ts +0 -19
- package/dist/src/generators/library/schema.json +0 -89
- package/dist/src/generators/loader/loader.impl.d.ts +0 -3
- package/dist/src/generators/loader/loader.impl.js +0 -37
- package/dist/src/generators/loader/schema.d.ts +0 -3
- package/dist/src/generators/loader/schema.json +0 -18
- package/dist/src/generators/meta/lib/v2.impl.d.ts +0 -3
- package/dist/src/generators/meta/lib/v2.impl.js +0 -24
- package/dist/src/generators/meta/meta.impl.d.ts +0 -3
- package/dist/src/generators/meta/meta.impl.js +0 -9
- package/dist/src/generators/meta/schema.d.ts +0 -3
- package/dist/src/generators/meta/schema.json +0 -18
- package/dist/src/generators/preset/lib/normalize-options.d.ts +0 -10
- package/dist/src/generators/preset/lib/normalize-options.js +0 -19
- package/dist/src/generators/preset/preset.impl.d.ts +0 -3
- package/dist/src/generators/preset/preset.impl.js +0 -34
- package/dist/src/generators/preset/schema.d.ts +0 -4
- package/dist/src/generators/preset/schema.json +0 -14
- package/dist/src/generators/resource-route/resource-route.impl.d.ts +0 -3
- package/dist/src/generators/resource-route/resource-route.impl.js +0 -37
- package/dist/src/generators/resource-route/schema.d.ts +0 -6
- package/dist/src/generators/resource-route/schema.json +0 -44
- package/dist/src/generators/route/route.impl.d.ts +0 -3
- package/dist/src/generators/route/route.impl.js +0 -62
- package/dist/src/generators/route/schema.d.ts +0 -8
- package/dist/src/generators/route/schema.json +0 -55
- package/dist/src/generators/setup/schema.json +0 -14
- package/dist/src/generators/setup/setup.impl.d.ts +0 -2
- package/dist/src/generators/setup/setup.impl.js +0 -38
- package/dist/src/generators/storybook-configuration/files/vite.config.mts__tpl__ +0 -15
- package/dist/src/generators/storybook-configuration/schema.d.ts +0 -14
- package/dist/src/generators/storybook-configuration/schema.json +0 -78
- package/dist/src/generators/storybook-configuration/storybook-configuration.impl.d.ts +0 -4
- package/dist/src/generators/storybook-configuration/storybook-configuration.impl.js +0 -33
- package/dist/src/generators/style/schema.d.ts +0 -3
- package/dist/src/generators/style/schema.json +0 -25
- package/dist/src/generators/style/style.impl.d.ts +0 -3
- package/dist/src/generators/style/style.impl.js +0 -55
- package/dist/src/generators/utils/update-dependencies.d.ts +0 -2
- package/dist/src/generators/utils/update-dependencies.js +0 -32
- package/dist/src/utils/assert-and-pin-remix-typescript.d.ts +0 -21
- package/dist/src/utils/assert-and-pin-remix-typescript.js +0 -36
- package/dist/src/utils/get-default-export-name.d.ts +0 -2
- package/dist/src/utils/get-default-export-name.js +0 -7
- package/dist/src/utils/get-default-export.d.ts +0 -2
- package/dist/src/utils/get-default-export.js +0 -14
- package/dist/src/utils/insert-import.d.ts +0 -4
- package/dist/src/utils/insert-import.js +0 -53
- package/dist/src/utils/insert-statement-after-imports.d.ts +0 -5
- package/dist/src/utils/insert-statement-after-imports.js +0 -27
- package/dist/src/utils/insert-statement-in-default-function.d.ts +0 -2
- package/dist/src/utils/insert-statement-in-default-function.js +0 -22
- package/dist/src/utils/remix-config.d.ts +0 -6
- package/dist/src/utils/remix-config.js +0 -75
- package/dist/src/utils/remix-route-utils.d.ts +0 -4
- package/dist/src/utils/remix-route-utils.js +0 -26
- package/dist/src/utils/testing-config-utils.d.ts +0 -5
- package/dist/src/utils/testing-config-utils.js +0 -83
- package/executors.json +0 -14
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"private": true,
|
|
3
|
-
"name": "<%= importPath %>",
|
|
4
|
-
"scripts": {},
|
|
5
|
-
"type": "module",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@remix-run/node": "<%= remixVersion %>",
|
|
8
|
-
"@remix-run/react": "<%= remixVersion %>",
|
|
9
|
-
"@remix-run/serve": "<%= remixVersion %>",
|
|
10
|
-
"isbot": "<%= isbotVersion %>",
|
|
11
|
-
"react": "<%= reactVersion %>",
|
|
12
|
-
"react-dom": "<%= reactDomVersion %>"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@remix-run/dev": "<%= remixVersion %>",
|
|
16
|
-
"@types/react": "<%= typesReactVersion %>",
|
|
17
|
-
"@types/react-dom": "<%= typesReactDomVersion %>"
|
|
18
|
-
},
|
|
19
|
-
"sideEffects": false
|
|
20
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "dist",
|
|
5
|
-
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
|
6
|
-
"types": ["@remix-run/node", "vite/client"],
|
|
7
|
-
"isolatedModules": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"jsx": "react-jsx",
|
|
10
|
-
"module": "ESNext",
|
|
11
|
-
"moduleResolution": "Bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"target": "ES2022",
|
|
14
|
-
"strict": true,
|
|
15
|
-
"allowJs": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"forceConsistentCasingInFileNames": true
|
|
18
|
-
},
|
|
19
|
-
"include": [
|
|
20
|
-
"app/**/*.ts",
|
|
21
|
-
"app/**/*.tsx",
|
|
22
|
-
"app/**/*.js",
|
|
23
|
-
"app/**/*.jsx",
|
|
24
|
-
"**/.server/**/*.ts",
|
|
25
|
-
"**/.server/**/*.tsx",
|
|
26
|
-
"**/.client/**/*.ts",
|
|
27
|
-
"**/.client/**/*.tsx"
|
|
28
|
-
],
|
|
29
|
-
"exclude": [
|
|
30
|
-
"jest.config.ts",
|
|
31
|
-
"jest.config.cts",
|
|
32
|
-
"tests/**/*.spec.ts",
|
|
33
|
-
"tests/**/*.test.ts",
|
|
34
|
-
"tests/**/*.spec.tsx",
|
|
35
|
-
"tests/**/*.test.tsx",
|
|
36
|
-
"tests/**/*.spec.js",
|
|
37
|
-
"tests/**/*.test.js",
|
|
38
|
-
"tests/**/*.spec.jsx",
|
|
39
|
-
"tests/**/*.test.jsx"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addE2E = addE2E;
|
|
4
|
-
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const versions_1 = require("../../../utils/versions");
|
|
7
|
-
async function addE2E(tree, options) {
|
|
8
|
-
const hasRemixPlugin = (0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
|
9
|
-
? p === '@nx/remix/plugin'
|
|
10
|
-
: p.plugin === '@nx/remix/plugin');
|
|
11
|
-
let e2eWebsServerInfo = await getRemixE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.projectRoot, 'remix.config.js'), options.addPlugin ?? Boolean(hasRemixPlugin));
|
|
12
|
-
if (options.e2eTestRunner === 'cypress') {
|
|
13
|
-
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
14
|
-
const packageJson = {
|
|
15
|
-
name: options.e2eProjectName,
|
|
16
|
-
version: '0.0.1',
|
|
17
|
-
private: true,
|
|
18
|
-
};
|
|
19
|
-
if (!options.useProjectJson) {
|
|
20
|
-
packageJson.nx = {
|
|
21
|
-
implicitDependencies: [options.projectName],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
26
|
-
projectType: 'application',
|
|
27
|
-
root: options.e2eProjectRoot,
|
|
28
|
-
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
29
|
-
targets: {},
|
|
30
|
-
tags: [],
|
|
31
|
-
implicitDependencies: [options.projectName],
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
35
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
36
|
-
}
|
|
37
|
-
const e2eTask = await configurationGenerator(tree, {
|
|
38
|
-
project: options.e2eProjectName,
|
|
39
|
-
directory: 'src',
|
|
40
|
-
skipFormat: true,
|
|
41
|
-
devServerTarget: e2eWebsServerInfo.e2eDevServerTarget,
|
|
42
|
-
baseUrl: e2eWebsServerInfo.e2eWebServerAddress,
|
|
43
|
-
webServerCommands: {
|
|
44
|
-
default: e2eWebsServerInfo.e2eWebServerCommand,
|
|
45
|
-
production: e2eWebsServerInfo.e2eCiWebServerCommand,
|
|
46
|
-
},
|
|
47
|
-
ciWebServerCommand: e2eWebsServerInfo.e2eCiWebServerCommand,
|
|
48
|
-
ciBaseUrl: e2eWebsServerInfo.e2eCiBaseUrl,
|
|
49
|
-
addPlugin: options.addPlugin,
|
|
50
|
-
});
|
|
51
|
-
return e2eTask;
|
|
52
|
-
}
|
|
53
|
-
else if (options.e2eTestRunner === 'playwright') {
|
|
54
|
-
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
55
|
-
const packageJson = {
|
|
56
|
-
name: options.e2eProjectName,
|
|
57
|
-
version: '0.0.1',
|
|
58
|
-
private: true,
|
|
59
|
-
};
|
|
60
|
-
if (!options.useProjectJson) {
|
|
61
|
-
packageJson.nx = {
|
|
62
|
-
implicitDependencies: [options.projectName],
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
67
|
-
projectType: 'application',
|
|
68
|
-
root: options.e2eProjectRoot,
|
|
69
|
-
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
70
|
-
targets: {},
|
|
71
|
-
tags: [],
|
|
72
|
-
implicitDependencies: [options.projectName],
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
76
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
77
|
-
}
|
|
78
|
-
const e2eTask = await configurationGenerator(tree, {
|
|
79
|
-
project: options.e2eProjectName,
|
|
80
|
-
skipFormat: true,
|
|
81
|
-
skipPackageJson: false,
|
|
82
|
-
directory: 'src',
|
|
83
|
-
js: false,
|
|
84
|
-
linter: options.linter,
|
|
85
|
-
enableTypedLinting: false,
|
|
86
|
-
webServerCommand: e2eWebsServerInfo.e2eCiWebServerCommand,
|
|
87
|
-
webServerAddress: e2eWebsServerInfo.e2eCiBaseUrl,
|
|
88
|
-
rootProject: options.rootProject,
|
|
89
|
-
addPlugin: options.addPlugin,
|
|
90
|
-
});
|
|
91
|
-
return e2eTask;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
return () => { };
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
async function getRemixE2EWebServerInfo(tree, projectName, configFilePath, isPluginBeingAdded) {
|
|
98
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
99
|
-
let e2ePort = isPluginBeingAdded ? 3000 : 4200;
|
|
100
|
-
const defaultServeTarget = isPluginBeingAdded ? 'dev' : 'serve';
|
|
101
|
-
const serveTargetOptions = (0, internal_1.readTargetDefaultsForTarget)(defaultServeTarget, nxJson.targetDefaults)?.options;
|
|
102
|
-
if (serveTargetOptions?.port) {
|
|
103
|
-
e2ePort = serveTargetOptions.port;
|
|
104
|
-
}
|
|
105
|
-
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
106
|
-
plugin: '@nx/remix/plugin',
|
|
107
|
-
serveTargetName: 'serveTargetName',
|
|
108
|
-
serveStaticTargetName: 'serveStaticTargetName',
|
|
109
|
-
configFilePath,
|
|
110
|
-
}, {
|
|
111
|
-
defaultServeTargetName: defaultServeTarget,
|
|
112
|
-
defaultServeStaticTargetName: 'serve-static',
|
|
113
|
-
defaultE2EWebServerAddress: `http://localhost:${e2ePort}`,
|
|
114
|
-
defaultE2ECiBaseUrl: 'http://localhost:3000',
|
|
115
|
-
defaultE2EPort: e2ePort,
|
|
116
|
-
}, isPluginBeingAdded);
|
|
117
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ignoreViteTempFiles = ignoreViteTempFiles;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const internal_1 = require("@nx/js/internal");
|
|
6
|
-
const versions_1 = require("../../../utils/versions");
|
|
7
|
-
async function ignoreViteTempFiles(tree, projectRoot) {
|
|
8
|
-
addViteTempFilesToGitIgnore(tree);
|
|
9
|
-
await ignoreViteTempFilesInEslintConfig(tree, projectRoot);
|
|
10
|
-
}
|
|
11
|
-
function addViteTempFilesToGitIgnore(tree) {
|
|
12
|
-
let gitIgnoreContents = tree.exists('.gitignore')
|
|
13
|
-
? tree.read('.gitignore', 'utf-8')
|
|
14
|
-
: '';
|
|
15
|
-
if (!/^vite\.config\.\*\.timestamp\*$/m.test(gitIgnoreContents)) {
|
|
16
|
-
gitIgnoreContents = (0, devkit_1.stripIndents) `${gitIgnoreContents}
|
|
17
|
-
vite.config.*.timestamp*`;
|
|
18
|
-
}
|
|
19
|
-
if (!/^vitest\.config\.\*\.timestamp\*$/m.test(gitIgnoreContents)) {
|
|
20
|
-
gitIgnoreContents = (0, devkit_1.stripIndents) `${gitIgnoreContents}
|
|
21
|
-
vitest.config.*.timestamp*`;
|
|
22
|
-
}
|
|
23
|
-
tree.write('.gitignore', gitIgnoreContents);
|
|
24
|
-
}
|
|
25
|
-
async function ignoreViteTempFilesInEslintConfig(tree, projectRoot) {
|
|
26
|
-
// Checked before `ensurePackage` so an Oxlint workspace does not install
|
|
27
|
-
// `@nx/eslint` only for `isEslintConfigSupported` to send it straight back.
|
|
28
|
-
if (!(0, internal_1.detectLinters)(tree).includes('eslint')) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
(0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
|
|
32
|
-
const { addIgnoresToLintConfig, isEslintConfigSupported, } = require('@nx/eslint/internal');
|
|
33
|
-
if (!isEslintConfigSupported(tree)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const { useFlatConfig, } = require('@nx/eslint/internal');
|
|
37
|
-
const isUsingFlatConfig = useFlatConfig(tree);
|
|
38
|
-
if (!projectRoot && !isUsingFlatConfig) {
|
|
39
|
-
// root eslintrc files ignore all files and the root eslintrc files add
|
|
40
|
-
// back all the project files, so we only add the ignores to the project
|
|
41
|
-
// eslintrc files
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// for flat config, we update the root config file
|
|
45
|
-
const directory = isUsingFlatConfig ? '' : (projectRoot ?? '');
|
|
46
|
-
addIgnoresToLintConfig(tree, directory, [
|
|
47
|
-
'**/vite.config.*.timestamp*',
|
|
48
|
-
'**/vitest.config.*.timestamp*',
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./update-unit-test-config"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./add-e2e"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./ignore-vite-temp-files"), exports);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Tree } from '@nx/devkit';
|
|
2
|
-
import { type NxRemixGeneratorSchema } from '../schema';
|
|
3
|
-
export interface NormalizedSchema extends NxRemixGeneratorSchema {
|
|
4
|
-
projectName: string;
|
|
5
|
-
projectRoot: string;
|
|
6
|
-
importPath: string;
|
|
7
|
-
e2eProjectName: string;
|
|
8
|
-
e2eProjectRoot: string;
|
|
9
|
-
parsedTags: string[];
|
|
10
|
-
isUsingTsSolutionConfig: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function normalizeOptions(tree: Tree, options: NxRemixGeneratorSchema): Promise<NormalizedSchema>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const internal_2 = require("@nx/js/internal");
|
|
7
|
-
async function normalizeOptions(tree, options) {
|
|
8
|
-
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
|
-
const { projectName, projectRoot, importPath } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
10
|
-
name: options.name,
|
|
11
|
-
projectType: 'application',
|
|
12
|
-
directory: options.directory,
|
|
13
|
-
rootProject: options.rootProject,
|
|
14
|
-
});
|
|
15
|
-
options.rootProject = projectRoot === '.';
|
|
16
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
17
|
-
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
18
|
-
nxJson.useInferencePlugins !== false;
|
|
19
|
-
options.addPlugin ??= addPluginDefault;
|
|
20
|
-
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(tree);
|
|
21
|
-
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
|
22
|
-
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
23
|
-
const e2eProjectRoot = options.rootProject ? 'e2e' : `${projectRoot}-e2e`;
|
|
24
|
-
const parsedTags = options.tags
|
|
25
|
-
? options.tags.split(',').map((s) => s.trim())
|
|
26
|
-
: [];
|
|
27
|
-
return {
|
|
28
|
-
...options,
|
|
29
|
-
linter: await (0, internal_2.normalizeLinterOption)(tree, options.linter),
|
|
30
|
-
projectName: appProjectName,
|
|
31
|
-
projectRoot,
|
|
32
|
-
importPath,
|
|
33
|
-
e2eProjectName,
|
|
34
|
-
e2eProjectRoot,
|
|
35
|
-
parsedTags,
|
|
36
|
-
useTsSolution: isUsingTsSolutionConfig,
|
|
37
|
-
isUsingTsSolutionConfig,
|
|
38
|
-
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateUnitTestConfig = updateUnitTestConfig;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const testing_config_utils_1 = require("../../../utils/testing-config-utils");
|
|
6
|
-
const versions_1 = require("../../../utils/versions");
|
|
7
|
-
function updateUnitTestConfig(tree, pathToRoot, unitTestRunner, rootProject) {
|
|
8
|
-
const pathToTestSetup = (0, devkit_1.joinPathFragments)(pathToRoot, `test-setup.ts`);
|
|
9
|
-
tree.write(pathToTestSetup, (0, devkit_1.stripIndents) `
|
|
10
|
-
import { installGlobals } from '@remix-run/node';
|
|
11
|
-
import '@testing-library/jest-dom/matchers';
|
|
12
|
-
installGlobals();`);
|
|
13
|
-
if (unitTestRunner === 'vitest') {
|
|
14
|
-
const pathToViteConfig = (0, devkit_1.joinPathFragments)(pathToRoot, 'vitest.config.mts');
|
|
15
|
-
(0, testing_config_utils_1.updateVitestTestIncludes)(tree, pathToViteConfig, './app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}');
|
|
16
|
-
(0, testing_config_utils_1.updateVitestTestIncludes)(tree, pathToViteConfig, './tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}');
|
|
17
|
-
(0, testing_config_utils_1.updateVitestTestSetup)(tree, pathToViteConfig, 'test-setup.ts');
|
|
18
|
-
}
|
|
19
|
-
else if (unitTestRunner === 'jest' && rootProject) {
|
|
20
|
-
const pathToJestConfig = (0, devkit_1.joinPathFragments)(pathToRoot, 'jest.config.cts');
|
|
21
|
-
tree.write('jest.preset.cjs', tree.read('jest.preset.js', 'utf-8'));
|
|
22
|
-
(0, testing_config_utils_1.updateJestTestSetup)(tree, pathToJestConfig, `<rootDir>/test-setup.ts`);
|
|
23
|
-
tree.write(pathToJestConfig, tree
|
|
24
|
-
.read(pathToJestConfig, 'utf-8')
|
|
25
|
-
.replace('jest.preset.js', 'jest.preset.cjs'));
|
|
26
|
-
}
|
|
27
|
-
const pathToTsConfigSpec = (0, devkit_1.joinPathFragments)(pathToRoot, `tsconfig.spec.json`);
|
|
28
|
-
(0, devkit_1.updateJson)(tree, pathToTsConfigSpec, (json) => {
|
|
29
|
-
json.include = [
|
|
30
|
-
'vite.config.ts',
|
|
31
|
-
'vite.config.mts',
|
|
32
|
-
'vitest.config.ts',
|
|
33
|
-
'vitest.config.mts',
|
|
34
|
-
'app/**/*.ts',
|
|
35
|
-
'app/**/*.tsx',
|
|
36
|
-
'app/**/*.js',
|
|
37
|
-
'app/**/*.jsx',
|
|
38
|
-
'tests/**/*.spec.ts',
|
|
39
|
-
'tests/**/*.test.ts',
|
|
40
|
-
'tests/**/*.spec.tsx',
|
|
41
|
-
'tests/**/*.test.tsx',
|
|
42
|
-
'tests/**/*.spec.js',
|
|
43
|
-
'tests/**/*.test.js',
|
|
44
|
-
'tests/**/*.spec.jsx',
|
|
45
|
-
'tests/**/*.test.jsx',
|
|
46
|
-
];
|
|
47
|
-
return json;
|
|
48
|
-
});
|
|
49
|
-
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
50
|
-
'@testing-library/jest-dom': versions_1.testingLibraryJestDomVersion,
|
|
51
|
-
'@testing-library/dom': versions_1.testingLibraryDomVersion,
|
|
52
|
-
'@testing-library/react': versions_1.testingLibraryReactVersion,
|
|
53
|
-
'@testing-library/user-event': versions_1.testingLibraryUserEventsVersion,
|
|
54
|
-
'@remix-run/node': (0, versions_1.getRemixVersion)(tree),
|
|
55
|
-
'@remix-run/testing': (0, versions_1.getRemixVersion)(tree),
|
|
56
|
-
}, undefined, true);
|
|
57
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { LinterType } from '@nx/js';
|
|
2
|
-
|
|
3
|
-
export interface NxRemixGeneratorSchema {
|
|
4
|
-
directory: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
tags?: string;
|
|
7
|
-
linter?: LinterType;
|
|
8
|
-
unitTestRunner?: 'vitest' | 'jest' | 'none';
|
|
9
|
-
e2eTestRunner?: 'cypress' | 'playwright' | 'none';
|
|
10
|
-
skipFormat?: boolean;
|
|
11
|
-
// Internal options
|
|
12
|
-
rootProject?: boolean;
|
|
13
|
-
addPlugin?: boolean;
|
|
14
|
-
nxCloudToken?: string;
|
|
15
|
-
useTsSolution?: boolean;
|
|
16
|
-
formatter?: 'prettier' | 'oxfmt' | 'none';
|
|
17
|
-
useProjectJson?: boolean;
|
|
18
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "NxRemixApplication",
|
|
4
|
-
"title": "Create an Application",
|
|
5
|
-
"description": "Generate a new Remix application.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"directory": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "A directory where the app is placed.",
|
|
11
|
-
"alias": "dir",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "Which directory do you want to create the application in?"
|
|
17
|
-
},
|
|
18
|
-
"name": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The name of the application.",
|
|
21
|
-
"x-priority": "important"
|
|
22
|
-
},
|
|
23
|
-
"linter": {
|
|
24
|
-
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
25
|
-
"type": "string",
|
|
26
|
-
"enum": ["eslint", "oxlint", "none"],
|
|
27
|
-
"x-priority": "important"
|
|
28
|
-
},
|
|
29
|
-
"formatter": {
|
|
30
|
-
"description": "The tool to use for code formatting.",
|
|
31
|
-
"type": "string",
|
|
32
|
-
"enum": ["none", "prettier", "oxfmt"]
|
|
33
|
-
},
|
|
34
|
-
"unitTestRunner": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"enum": ["vitest", "jest", "none"],
|
|
37
|
-
"default": "none",
|
|
38
|
-
"description": "Test runner to use for unit tests.",
|
|
39
|
-
"x-prompt": "What unit test runner should be used?",
|
|
40
|
-
"x-priority": "important"
|
|
41
|
-
},
|
|
42
|
-
"e2eTestRunner": {
|
|
43
|
-
"type": "string",
|
|
44
|
-
"enum": ["playwright", "cypress", "none"],
|
|
45
|
-
"default": "none",
|
|
46
|
-
"description": "Test runner to use for e2e tests",
|
|
47
|
-
"x-prompt": "Which E2E test runner would you like to use?"
|
|
48
|
-
},
|
|
49
|
-
"tags": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"description": "Add tags to the project (used for linting)",
|
|
52
|
-
"alias": "t"
|
|
53
|
-
},
|
|
54
|
-
"skipFormat": {
|
|
55
|
-
"type": "boolean",
|
|
56
|
-
"description": "Skip formatting files",
|
|
57
|
-
"default": false
|
|
58
|
-
},
|
|
59
|
-
"rootProject": {
|
|
60
|
-
"type": "boolean",
|
|
61
|
-
"x-priority": "internal",
|
|
62
|
-
"default": false
|
|
63
|
-
},
|
|
64
|
-
"useProjectJson": {
|
|
65
|
-
"type": "boolean",
|
|
66
|
-
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
"required": ["directory"]
|
|
70
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type Tree } from '@nx/devkit';
|
|
2
|
-
import { type CypressComponentConfigurationSchema } from './schema';
|
|
3
|
-
export declare function cypressComponentConfigurationGenerator(tree: Tree, options: CypressComponentConfigurationSchema): Promise<void>;
|
|
4
|
-
export declare function cypressComponentConfigurationGeneratorInternal(tree: Tree, options: CypressComponentConfigurationSchema): Promise<void>;
|
|
5
|
-
export default cypressComponentConfigurationGenerator;
|
package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.impl.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cypressComponentConfigurationGenerator = cypressComponentConfigurationGenerator;
|
|
4
|
-
exports.cypressComponentConfigurationGeneratorInternal = cypressComponentConfigurationGeneratorInternal;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
const react_1 = require("@nx/react");
|
|
8
|
-
const versions_1 = require("../../utils/versions");
|
|
9
|
-
function cypressComponentConfigurationGenerator(tree, options) {
|
|
10
|
-
return cypressComponentConfigurationGeneratorInternal(tree, {
|
|
11
|
-
addPlugin: false,
|
|
12
|
-
...options,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
async function cypressComponentConfigurationGeneratorInternal(tree, options) {
|
|
16
|
-
(0, versions_1.assertSupportedRemixVersion)(tree);
|
|
17
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
18
|
-
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
19
|
-
nxJson.useInferencePlugins !== false;
|
|
20
|
-
options.addPlugin ??= addPluginDefault;
|
|
21
|
-
await (0, react_1.cypressComponentConfigGenerator)(tree, {
|
|
22
|
-
project: options.project,
|
|
23
|
-
generateTests: options.generateTests,
|
|
24
|
-
skipFormat: true,
|
|
25
|
-
bundler: 'vite',
|
|
26
|
-
buildTarget: '',
|
|
27
|
-
addPlugin: options.addPlugin,
|
|
28
|
-
});
|
|
29
|
-
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
30
|
-
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files'), project.root, { tmpl: '' });
|
|
31
|
-
if (!options.skipFormat) {
|
|
32
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.default = cypressComponentConfigurationGenerator;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxRemixCypressComponentTestConfiguration",
|
|
5
|
-
"title": "Add Cypress component testing",
|
|
6
|
-
"description": "Add a Cypress component testing configuration to an existing project.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g @nx/remix:cypress-component-configuration --project=my-remix-project",
|
|
11
|
-
"description": "Add component testing to your Remix project"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"command": "nx g @nx/remix:cypress-component-configuration --project=my-remix-project --generate-tests",
|
|
15
|
-
"description": "Add component testing to your Remix project and generate component tests for your existing components"
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"properties": {
|
|
19
|
-
"project": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The name of the project to add cypress component testing configuration to",
|
|
22
|
-
"x-dropdown": "projects",
|
|
23
|
-
"x-prompt": "What project should we add Cypress component testing to?",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
|
-
"generateTests": {
|
|
27
|
-
"type": "boolean",
|
|
28
|
-
"description": "Generate default component tests for existing components in the project",
|
|
29
|
-
"x-prompt": "Automatically generate tests for components declared in this project?",
|
|
30
|
-
"default": false,
|
|
31
|
-
"x-priority": "important"
|
|
32
|
-
},
|
|
33
|
-
"skipFormat": {
|
|
34
|
-
"type": "boolean",
|
|
35
|
-
"description": "Skip formatting files",
|
|
36
|
-
"default": false,
|
|
37
|
-
"x-priority": "internal"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"required": ["project"]
|
|
41
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = errorBoundaryGenerator;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const lib_1 = require("./lib");
|
|
6
|
-
const versions_1 = require("../../utils/versions");
|
|
7
|
-
async function errorBoundaryGenerator(tree, schema) {
|
|
8
|
-
(0, versions_1.assertSupportedRemixVersion)(tree);
|
|
9
|
-
const options = await (0, lib_1.normalizeOptions)(tree, schema);
|
|
10
|
-
(0, lib_1.addV2ErrorBoundary)(tree, options);
|
|
11
|
-
if (!options.skipFormat) {
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addV2ErrorBoundary = addV2ErrorBoundary;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const insert_import_1 = require("../../../utils/insert-import");
|
|
6
|
-
const insert_statement_after_imports_1 = require("../../../utils/insert-statement-after-imports");
|
|
7
|
-
function addV2ErrorBoundary(tree, options) {
|
|
8
|
-
(0, insert_import_1.insertImport)(tree, options.path, `useRouteError`, '@remix-run/react');
|
|
9
|
-
(0, insert_import_1.insertImport)(tree, options.path, `isRouteErrorResponse`, '@remix-run/react');
|
|
10
|
-
(0, insert_statement_after_imports_1.insertStatementAfterImports)(tree, options.path, (0, devkit_1.stripIndents) `
|
|
11
|
-
export function ErrorBoundary() {
|
|
12
|
-
const error = useRouteError();
|
|
13
|
-
|
|
14
|
-
// when true, this is what used to go to 'CatchBoundary'
|
|
15
|
-
if (isRouteErrorResponse(error)) {
|
|
16
|
-
return (
|
|
17
|
-
<div>
|
|
18
|
-
<h1>Oops</h1>
|
|
19
|
-
<p>Status: {error.status}</p>
|
|
20
|
-
<p>{error.data.message}</p>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
} else if (error instanceof Error) {
|
|
24
|
-
return (
|
|
25
|
-
<div>
|
|
26
|
-
<h1>Error</h1>
|
|
27
|
-
<p>{error.message}</p>
|
|
28
|
-
<p>The stack trace is:</p>
|
|
29
|
-
<pre>{error.stack}</pre>
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
} else {
|
|
33
|
-
return <h1>Unknown Error</h1>;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`);
|
|
37
|
-
}
|