@o3r/create 10.0.0-next.0 → 10.0.0-next.10

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.
Files changed (2) hide show
  1. package/index.js +17 -2
  2. package/package.json +13 -12
package/index.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const node_child_process_1 = require("node:child_process");
5
5
  const node_path_1 = require("node:path");
6
6
  const minimist = require("minimist");
7
+ const { properties } = require(require.resolve('@schematics/angular/ng-new/schema').replace(/\.js$/, '.json'));
7
8
  const { version } = require((0, node_path_1.resolve)(__dirname, 'package.json'));
8
9
  const logo = `
9
10
 
@@ -84,8 +85,22 @@ if (argv._.length === 0) {
84
85
  console.error('The project name is mandatory');
85
86
  process.exit(-1);
86
87
  }
88
+ /**
89
+ * Determine if the argument is part of the Angular ng new declared option
90
+ * @param arg CLI argument
91
+ */
92
+ const isNgNewOptions = (arg) => {
93
+ const entries = Object.entries(properties);
94
+ if (arg.startsWith('--')) {
95
+ return entries.some(([key]) => [`--${key}`, `--no-${key}`, `--${key.replaceAll(/([A-Z])/g, '-$1').toLowerCase()}`, `--no-${key.replaceAll(/([A-Z])/g, '-$1').toLowerCase()}`].includes(arg));
96
+ }
97
+ else if (arg.startsWith('-')) {
98
+ return entries.some(([_, { alias }]) => alias && arg === `-${alias}`);
99
+ }
100
+ return true;
101
+ };
87
102
  const createNgProject = () => {
88
- const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...args], {
103
+ const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...args.filter(isNgNewOptions)], {
89
104
  stdio: 'inherit'
90
105
  });
91
106
  if (error) {
@@ -96,7 +111,7 @@ const createNgProject = () => {
96
111
  };
97
112
  const addOtterCore = (relativeDirectory = '.') => {
98
113
  const cwd = (0, node_path_1.resolve)(process.cwd(), relativeDirectory);
99
- const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'add', `@o3r/core@${version || 'latest'}`], {
114
+ const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'add', `@o3r/core@${version || 'latest'}`, ...args.filter((arg) => arg.startsWith('-'))], {
100
115
  stdio: 'inherit',
101
116
  cwd
102
117
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/create",
3
- "version": "10.0.0-next.0",
3
+ "version": "10.0.0-next.10",
4
4
  "description": "Create a new Otter based application",
5
5
  "keywords": [
6
6
  "create",
@@ -15,19 +15,20 @@
15
15
  "prepare:publish": "prepare-publish ./dist"
16
16
  },
17
17
  "dependencies": {
18
- "@angular/cli": "~16.1.6",
18
+ "@angular/cli": "~16.2.0",
19
+ "@schematics/angular": "~16.2.0",
19
20
  "minimist": "^1.2.6"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@angular-eslint/eslint-plugin": "~16.1.0",
23
24
  "@angular-eslint/eslint-plugin-template": "~16.1.0",
24
- "@nx/jest": "~16.6.0",
25
- "@nx/js": "~16.6.0",
26
- "@nx/linter": "~16.6.0",
27
- "@o3r/build-helpers": "^10.0.0-next.0",
28
- "@o3r/dev-tools": "^10.0.0-next.0",
29
- "@o3r/eslint-config-otter": "^10.0.0-next.0",
30
- "@o3r/eslint-plugin": "^10.0.0-next.0",
25
+ "@nx/jest": "~16.8.0",
26
+ "@nx/js": "~16.8.0",
27
+ "@nx/linter": "~16.8.0",
28
+ "@o3r/build-helpers": "^10.0.0-next.10",
29
+ "@o3r/dev-tools": "^10.0.0-next.10",
30
+ "@o3r/eslint-config-otter": "^10.0.0-next.10",
31
+ "@o3r/eslint-plugin": "^10.0.0-next.10",
31
32
  "@types/jest": "~29.5.2",
32
33
  "@types/minimist": "^1.2.2",
33
34
  "@types/node": "^18.0.0",
@@ -37,12 +38,12 @@
37
38
  "eslint": "^8.42.0",
38
39
  "eslint-import-resolver-node": "^0.3.4",
39
40
  "eslint-plugin-jest": "~27.2.3",
40
- "eslint-plugin-jsdoc": "~46.4.5",
41
+ "eslint-plugin-jsdoc": "~46.8.0",
41
42
  "eslint-plugin-prefer-arrow": "~1.2.3",
42
43
  "eslint-plugin-unicorn": "^47.0.0",
43
- "jest": "~29.6.2",
44
+ "jest": "~29.7.0",
44
45
  "jest-junit": "~16.0.0",
45
- "nx": "~16.6.0",
46
+ "nx": "~16.8.0",
46
47
  "rimraf": "^5.0.1",
47
48
  "rxjs": "^7.8.1",
48
49
  "ts-jest": "~29.1.1",