@nrwl/remix 1.0.0-alpha.4 → 1.0.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/remix",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.5",
4
4
  "main": "src/index.js",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -1,5 +1,4 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
3
2
  "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
4
3
  "compilerOptions": {
5
4
  "lib": ["DOM", "DOM.Iterable", "ES2019"],
@@ -1,3 +1,3 @@
1
- import { Tree } from '@nrwl/devkit';
1
+ import { GeneratorCallback, Tree } from '@nrwl/devkit';
2
2
  import { NxRemixGeneratorSchema } from './schema';
3
- export default function (tree: Tree, _options: NxRemixGeneratorSchema): Promise<import("@nrwl/devkit").GeneratorCallback>;
3
+ export default function (tree: Tree, _options: NxRemixGeneratorSchema): Promise<GeneratorCallback>;
@@ -4,24 +4,59 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const normalize_options_1 = require("./lib/normalize-options");
6
6
  const application_impl_1 = require("../application/application.impl");
7
+ const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
8
+ const child_process_1 = require("child_process");
7
9
  function default_1(tree, _options) {
8
10
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
9
11
  const options = (0, normalize_options_1.normalizeOptions)(tree, _options);
10
- const task = yield (0, application_impl_1.default)(tree, {
12
+ const tasks = [];
13
+ const pm = (0, devkit_1.detectPackageManager)();
14
+ const appGenTask = yield (0, application_impl_1.default)(tree, {
11
15
  name: options.projectName,
12
16
  tags: options.tags,
13
17
  skipFormat: true,
14
18
  });
19
+ tasks.push(appGenTask);
15
20
  // Enable yarn/npm/pnpm workspaces for buildable libs
16
- (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
17
- var _a;
18
- (_a = json.workspaces) !== null && _a !== void 0 ? _a : (json.workspaces = ['dist/libs/*']);
19
- return json;
20
- });
21
+ if (pm !== 'pnpm') {
22
+ (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
23
+ var _a;
24
+ (_a = json.workspaces) !== null && _a !== void 0 ? _a : (json.workspaces = ['dist/libs/*']);
25
+ return json;
26
+ });
27
+ }
28
+ else {
29
+ tree.write('pnpm-workspace.yaml', `packages:
30
+ - 'libs/*`);
31
+ }
32
+ // Ignore nested project files
33
+ const ignoreFile = tree.read('.gitignore').toString();
34
+ tree.write('.gitignore', `${ignoreFile
35
+ .replace('/dist', 'dist')
36
+ .replace('/node_modules', 'node_modules')}
37
+ // Remix files
38
+ apps/**/build
39
+ apps/**/.cache
40
+ `);
21
41
  // No need for workspace.json in latest Nx
22
42
  tree.delete('workspace.json');
23
43
  yield (0, devkit_1.formatFiles)(tree);
24
- return task;
44
+ tasks.push(() => {
45
+ let command;
46
+ if (pm === 'npm') {
47
+ command = `npm install -ws`;
48
+ }
49
+ else if (pm === 'yarn') {
50
+ command = `yarn`;
51
+ }
52
+ else if (pm === 'pnpm') {
53
+ command = `pnpm install`;
54
+ }
55
+ (0, child_process_1.execSync)(command, {
56
+ stdio: [0, 1, 2],
57
+ });
58
+ });
59
+ return (0, run_tasks_in_serial_1.runTasksInSerial)(...tasks);
25
60
  });
26
61
  }
27
62
  exports.default = default_1;
@@ -1 +1 @@
1
- {"version":3,"file":"preset.impl.js","sourceRoot":"","sources":["../../../../../../packages/nx-remix/src/generators/preset/preset.impl.ts"],"names":[],"mappings":";;;AAAA,yCAA6D;AAG7D,+DAA2D;AAC3D,sEAAmE;AAEnE,mBAA+B,IAAU,EAAE,QAAgC;;QACzE,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAEjD,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAoB,EAAC,IAAI,EAAE;YAC5C,IAAI,EAAE,OAAO,CAAC,WAAW;YACzB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,qDAAqD;QACrD,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;;YACxC,MAAA,IAAI,CAAC,UAAU,oCAAf,IAAI,CAAC,UAAU,GAAK,CAAC,aAAa,CAAC,EAAC;YACpC,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,0CAA0C;QAC1C,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAE9B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AArBD,4BAqBC"}
1
+ {"version":3,"file":"preset.impl.js","sourceRoot":"","sources":["../../../../../../packages/nx-remix/src/generators/preset/preset.impl.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AAGtB,+DAA2D;AAC3D,sEAAmE;AACnE,2FAAqF;AACrF,iDAAyC;AAEzC,mBAA+B,IAAU,EAAE,QAAgC;;QACzE,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,MAAM,EAAE,GAAG,IAAA,6BAAoB,GAAE,CAAC;QAElC,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAoB,EAAC,IAAI,EAAE;YAClD,IAAI,EAAE,OAAO,CAAC,WAAW;YACzB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEvB,qDAAqD;QACrD,IAAI,EAAE,KAAK,MAAM,EAAE;YACjB,IAAA,mBAAU,EAAC,IAAI,EA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