@nrwl/remix 14.4.2 → 15.8.5
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/migrations.json +96 -0
- package/package.json +12 -7
- package/src/generators/application/application.impl.js +14 -31
- package/src/generators/application/application.impl.js.map +1 -1
- package/src/generators/application/files/package.json__tmpl__ +16 -13
- package/src/generators/application/files/remix.config.js__tmpl__ +1 -0
- package/src/generators/application/files/remix.env.d.ts__tmpl__ +1 -1
- package/src/generators/application/files/tsconfig.json__tmpl__ +1 -5
- package/src/generators/preset/lib/normalize-options.d.ts +2 -2
- package/src/generators/preset/lib/normalize-options.js +4 -7
- package/src/generators/preset/lib/normalize-options.js.map +1 -1
- package/src/generators/preset/preset.impl.js +5 -9
- package/src/generators/preset/preset.impl.js.map +1 -1
- package/src/generators/preset/schema.d.ts +1 -1
- package/src/generators/preset/schema.json +3 -3
- package/src/generators/setup/setup.impl.d.ts +2 -4
- package/src/generators/setup/setup.impl.js +9 -45
- package/src/generators/setup/setup.impl.js.map +1 -1
- package/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.d.ts +6 -0
- package/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.js +45 -0
- package/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.js.map +1 -0
- package/src/migrations/update-15-8-6/update-remix-env-d.d.ts +6 -0
- package/src/migrations/update-15-8-6/update-remix-env-d.js +27 -0
- package/src/migrations/update-15-8-6/update-remix-env-d.js.map +1 -0
- package/src/utils/get-remix-projects.d.ts +2 -0
- package/src/utils/get-remix-projects.js +15 -0
- package/src/utils/get-remix-projects.js.map +1 -0
- package/src/generators/application/files/app/entry.client.tsx__tmpl__ +0 -4
- package/src/generators/application/files/app/entry.server.tsx__tmpl__ +0 -21
package/migrations.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schematics": {
|
|
3
|
+
"update-tsconfig-and-remix-config-for-1-6-8": {
|
|
4
|
+
"version": "14.5.4",
|
|
5
|
+
"cli": "nx",
|
|
6
|
+
"description": "Update tsconfig.json and tsconfig.json to enable import of workspace libs",
|
|
7
|
+
"factory": "./src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8"
|
|
8
|
+
},
|
|
9
|
+
"update-remix-env-config": {
|
|
10
|
+
"version": "15.8.6",
|
|
11
|
+
"cli": "nx",
|
|
12
|
+
"description": "Update remix.env.d.ts for node types import",
|
|
13
|
+
"factory": "./src/migrations/update-15-8-6/update-remix-env-d"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"packageJsonUpdates": {
|
|
17
|
+
"14.5.4": {
|
|
18
|
+
"version": "14.5.4",
|
|
19
|
+
"packages": {
|
|
20
|
+
"@remix-run/react": {
|
|
21
|
+
"version": "^1.6.8",
|
|
22
|
+
"alwaysAddToPackageJson": true
|
|
23
|
+
},
|
|
24
|
+
"@remix-run/node": {
|
|
25
|
+
"version": "^1.6.8",
|
|
26
|
+
"alwaysAddToPackageJson": true
|
|
27
|
+
},
|
|
28
|
+
"@remix-run/serve": {
|
|
29
|
+
"version": "^1.6.8",
|
|
30
|
+
"alwaysAddToPackageJson": true
|
|
31
|
+
},
|
|
32
|
+
"@remix-run/dev": {
|
|
33
|
+
"version": "^1.6.8",
|
|
34
|
+
"alwaysAddToPackageJson": true
|
|
35
|
+
},
|
|
36
|
+
"@remix-run/eslint-config": {
|
|
37
|
+
"version": "^1.6.8",
|
|
38
|
+
"alwaysAddToPackageJson": true
|
|
39
|
+
},
|
|
40
|
+
"react": {
|
|
41
|
+
"version": "^18.2.0",
|
|
42
|
+
"alwaysAddToPackageJson": true
|
|
43
|
+
},
|
|
44
|
+
"react-dom": {
|
|
45
|
+
"version": "^18.2.0",
|
|
46
|
+
"alwaysAddToPackageJson": true
|
|
47
|
+
},
|
|
48
|
+
"@types/react-dom": {
|
|
49
|
+
"version": "^18.0.6",
|
|
50
|
+
"alwaysAddToPackageJson": true
|
|
51
|
+
},
|
|
52
|
+
"@types/react": {
|
|
53
|
+
"version": "^18.0.15",
|
|
54
|
+
"alwaysAddToPackageJson": true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"15.8.6": {
|
|
59
|
+
"version": "15.8.6",
|
|
60
|
+
"packages": {
|
|
61
|
+
"@remix-run/node": {
|
|
62
|
+
"version": "^1.14.0",
|
|
63
|
+
"alwaysAddToPackageJson": true
|
|
64
|
+
},
|
|
65
|
+
"@remix-run/react": {
|
|
66
|
+
"version": "^1.14.0",
|
|
67
|
+
"alwaysAddToPackageJson": true
|
|
68
|
+
},
|
|
69
|
+
"@remix-run/serve": {
|
|
70
|
+
"version": "^1.14.0",
|
|
71
|
+
"alwaysAddToPackageJson": true
|
|
72
|
+
},
|
|
73
|
+
"@remix-run/dev": {
|
|
74
|
+
"version": "^1.14.0",
|
|
75
|
+
"alwaysAddToPackageJson": true
|
|
76
|
+
},
|
|
77
|
+
"@remix-run/eslint-config": {
|
|
78
|
+
"version": "^1.14.0",
|
|
79
|
+
"alwaysAddToPackageJson": true
|
|
80
|
+
},
|
|
81
|
+
"@types/react-dom": {
|
|
82
|
+
"version": "^18.0.8",
|
|
83
|
+
"alwaysAddToPackageJson": true
|
|
84
|
+
},
|
|
85
|
+
"@types/react": {
|
|
86
|
+
"version": "^18.0.25",
|
|
87
|
+
"alwaysAddToPackageJson": true
|
|
88
|
+
},
|
|
89
|
+
"isbot": {
|
|
90
|
+
"version": "^3.6.5",
|
|
91
|
+
"alwaysAddToPackageJson": true
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/remix",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.8.5",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"generators": "./generators.json",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@nrwl/devkit": "
|
|
8
|
-
"@nrwl/js": "
|
|
9
|
-
"@nrwl/react": "
|
|
10
|
-
"
|
|
7
|
+
"@nrwl/devkit": "15.8.5",
|
|
8
|
+
"@nrwl/js": "15.8.5",
|
|
9
|
+
"@nrwl/react": "15.8.5",
|
|
10
|
+
"@swc/core": "1.3.35",
|
|
11
|
+
"tslib": "2.3.1"
|
|
11
12
|
},
|
|
12
|
-
"
|
|
13
|
-
}
|
|
13
|
+
"ng-update": {
|
|
14
|
+
"requirements": {},
|
|
15
|
+
"migrations": "./migrations.json"
|
|
16
|
+
},
|
|
17
|
+
"types": "./src/index.d.ts"
|
|
18
|
+
}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const normalize_options_1 = require("./lib/normalize-options");
|
|
6
5
|
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
7
|
-
const
|
|
6
|
+
const normalize_options_1 = require("./lib/normalize-options");
|
|
8
7
|
function default_1(tree, _options) {
|
|
9
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
9
|
const options = (0, normalize_options_1.normalizeOptions)(tree, _options);
|
|
@@ -16,38 +15,22 @@ function default_1(tree, _options) {
|
|
|
16
15
|
tags: options.parsedTags,
|
|
17
16
|
});
|
|
18
17
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
19
|
-
'@remix-run/
|
|
20
|
-
react: '^
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
'@remix-run/node': '^1.14.0',
|
|
19
|
+
'@remix-run/react': '^1.14.0',
|
|
20
|
+
'@remix-run/serve': '^1.14.0',
|
|
21
|
+
isbot: '^3.6.5',
|
|
22
|
+
react: '^18.2.0',
|
|
23
|
+
'react-dom': '^18.2.0',
|
|
24
24
|
}, {
|
|
25
|
-
'@remix-run/dev': '^1.0
|
|
26
|
-
'@
|
|
27
|
-
'@types/react
|
|
28
|
-
|
|
25
|
+
'@remix-run/dev': '^1.14.0',
|
|
26
|
+
'@remix-run/eslint-config': '^1.14.0',
|
|
27
|
+
'@types/react': '^18.0.25',
|
|
28
|
+
'@types/react-dom': '^18.0.8',
|
|
29
|
+
eslint: '^8.27.0',
|
|
30
|
+
typescript: '^4.8.4',
|
|
29
31
|
});
|
|
30
32
|
tasks.push(installTask);
|
|
31
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.projectRoot, Object.assign(Object.assign({}, options), { tmpl: '' }));
|
|
32
|
-
const remixSetupCommand = 'remix setup node';
|
|
33
|
-
// update package json with postinstall command
|
|
34
|
-
(0, devkit_1.updateJson)(tree, 'package.json', (pkgJson) => {
|
|
35
|
-
var _a;
|
|
36
|
-
pkgJson.scripts = (_a = pkgJson.scripts) !== null && _a !== void 0 ? _a : {};
|
|
37
|
-
if (!pkgJson.scripts.postinstall) {
|
|
38
|
-
pkgJson.scripts.postinstall = remixSetupCommand;
|
|
39
|
-
}
|
|
40
|
-
else if (!pkgJson.scripts.postinstall.includes(remixSetupCommand)) {
|
|
41
|
-
pkgJson.scripts.postinstall = `${pkgJson.scripts.postinstall} && ${remixSetupCommand}`;
|
|
42
|
-
}
|
|
43
|
-
return pkgJson;
|
|
44
|
-
});
|
|
45
|
-
tasks.push(() => {
|
|
46
|
-
(0, child_process_1.execSync)(`npx ${remixSetupCommand}`, {
|
|
47
|
-
cwd: options.projectRoot,
|
|
48
|
-
stdio: [0, 1, 2],
|
|
49
|
-
});
|
|
50
|
-
});
|
|
33
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.projectRoot, Object.assign(Object.assign({}, options), { tmpl: '', offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.projectRoot) }));
|
|
51
34
|
if (!options.skipFormat) {
|
|
52
35
|
yield (0, devkit_1.formatFiles)(tree);
|
|
53
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":";;;AAAA,yCASsB;
|
|
1
|
+
{"version":3,"file":"application.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":";;;AAAA,yCASsB;AACtB,2FAAqF;AACrF,+DAA2D;AAG3D,mBAA+B,IAAU,EAAE,QAAgC;;QACzE,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,IAAA,gCAAuB,EAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE;YACjD,IAAI,EAAE,OAAO,CAAC,WAAW;YACzB,UAAU,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE;YACpC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,OAAO,CAAC,UAAU;SACzB,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,IAAA,qCAA4B,EAC9C,IAAI,EACJ;YACE,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,SAAS;YAC7B,kBAAkB,EAAE,SAAS;YAC7B,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,SAAS;SACvB,EACD;YACE,gBAAgB,EAAE,SAAS;YAC3B,0BAA0B,EAAE,SAAS;YACrC,cAAc,EAAE,UAAU;YAC1B,kBAAkB,EAAE,SAAS;YAC7B,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,QAAQ;SACrB,CACF,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAExB,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EACrC,OAAO,CAAC,WAAW,kCAEd,OAAO,KACV,IAAI,EAAE,EAAE,EACR,cAAc,EAAE,IAAA,uBAAc,EAAC,OAAO,CAAC,WAAW,CAAC,IAEtD,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,sCAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAhDD,4BAgDC"}
|
|
@@ -4,23 +4,26 @@
|
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "
|
|
8
|
-
"dev": "
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"build": "remix build",
|
|
8
|
+
"dev": "remix dev",
|
|
9
|
+
"start": "remix-serve build",
|
|
10
|
+
"typecheck": "tsc"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@remix-run/
|
|
14
|
-
"react": "^
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
13
|
+
"@remix-run/node": "^1.14.0",
|
|
14
|
+
"@remix-run/react": "^1.14.0",
|
|
15
|
+
"@remix-run/serve": "^1.14.0",
|
|
16
|
+
"isbot": "^3.6.5",
|
|
17
|
+
"react": "^18.2.0",
|
|
18
|
+
"react-dom": "^18.2.0"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@remix-run/dev": "^1.0
|
|
21
|
-
"@
|
|
22
|
-
"@types/react
|
|
23
|
-
"
|
|
21
|
+
"@remix-run/dev": "^1.14.0",
|
|
22
|
+
"@remix-run/eslint-config": "^1.14.0",
|
|
23
|
+
"@types/react": "^18.0.25",
|
|
24
|
+
"@types/react-dom": "^18.0.8",
|
|
25
|
+
"eslint": "^8.27.0",
|
|
26
|
+
"typescript": "^4.8.4"
|
|
24
27
|
},
|
|
25
28
|
"engines": {
|
|
26
29
|
"node": ">=14"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="@remix-run/dev" />
|
|
2
|
-
/// <reference types="@remix-run/node
|
|
2
|
+
/// <reference types="@remix-run/node" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
|
2
3
|
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
|
|
3
4
|
"compilerOptions": {
|
|
4
5
|
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
|
@@ -11,11 +12,6 @@
|
|
|
11
12
|
"strict": true,
|
|
12
13
|
"allowJs": true,
|
|
13
14
|
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"baseUrl": ".",
|
|
15
|
-
"paths": {
|
|
16
|
-
"~/*": ["./app/*"]
|
|
17
|
-
},
|
|
18
|
-
|
|
19
15
|
// Remix takes care of building everything in `remix build`.
|
|
20
16
|
"noEmit": true
|
|
21
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RemixGeneratorSchema } from '../schema';
|
|
2
1
|
import { Tree } from '@nrwl/devkit';
|
|
2
|
+
import { RemixGeneratorSchema } from '../schema';
|
|
3
3
|
export interface NormalizedSchema extends RemixGeneratorSchema {
|
|
4
|
-
|
|
4
|
+
appName: string;
|
|
5
5
|
projectRoot: string;
|
|
6
6
|
parsedTags: string[];
|
|
7
7
|
}
|
|
@@ -5,17 +5,14 @@ const devkit_1 = require("@nrwl/devkit");
|
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
6
|
// There is a bug in Nx core where custom preset args are not passed correctly for boolean values, thus causing the name to be "commit" or "nx-cloud" when not passed.
|
|
7
7
|
// TODO(jack): revert this hack once Nx core is fixed for custom preset args.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
? 'webapp'
|
|
12
|
-
: options.project).fileName;
|
|
13
|
-
const projectName = name;
|
|
8
|
+
// TODO(philip): presets should probably be using the `appName` flag to name the app, but it's not getting passed down to this generator properly and is always an empty string
|
|
9
|
+
const name = (0, devkit_1.names)(!options.remixAppName ? 'webapp' : options.remixAppName).fileName;
|
|
10
|
+
const appName = name;
|
|
14
11
|
const projectRoot = `packages/${name}`;
|
|
15
12
|
const parsedTags = options.tags
|
|
16
13
|
? options.tags.split(',').map((s) => s.trim())
|
|
17
14
|
: [];
|
|
18
|
-
return Object.assign(Object.assign({}, options), {
|
|
15
|
+
return Object.assign(Object.assign({}, options), { appName,
|
|
19
16
|
projectRoot,
|
|
20
17
|
parsedTags });
|
|
21
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/preset/lib/normalize-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/preset/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAS3C,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAA6B;IAE7B,sKAAsK;IACtK,6EAA6E;IAC7E,+KAA+K;IAC/K,MAAM,IAAI,GAAG,IAAA,cAAK,EAChB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CACxD,CAAC,QAAQ,CAAC;IACX,MAAM,OAAO,GAAG,IAAI,CAAC;IACrB,MAAM,WAAW,GAAG,YAAY,IAAI,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI;QAC7B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,CAAC,CAAC,EAAE,CAAC;IAEP,uCACK,OAAO,KACV,OAAO;QACP,WAAW;QACX,UAAU,IACV;AACJ,CAAC;AAtBD,4CAsBC"}
|
|
@@ -2,26 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const
|
|
5
|
+
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
6
6
|
const application_impl_1 = require("../application/application.impl");
|
|
7
7
|
const setup_impl_1 = require("../setup/setup.impl");
|
|
8
|
-
const
|
|
9
|
-
const set_default_collection_1 = require("@nrwl/workspace/src/utilities/set-default-collection");
|
|
8
|
+
const normalize_options_1 = require("./lib/normalize-options");
|
|
10
9
|
function default_1(tree, _options) {
|
|
11
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
11
|
const options = (0, normalize_options_1.normalizeOptions)(tree, _options);
|
|
13
12
|
const tasks = [];
|
|
13
|
+
const setupGenTask = yield (0, setup_impl_1.default)(tree);
|
|
14
|
+
tasks.push(setupGenTask);
|
|
14
15
|
const appGenTask = yield (0, application_impl_1.default)(tree, {
|
|
15
|
-
name: options.
|
|
16
|
+
name: options.appName,
|
|
16
17
|
tags: options.tags,
|
|
17
18
|
skipFormat: true,
|
|
18
19
|
});
|
|
19
20
|
tasks.push(appGenTask);
|
|
20
|
-
const setupGenTask = yield (0, setup_impl_1.default)(tree, {});
|
|
21
|
-
tasks.push(setupGenTask);
|
|
22
|
-
// No need for workspace.json in latest Nx
|
|
23
|
-
tree.delete('workspace.json');
|
|
24
|
-
(0, set_default_collection_1.setDefaultCollection)(tree, '@nrwl/remix');
|
|
25
21
|
yield (0, devkit_1.formatFiles)(tree);
|
|
26
22
|
return (0, run_tasks_in_serial_1.runTasksInSerial)(...tasks);
|
|
27
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/preset/preset.impl.ts"],"names":[],"mappings":";;;AAAA,yCAAoE;
|
|
1
|
+
{"version":3,"file":"preset.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/preset/preset.impl.ts"],"names":[],"mappings":";;;AAAA,yCAAoE;AAEpE,2FAAqF;AACrF,sEAAmE;AACnE,oDAAiD;AACjD,+DAA2D;AAG3D,mBAA+B,IAAU,EAAE,QAA8B;;QACvE,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,MAAM,YAAY,GAAG,MAAM,IAAA,oBAAc,EAAC,IAAI,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEzB,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAoB,EAAC,IAAI,EAAE;YAClD,IAAI,EAAE,OAAO,CAAC,OAAO;YACrB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAA,sCAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAjBD,4BAiBC"}
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
"title": "",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"remixAppName": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"description": "",
|
|
11
11
|
"$default": {
|
|
12
12
|
"$source": "argv",
|
|
13
13
|
"index": 0
|
|
14
14
|
},
|
|
15
|
-
"x-prompt": "What is the name of the
|
|
15
|
+
"x-prompt": "What is the name of the app?"
|
|
16
16
|
},
|
|
17
17
|
"tags": {
|
|
18
18
|
"type": "string",
|
|
19
|
-
"description": "Add tags to the
|
|
19
|
+
"description": "Add tags to the app (used for linting)",
|
|
20
20
|
"alias": "t"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
export default function (tree: Tree
|
|
3
|
-
packageManager?: 'yarn' | 'npm' | 'pnpm';
|
|
4
|
-
}): Promise<() => void>;
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
2
|
+
export default function (tree: Tree): Promise<GeneratorCallback>;
|
|
@@ -2,27 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const js_1 = require("@nrwl/js");
|
|
6
|
+
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
7
|
+
function default_1(tree) {
|
|
7
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _a;
|
|
14
|
-
if (!json.workspaces) {
|
|
15
|
-
(_a = json.workspaces) !== null && _a !== void 0 ? _a : (json.workspaces = [(0, devkit_1.joinPathFragments)(libsDir, '*')]);
|
|
16
|
-
}
|
|
17
|
-
return json;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
if (!tree.exists('pnpm-workspace.yaml')) {
|
|
22
|
-
tree.write('pnpm-workspace.yaml', `packages:
|
|
23
|
-
- '${(0, devkit_1.joinPathFragments)(libsDir, '*')}'`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
9
|
+
const tasks = [];
|
|
10
|
+
const jsInitTask = yield (0, js_1.initGenerator)(tree, {
|
|
11
|
+
skipFormat: true,
|
|
12
|
+
});
|
|
13
|
+
tasks.push(jsInitTask);
|
|
26
14
|
// Ignore nested project files
|
|
27
15
|
let ignoreFile = tree.read('.gitignore').toString();
|
|
28
16
|
if (ignoreFile.indexOf('/dist') !== -1) {
|
|
@@ -39,33 +27,9 @@ apps/**/.cache
|
|
|
39
27
|
`;
|
|
40
28
|
}
|
|
41
29
|
tree.write('.gitignore', ignoreFile);
|
|
42
|
-
(0, devkit_1.updateJson)(tree, 'nx.json', (json) => {
|
|
43
|
-
addTargetDependency(json, 'dev', {
|
|
44
|
-
target: 'build',
|
|
45
|
-
projects: 'dependencies',
|
|
46
|
-
});
|
|
47
|
-
addTargetDependency(json, 'start', { target: 'build', projects: 'self' });
|
|
48
|
-
return json;
|
|
49
|
-
});
|
|
50
30
|
yield (0, devkit_1.formatFiles)(tree);
|
|
51
|
-
return ()
|
|
52
|
-
// Reserved for additional processing needed
|
|
53
|
-
};
|
|
31
|
+
return (0, run_tasks_in_serial_1.runTasksInSerial)(...tasks);
|
|
54
32
|
});
|
|
55
33
|
}
|
|
56
34
|
exports.default = default_1;
|
|
57
|
-
function addTargetDependency(json, target, dep) {
|
|
58
|
-
var _a;
|
|
59
|
-
if (Array.isArray((_a = json.targetDependencies) === null || _a === void 0 ? void 0 : _a[target])) {
|
|
60
|
-
if (!json.targetDependencies[target].some((x) => x.target === dep.target && x.projects === dep.projects)) {
|
|
61
|
-
json.targetDependencies[target].push({
|
|
62
|
-
target: dep.target,
|
|
63
|
-
projects: dep.projects,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
json.targetDependencies = Object.assign(Object.assign({}, json.targetDependencies), { [target]: [dep] });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
35
|
//# sourceMappingURL=setup.impl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/setup/setup.impl.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"setup.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/setup/setup.impl.ts"],"names":[],"mappings":";;;AAAA,yCAAoE;AACpE,iCAA4D;AAC5D,2FAAqF;AAErF,mBAA+B,IAAU;;QACvC,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,MAAM,UAAU,GAAG,MAAM,IAAA,kBAAe,EAAC,IAAI,EAAE;YAC7C,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEvB,8BAA8B;QAC9B,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;QACpD,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;YACtC,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAClD;QACD,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE;YAC9C,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;SAClE;QACD,IAAI,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE;YAC9C,UAAU,GAAG,GAAG,UAAU;;;;GAI3B,CAAC;SACD;QACD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAErC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAA,sCAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AA5BD,4BA4BC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* Update tsconfig.json and remix.config.js to support importing workspaces libraries
|
|
7
|
+
* @param tree
|
|
8
|
+
*/
|
|
9
|
+
function update(tree) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
+
const remixProjects = Array.from(projects.values()).filter((project) => {
|
|
13
|
+
const remixConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'remix.config.js');
|
|
14
|
+
// if the project doesn't have a remix.config.js, it's not a Remix project so we can skip it
|
|
15
|
+
return tree.exists(remixConfigPath);
|
|
16
|
+
});
|
|
17
|
+
if (remixProjects.length === 0)
|
|
18
|
+
return;
|
|
19
|
+
remixProjects.forEach((project) => {
|
|
20
|
+
const remixConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'remix.config.js');
|
|
21
|
+
try {
|
|
22
|
+
const remixConfigContent = tree.read(remixConfigPath, 'utf-8');
|
|
23
|
+
// if watchPaths is already there, we assume this project has been updated before
|
|
24
|
+
if (remixConfigContent.includes('watchPaths'))
|
|
25
|
+
return;
|
|
26
|
+
const projectOffsetFromRoot = (0, devkit_1.offsetFromRoot)(project.root);
|
|
27
|
+
const layout = (0, devkit_1.getWorkspaceLayout)(tree);
|
|
28
|
+
tree.write(remixConfigPath, remixConfigContent.replace('module.exports = {\n', `module.exports = { watchPaths: ['${(0, devkit_1.joinPathFragments)(projectOffsetFromRoot, layout.libsDir)}'],\n`));
|
|
29
|
+
const tsConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'tsconfig.json');
|
|
30
|
+
const tsConfigContent = (0, devkit_1.readJson)(tree, tsConfigPath);
|
|
31
|
+
const newTsConfigContent = Object.assign(Object.assign({}, tsConfigContent), { extends: `${projectOffsetFromRoot}tsconfig.base.json` });
|
|
32
|
+
delete newTsConfigContent.compilerOptions.baseUrl;
|
|
33
|
+
devkit_1.logger.info(`Remix apps now support importing from non-buildable libs. However, you must remove the \`paths\` configuration from the project's \`tsconfig.json\`.\n\nMigrate any import paths using \`~\` to relative path imports and then delete the \`paths\` property from \`${tsConfigPath}\``);
|
|
34
|
+
(0, devkit_1.writeJson)(tree, tsConfigPath, newTsConfigContent);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
devkit_1.logger.error(err);
|
|
38
|
+
devkit_1.logger.error(`Unable to update ${remixConfigPath} for project ${project.root}.`);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.default = update;
|
|
45
|
+
//# sourceMappingURL=update-tsconfig-and-remix-config-for-1-6-8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-tsconfig-and-remix-config-for-1-6-8.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.ts"],"names":[],"mappings":";;;AAAA,yCAUsB;AAEtB;;;GAGG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;YACrE,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YAC3E,4FAA4F;YAC5F,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAEvC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAChC,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YAE3E,IAAI;gBACF,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAC/D,iFAAiF;gBACjF,IAAI,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC;oBAAE,OAAO;gBAEtD,MAAM,qBAAqB,GAAG,IAAA,uBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC3D,MAAM,MAAM,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;gBACxC,IAAI,CAAC,KAAK,CACR,eAAe,EACf,kBAAkB,CAAC,OAAO,CACxB,sBAAsB,EACtB,qCAAqC,IAAA,0BAAiB,EACpD,qBAAqB,EACrB,MAAM,CAAC,OAAO,CACf,OAAO,CACT,CACF,CAAC;gBAEF,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBACtE,MAAM,eAAe,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBAErD,MAAM,kBAAkB,mCACnB,eAAe,KAClB,OAAO,EAAE,GAAG,qBAAqB,oBAAoB,GACtD,CAAC;gBAEF,OAAO,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;gBAElD,eAAM,CAAC,IAAI,CACT,uQAAuQ,YAAY,IAAI,CACxR,CAAC;gBAEF,IAAA,kBAAS,EAAC,IAAI,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAAC;aACnD;YAAC,OAAO,GAAG,EAAE;gBACZ,eAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAClB,eAAM,CAAC,KAAK,CACV,oBAAoB,eAAe,gBAAgB,OAAO,CAAC,IAAI,GAAG,CACnE,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAvDD,yBAuDC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const get_remix_projects_1 = require("../../utils/get-remix-projects");
|
|
6
|
+
/**
|
|
7
|
+
* Update remix.env.d.ts
|
|
8
|
+
* @param tree
|
|
9
|
+
*/
|
|
10
|
+
function update(tree) {
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const remixProjects = (0, get_remix_projects_1.getRemixProjects)(tree);
|
|
13
|
+
remixProjects.forEach((project) => {
|
|
14
|
+
const remixEnvPath = (0, devkit_1.joinPathFragments)(project.root, 'remix.env.d.ts');
|
|
15
|
+
try {
|
|
16
|
+
const remixEnvContent = tree.read(remixEnvPath, 'utf-8');
|
|
17
|
+
tree.write(remixEnvPath, remixEnvContent.replace('/// <reference types="@remix-run/node/globals" />', '/// <reference types="@remix-run/node" />'));
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
devkit_1.logger.error(err);
|
|
21
|
+
devkit_1.logger.error(`Unable to update ${remixEnvPath} for project ${project.root}.`);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.default = update;
|
|
27
|
+
//# sourceMappingURL=update-remix-env-d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-remix-env-d.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/migrations/update-15-8-6/update-remix-env-d.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAC/D,uEAAkE;AAElE;;;GAGG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,aAAa,GAAG,IAAA,qCAAgB,EAAC,IAAI,CAAC,CAAC;QAE7C,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAChC,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YAEvE,IAAI;gBACF,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBAEzD,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,eAAe,CAAC,OAAO,CACrB,mDAAmD,EACnD,2CAA2C,CAC5C,CACF,CAAC;aACH;YAAC,OAAO,GAAG,EAAE;gBACZ,eAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAClB,eAAM,CAAC,KAAK,CACV,oBAAoB,YAAY,gBAAgB,OAAO,CAAC,IAAI,GAAG,CAChE,CAAC;aACH;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAvBD,yBAuBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRemixProjects = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function getRemixProjects(tree) {
|
|
6
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
7
|
+
const remixProjects = Array.from(projects.values()).filter((project) => {
|
|
8
|
+
const remixConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'remix.config.js');
|
|
9
|
+
// if the project doesn't have a remix.config.js, it's not a Remix project so we can skip it
|
|
10
|
+
return tree.exists(remixConfigPath);
|
|
11
|
+
});
|
|
12
|
+
return remixProjects;
|
|
13
|
+
}
|
|
14
|
+
exports.getRemixProjects = getRemixProjects;
|
|
15
|
+
//# sourceMappingURL=get-remix-projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-remix-projects.js","sourceRoot":"","sources":["../../../../../packages/remix/src/utils/get-remix-projects.ts"],"names":[],"mappings":";;;AAAA,yCAAoE;AAEpE,SAAgB,gBAAgB,CAAC,IAAU;IACzC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAEnC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QACrE,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC3E,4FAA4F;QAC5F,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACvB,CAAC;AATD,4CASC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { EntryContext } from "@remix-run/node";
|
|
2
|
-
import { RemixServer } from "@remix-run/react";
|
|
3
|
-
import { renderToString } from "react-dom/server";
|
|
4
|
-
|
|
5
|
-
export default function handleRequest(
|
|
6
|
-
request: Request,
|
|
7
|
-
responseStatusCode: number,
|
|
8
|
-
responseHeaders: Headers,
|
|
9
|
-
remixContext: EntryContext
|
|
10
|
-
) {
|
|
11
|
-
let markup = renderToString(
|
|
12
|
-
<RemixServer context={remixContext} url={request.url} />
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
responseHeaders.set("Content-Type", "text/html");
|
|
16
|
-
|
|
17
|
-
return new Response("<!DOCTYPE html>" + markup, {
|
|
18
|
-
status: responseStatusCode,
|
|
19
|
-
headers: responseHeaders,
|
|
20
|
-
});
|
|
21
|
-
}
|