@nrwl/remix 1.0.0-beta.4 → 1.0.0-beta.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/generators.json CHANGED
@@ -5,35 +5,40 @@
5
5
  "extends": ["@nrwl/react"],
6
6
  "generators": {
7
7
  "preset": {
8
- "factory": "./src/generators/preset/preset.impl",
8
+ "implementation": "./src/generators/preset/preset.impl",
9
9
  "schema": "./src/generators/preset/schema.json",
10
10
  "description": "Generate a new Remix workspace",
11
11
  "hidden": true
12
12
  },
13
13
  "setup": {
14
- "factory": "./src/generators/setup/setup.impl",
14
+ "implementation": "./src/generators/setup/setup.impl",
15
15
  "schema": "./src/generators/setup/schema.json",
16
16
  "description": "Setup a Remix in an existing workspace",
17
17
  "hidden": true
18
18
  },
19
19
  "application": {
20
- "factory": "./src/generators/application/application.impl",
20
+ "implementation": "./src/generators/application/application.impl",
21
21
  "schema": "./src/generators/application/schema.json",
22
22
  "description": "Generate a new Remix application",
23
23
  "aliases": ["app"],
24
24
  "x-type": "application"
25
25
  },
26
26
  "library": {
27
- "factory": "./src/generators/library/library.impl",
27
+ "implementation": "./src/generators/library/library.impl",
28
28
  "schema": "./src/generators/library/schema.json",
29
29
  "description": "Generate a new library",
30
30
  "aliases": ["lib"],
31
31
  "x-type": "library"
32
32
  },
33
33
  "route": {
34
- "factory": "./src/generators/route/route.impl",
34
+ "implementation": "./src/generators/route/route.impl",
35
35
  "schema": "./src/generators/route/schema.json",
36
36
  "description": "Generate a new route"
37
+ },
38
+ "cypress": {
39
+ "implementation": "./src/generators/cypress/cypress.impl",
40
+ "schema": "./src/generators/cypress/schema.json",
41
+ "description": "Generate a project for testing Remix apps using Cypress"
37
42
  }
38
43
  }
39
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/remix",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "main": "src/index.js",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -4,10 +4,10 @@
4
4
  "description": "",
5
5
  "license": "",
6
6
  "scripts": {
7
- "build": "remix build",
8
- "dev": "remix dev",
9
- "postinstall": "remix setup node",
10
- "start": "remix-serve build"
7
+ "build": "npx remix build",
8
+ "dev": "npx remix dev",
9
+ "postinstall": "npx remix setup node",
10
+ "start": "npx remix-serve build"
11
11
  },
12
12
  "dependencies": {
13
13
  "@remix-run/react": "^1.0.6",
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nrwl/devkit';
2
+ export default function (tree: Tree, options: any): Promise<() => void>;
@@ -0,0 +1,23 @@
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 cypress_1 = require("@nrwl/cypress");
6
+ function default_1(tree, options) {
7
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
8
+ const res = (0, cypress_1.cypressProjectGenerator)(tree, Object.assign(Object.assign({}, options), { standaloneConfig: true }));
9
+ const config = (0, devkit_1.readProjectConfiguration)(tree, `${options.name}-e2e`);
10
+ tree.delete((0, devkit_1.joinPathFragments)(config.sourceRoot, "support", "app.po.ts"));
11
+ tree.write((0, devkit_1.joinPathFragments)(config.sourceRoot, "integration", "app.spec.ts"), `describe('webapp', () => {
12
+ beforeEach(() => cy.visit('/'));
13
+
14
+ it('should display welcome message', () => {
15
+ cy.get('h2').contains('Welcome to Remix!');
16
+ });
17
+ });`);
18
+ // returning this in case the cypress generator has any side effects
19
+ return res;
20
+ });
21
+ }
22
+ exports.default = default_1;
23
+ //# sourceMappingURL=cypress.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cypress.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/cypress/cypress.impl.ts"],"names":[],"mappings":";;;AAAA,yCAAgF;AAEhF,2CAAqD;AAErD,mBACE,IAAU,EACV,OAAY;;QAEZ,MAAM,GAAG,GAAG,IAAA,iCAAuB,EAAC,IAAI,kCAAM,OAAO,KAAE,gBAAgB,EAAE,IAAI,IAAE,CAAA;QAC/E,MAAM,MAAM,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,MAAM,CAAC,CAAA;QACpE,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,KAAK,CAAC,IAAA,0BAAiB,EAAC,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE;;;;;;IAM7E,CAAC,CAAA;QACH,oEAAoE;QACpE,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAhBD,4BAgBC"}
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxRemixCypress",
5
+ "title": "",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The name of the frontend project to test.",
11
+ "$default": {
12
+ "$source": "projectName"
13
+ }
14
+ },
15
+ "baseUrl": {
16
+ "type": "string",
17
+ "description": "URL to access the application on",
18
+ "default": "http://localhost:3000"
19
+ },
20
+ "name": {
21
+ "type": "string",
22
+ "description": "Name of the E2E Project",
23
+ "$default": {
24
+ "$source": "argv",
25
+ "index": 0
26
+ },
27
+ "x-prompt": "What name would you like to use for the e2e project?"
28
+ },
29
+ "directory": {
30
+ "type": "string",
31
+ "description": "A directory where the project is placed"
32
+ },
33
+ "linter": {
34
+ "description": "The tool to use for running lint checks.",
35
+ "type": "string",
36
+ "enum": ["eslint", "none"],
37
+ "default": "eslint"
38
+ },
39
+ "js": {
40
+ "description": "Generate JavaScript files rather than TypeScript files",
41
+ "type": "boolean",
42
+ "default": false
43
+ },
44
+ "skipFormat": {
45
+ "description": "Skip formatting files",
46
+ "type": "boolean",
47
+ "default": false
48
+ },
49
+ "setParserOptionsProject": {
50
+ "type": "boolean",
51
+ "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.",
52
+ "default": false
53
+ }
54
+ },
55
+ "required": ["name"]
56
+ }
@@ -7,9 +7,10 @@ function default_1(tree, options) {
7
7
  const { fileName: routePath, className: componentName } = (0, devkit_1.names)(options.path.replace(/^\//, '').replace(/\/$/, ''));
8
8
  const projects = (0, devkit_1.getProjects)(tree);
9
9
  const project = projects.get(options.project);
10
+ const normalizedRoutePath = normalizeRoutePath(routePath, project.root);
10
11
  if (!project)
11
12
  throw new Error(`Project does not exist: ${options.project}`);
12
- const componentPath = (0, devkit_1.joinPathFragments)(project.root, 'app/routes', `${routePath}.tsx`);
13
+ const componentPath = (0, devkit_1.joinPathFragments)(project.root, 'app/routes', `${normalizedRoutePath}.tsx`);
13
14
  if (tree.exists(componentPath))
14
15
  throw new Error(`Path already exists: ${options.path}`);
15
16
  tree.write(componentPath, (0, devkit_1.stripIndents) `
@@ -21,7 +22,7 @@ function default_1(tree, options) {
21
22
  import { useActionData, useLoaderData, redirect } from 'remix';
22
23
 
23
24
  ${options.style === 'css'
24
- ? `import stylesUrl from '~/styles/${routePath}.css';`
25
+ ? `import stylesUrl from '~/styles/${normalizedRoutePath}.css';`
25
26
  : ''}
26
27
 
27
28
 
@@ -59,7 +60,7 @@ function default_1(tree, options) {
59
60
  }
60
61
  `);
61
62
  if (options.style === 'css') {
62
- const stylesheetPath = (0, devkit_1.joinPathFragments)(project.root, 'app/styles', `${routePath}.css`);
63
+ const stylesheetPath = (0, devkit_1.joinPathFragments)(project.root, 'app/styles', `${normalizedRoutePath}.css`);
63
64
  tree.write(stylesheetPath, (0, devkit_1.stripIndents) `
64
65
  :root {
65
66
  --color-foreground: #fff;
@@ -75,4 +76,11 @@ function default_1(tree, options) {
75
76
  });
76
77
  }
77
78
  exports.default = default_1;
79
+ function normalizeRoutePath(path, projectRoot) {
80
+ if (path.indexOf(projectRoot) === -1)
81
+ return path;
82
+ if (path.indexOf('/routes/') > -1)
83
+ return path.substring(path.indexOf('/routes/') + 8);
84
+ return path.substring(projectRoot.length + 1);
85
+ }
78
86
  //# sourceMappingURL=route.impl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/route/route.impl.ts"],"names":[],"mappings":";;;AAAA,yCAOsB;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,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACnD,CAAC;QACF,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAE5E,MAAM,aAAa,GAAG,IAAA,0BAAiB,EACrC,OAAO,CAAC,IAAI,EACZ,YAAY,EACZ,GAAG,SAAS,MAAM,CACnB,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,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;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAhGD,4BAgGC"}
1
+ {"version":3,"file":"route.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/route/route.impl.ts"],"names":[],"mappings":";;;AAAA,yCAOsB;AAGtB,mBAA+B,IAAU,EAAE,OAAyB;;QAClE,MAAM,EAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAC,GAAG,IAAA,cAAK,EAC3D,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACnD,CAAC;QAGF,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9C,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;QAEvE,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAE5E,MAAM,aAAa,GAAG,IAAA,0BAAiB,EACrC,OAAO,CAAC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