@o3r/create 10.0.0-next.9 → 11.0.0-next.0

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +20 -7
  3. package/package.json +29 -25
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <h1 align="center">Otter project initializer</h1>
2
2
  <p align="center">
3
- <img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/.attachments/otter.png" alt="Super cute Otter!" width="40%"/>
3
+ <img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
4
4
  </p>
5
5
 
6
6
  ## Create an Otter application
package/index.js CHANGED
@@ -3,9 +3,10 @@
3
3
  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
+ const node_fs_1 = require("node:fs");
6
7
  const minimist = require("minimist");
7
- const { properties } = require(require.resolve('@schematics/angular/ng-new/schema').replace(/\.js$/, '.json'));
8
- const { version } = require((0, node_path_1.resolve)(__dirname, 'package.json'));
8
+ const { properties } = JSON.parse((0, node_fs_1.readFileSync)(require.resolve('@schematics/angular/ng-new/schema').replace(/\.js$/, '.json'), { encoding: 'utf-8' }));
9
+ const { version } = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.resolve)(__dirname, 'package.json'), { encoding: 'utf-8' }));
9
10
  const logo = `
10
11
 
11
12
  &BPPPB & &BPGB&
@@ -95,12 +96,22 @@ const isNgNewOptions = (arg) => {
95
96
  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
  }
97
98
  else if (arg.startsWith('-')) {
98
- return entries.some(([_, { alias }]) => alias && arg === `-${alias}`);
99
+ return entries.some(([, { alias }]) => alias && arg === `-${alias}`);
99
100
  }
100
101
  return true;
101
102
  };
103
+ const schematicsCliOptions = Object.entries(argv)
104
+ .filter(([key]) => key !== '_')
105
+ .map(([key, value]) => value === true && [key] || value === false && key.length > 1 && [`no-${key}`] || [key, value])
106
+ .map(([key, value]) => {
107
+ const optionKey = key.length > 1 ? `--${key}` : `-${key}`;
108
+ return typeof value === 'undefined' ? [optionKey] : [optionKey, value];
109
+ });
102
110
  const createNgProject = () => {
103
- const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...args.filter(isNgNewOptions)], {
111
+ const options = schematicsCliOptions
112
+ .filter(([key]) => isNgNewOptions(key))
113
+ .flat();
114
+ const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...argv._, ...options, '--skip-install'], {
104
115
  stdio: 'inherit'
105
116
  });
106
117
  if (error) {
@@ -109,9 +120,11 @@ const createNgProject = () => {
109
120
  process.exit(1);
110
121
  }
111
122
  };
112
- const addOtterCore = (relativeDirectory = '.') => {
123
+ const addOtterFramework = (relativeDirectory = '.') => {
113
124
  const cwd = (0, node_path_1.resolve)(process.cwd(), relativeDirectory);
114
- const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'add', `@o3r/core@${version || 'latest'}`, ...args.filter((arg) => arg.startsWith('-'))], {
125
+ const options = schematicsCliOptions
126
+ .flat();
127
+ const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'add', `@o3r/core@${version || 'latest'}`, ...options], {
115
128
  stdio: 'inherit',
116
129
  cwd
117
130
  });
@@ -124,4 +137,4 @@ const addOtterCore = (relativeDirectory = '.') => {
124
137
  const projectFolder = argv._[0]?.replaceAll(' ', '-').toLowerCase() || '.';
125
138
  console.info(logo);
126
139
  createNgProject();
127
- addOtterCore(projectFolder);
140
+ addOtterFramework(projectFolder);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/create",
3
- "version": "10.0.0-next.9",
3
+ "version": "11.0.0-next.0",
4
4
  "description": "Create a new Otter based application",
5
5
  "keywords": [
6
6
  "create",
@@ -15,43 +15,46 @@
15
15
  "prepare:publish": "prepare-publish ./dist"
16
16
  },
17
17
  "dependencies": {
18
- "@angular/cli": "~16.2.0",
19
- "@schematics/angular": "~16.2.0",
20
- "minimist": "^1.2.6"
18
+ "@angular/cli": "~17.0.3",
19
+ "@schematics/angular": "~17.0.3",
20
+ "minimist": "^1.2.6",
21
+ "tslib": "^2.5.3"
21
22
  },
22
23
  "devDependencies": {
23
- "@angular-eslint/eslint-plugin": "~16.1.0",
24
- "@angular-eslint/eslint-plugin-template": "~16.1.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.9",
29
- "@o3r/dev-tools": "^10.0.0-next.9",
30
- "@o3r/eslint-config-otter": "^10.0.0-next.9",
31
- "@o3r/eslint-plugin": "^10.0.0-next.9",
24
+ "@angular-eslint/eslint-plugin": "~17.1.0",
25
+ "@angular-eslint/eslint-plugin-template": "~17.1.0",
26
+ "@nx/eslint": "~17.1.1",
27
+ "@nx/eslint-plugin": "~17.1.1",
28
+ "@nx/jest": "~17.1.1",
29
+ "@nx/js": "~17.1.1",
30
+ "@o3r/build-helpers": "^11.0.0-next.0",
31
+ "@o3r/eslint-config-otter": "^11.0.0-next.0",
32
+ "@o3r/eslint-plugin": "^11.0.0-next.0",
33
+ "@o3r/test-helpers": "^11.0.0-next.0",
32
34
  "@types/jest": "~29.5.2",
33
35
  "@types/minimist": "^1.2.2",
34
- "@types/node": "^18.0.0",
35
- "@typescript-eslint/eslint-plugin": "^5.59.9",
36
- "@typescript-eslint/parser": "^5.59.9",
37
- "cpy-cli": "^4.2.0",
36
+ "@types/node": "^20.0.0",
37
+ "@typescript-eslint/eslint-plugin": "6.11.0",
38
+ "@typescript-eslint/parser": "^6.11.0",
39
+ "cpy-cli": "^5.0.0",
38
40
  "eslint": "^8.42.0",
39
41
  "eslint-import-resolver-node": "^0.3.4",
40
- "eslint-plugin-jest": "~27.2.3",
41
- "eslint-plugin-jsdoc": "~46.8.0",
42
+ "eslint-plugin-jest": "~27.6.0",
43
+ "eslint-plugin-jsdoc": "~48.0.0",
42
44
  "eslint-plugin-prefer-arrow": "~1.2.3",
43
- "eslint-plugin-unicorn": "^47.0.0",
45
+ "eslint-plugin-unicorn": "^50.0.0",
44
46
  "jest": "~29.7.0",
45
47
  "jest-junit": "~16.0.0",
46
- "nx": "~16.8.0",
48
+ "jsonc-eslint-parser": "~2.4.0",
49
+ "nx": "~17.1.1",
47
50
  "rimraf": "^5.0.1",
48
51
  "rxjs": "^7.8.1",
49
52
  "ts-jest": "~29.1.1",
50
- "type-fest": "^3.12.0",
51
- "typescript": "~5.1.6"
53
+ "type-fest": "^4.3.1",
54
+ "typescript": "~5.2.2"
52
55
  },
53
56
  "engines": {
54
- "node": ">=14.0.0"
57
+ "node": ">=18.0.0"
55
58
  },
56
59
  "contributors": [
57
60
  {
@@ -116,5 +119,6 @@
116
119
  ],
117
120
  "bugs": "https://github.com/AmadeusITGroup/otter/issues",
118
121
  "repository": "https://github.com/AmadeusITGroup/otter",
119
- "license": "BSD-3-Clause"
122
+ "license": "BSD-3-Clause",
123
+ "homepage": "https://amadeusitgroup.github.io/otter/"
120
124
  }