@nrwl/remix 1.0.0-alpha.20 → 1.0.0-alpha.24
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
CHANGED
|
@@ -52,6 +52,19 @@ You can then add your first app and run it:
|
|
|
52
52
|
npx nx g @nrwl/remix:app demo
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
## Adding new routes
|
|
56
|
+
|
|
57
|
+
Add a new route with one command.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx nx g route
|
|
61
|
+
|
|
62
|
+
# e.g.
|
|
63
|
+
npx nx g route foo/bar --project=demo
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Browse to `http://localhost:3000/foo/bar` to see the new route.
|
|
67
|
+
|
|
55
68
|
## Workspace libraries
|
|
56
69
|
|
|
57
70
|
The Remix setup leverages npm/yarn/pnpm workspaces and Nx buildable libraries.
|
package/package.json
CHANGED
|
@@ -10,6 +10,8 @@ function default_1(tree, options) {
|
|
|
10
10
|
if (!project)
|
|
11
11
|
throw new Error(`Project does not exist: ${options.project}`);
|
|
12
12
|
const componentPath = (0, devkit_1.joinPathFragments)(project.root, 'app/routes', `${routePath}.tsx`);
|
|
13
|
+
if (tree.exists(componentPath))
|
|
14
|
+
throw new Error(`Path already exists: ${options.path}`);
|
|
13
15
|
tree.write(componentPath, (0, devkit_1.stripIndents) `
|
|
14
16
|
import { useEffect, useRef } from 'react';
|
|
15
17
|
${options.style === 'css'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/route/route.impl.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AAGtB,mBAA+B,IAAU,EAAE,OAAyB;;QAClE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAA,cAAK,EAC7D,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC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O,CAAC,IAAI,EAAE,CAAC,CAAC;QAE1D,IAAI,CAAC,KAAK,CACR,aAAa,EACb,IAAA,qBAAY,EAAA;;MAGV,OAAO,CAAC,KAAK,KAAK,KAAK;YACrB,CAAC,CAAC;OACH;YACC,CAAC,CAAC,4DACN;;;MAIE,OAAO,CAAC,KAAK,KAAK,KAAK;YACrB,CAAC,CAAC,mCAAmC,SAAS,QAAQ;YACtD,CAAC,CAAC,EACN;;;;;;yBAMqB,aAAa;;;MAIhC,OAAO,CAAC,KAAK,KAAK,KAAK;YACrB,CAAC,CAAC,IAAA,qBAAY,EAAA;;;;;;SAMb;YACD,CAAC,CAAC,EACN;;;;;;;;;;8BAU0B,aAAa;;;;;;;;GAQxC,CACA,CAAC;QAEF,IAAI,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE;YAC3B,MAAM,cAAc,GAAG,IAAA,0BAAiB,EACtC,OAAO,CAAC,IAAI,EACZ,YAAY,EACZ,GAAG,SAAS,MAAM,CACnB,CAAC;YACF,IAAI,CAAC,KAAK,CACR,cAAc,EACd,IAAA,qBAAY,EAAA;;;;;;;;;KASb,CACA,CAAC;SACH;IACH,CAAC;CAAA;AA9FD,4BA8FC"}
|
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
"properties": {
|
|
14
14
|
"project": {
|
|
15
15
|
"type": "string",
|
|
16
|
-
"description": "
|
|
16
|
+
"description": "The name of the project.",
|
|
17
17
|
"$default": {
|
|
18
|
-
"$source": "
|
|
19
|
-
"index": 0
|
|
18
|
+
"$source": "projectName"
|
|
20
19
|
},
|
|
21
20
|
"x-prompt": "What project is this route for?",
|
|
22
21
|
"pattern": "^[a-zA-Z].*$"
|
|
@@ -26,9 +25,9 @@
|
|
|
26
25
|
"description": "Route path",
|
|
27
26
|
"$default": {
|
|
28
27
|
"$source": "argv",
|
|
29
|
-
"index":
|
|
28
|
+
"index": 0
|
|
30
29
|
},
|
|
31
|
-
"x-prompt": "What is the path of the route?"
|
|
30
|
+
"x-prompt": "What is the path of the route? (e.g. 'foo/bar')"
|
|
32
31
|
},
|
|
33
32
|
"style": {
|
|
34
33
|
"type": "string",
|