@o3r/create 10.0.0-next.9 → 10.0.0-prerelease.1
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 +1 -1
- package/index.js +25 -7
- 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
|
|
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 } =
|
|
8
|
-
const { version } =
|
|
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&
|
|
@@ -68,9 +69,14 @@ const logo = `
|
|
|
68
69
|
`;
|
|
69
70
|
const binPath = (0, node_path_1.join)(require.resolve('@angular/cli/package.json'), '../bin/ng.js');
|
|
70
71
|
const args = process.argv.slice(2).filter((a) => a !== '--create-application');
|
|
72
|
+
// Default styling to Sass
|
|
71
73
|
if (!args.some((a) => a.startsWith('--style'))) {
|
|
72
74
|
args.push('--style', 'scss');
|
|
73
75
|
}
|
|
76
|
+
// Default Preset to Basic
|
|
77
|
+
if (!args.some((a) => a.startsWith('--preset'))) {
|
|
78
|
+
args.push('--preset', 'basic');
|
|
79
|
+
}
|
|
74
80
|
const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'));
|
|
75
81
|
if (!hasPackageManagerArg) {
|
|
76
82
|
const packageManager = process.env.npm_config_user_agent?.split('/')[0];
|
|
@@ -95,12 +101,22 @@ const isNgNewOptions = (arg) => {
|
|
|
95
101
|
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
102
|
}
|
|
97
103
|
else if (arg.startsWith('-')) {
|
|
98
|
-
return entries.some(([
|
|
104
|
+
return entries.some(([, { alias }]) => alias && arg === `-${alias}`);
|
|
99
105
|
}
|
|
100
106
|
return true;
|
|
101
107
|
};
|
|
108
|
+
const schematicsCliOptions = Object.entries(argv)
|
|
109
|
+
.filter(([key]) => key !== '_')
|
|
110
|
+
.map(([key, value]) => value === true && [key] || value === false && key.length > 1 && [`no-${key}`] || [key, value])
|
|
111
|
+
.map(([key, value]) => {
|
|
112
|
+
const optionKey = key.length > 1 ? `--${key}` : `-${key}`;
|
|
113
|
+
return typeof value === 'undefined' ? [optionKey] : [optionKey, value];
|
|
114
|
+
});
|
|
102
115
|
const createNgProject = () => {
|
|
103
|
-
const
|
|
116
|
+
const options = schematicsCliOptions
|
|
117
|
+
.filter(([key]) => isNgNewOptions(key))
|
|
118
|
+
.flat();
|
|
119
|
+
const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'new', ...argv._, ...options, '--skip-install'], {
|
|
104
120
|
stdio: 'inherit'
|
|
105
121
|
});
|
|
106
122
|
if (error) {
|
|
@@ -109,9 +125,11 @@ const createNgProject = () => {
|
|
|
109
125
|
process.exit(1);
|
|
110
126
|
}
|
|
111
127
|
};
|
|
112
|
-
const
|
|
128
|
+
const addOtterFramework = (relativeDirectory = '.') => {
|
|
113
129
|
const cwd = (0, node_path_1.resolve)(process.cwd(), relativeDirectory);
|
|
114
|
-
const
|
|
130
|
+
const options = schematicsCliOptions
|
|
131
|
+
.flat();
|
|
132
|
+
const { error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, 'add', `@o3r/core@${version || 'latest'}`, ...options], {
|
|
115
133
|
stdio: 'inherit',
|
|
116
134
|
cwd
|
|
117
135
|
});
|
|
@@ -124,4 +142,4 @@ const addOtterCore = (relativeDirectory = '.') => {
|
|
|
124
142
|
const projectFolder = argv._[0]?.replaceAll(' ', '-').toLowerCase() || '.';
|
|
125
143
|
console.info(logo);
|
|
126
144
|
createNgProject();
|
|
127
|
-
|
|
145
|
+
addOtterFramework(projectFolder);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/create",
|
|
3
|
-
"version": "10.0.0-
|
|
3
|
+
"version": "10.0.0-prerelease.1",
|
|
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": "~
|
|
19
|
-
"@schematics/angular": "~
|
|
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": "~
|
|
24
|
-
"@angular-eslint/eslint-plugin-template": "~
|
|
25
|
-
"@nx/
|
|
26
|
-
"@nx/
|
|
27
|
-
"@nx/
|
|
28
|
-
"@
|
|
29
|
-
"@o3r/
|
|
30
|
-
"@o3r/eslint-config-otter": "^10.0.0-
|
|
31
|
-
"@o3r/eslint-plugin": "^10.0.0-
|
|
24
|
+
"@angular-eslint/eslint-plugin": "~17.2.0",
|
|
25
|
+
"@angular-eslint/eslint-plugin-template": "~17.2.0",
|
|
26
|
+
"@nx/eslint": "~17.2.0",
|
|
27
|
+
"@nx/eslint-plugin": "~17.2.0",
|
|
28
|
+
"@nx/jest": "~17.2.0",
|
|
29
|
+
"@nx/js": "~17.2.0",
|
|
30
|
+
"@o3r/build-helpers": "^10.0.0-prerelease.1",
|
|
31
|
+
"@o3r/eslint-config-otter": "^10.0.0-prerelease.1",
|
|
32
|
+
"@o3r/eslint-plugin": "^10.0.0-prerelease.1",
|
|
33
|
+
"@o3r/test-helpers": "^10.0.0-prerelease.1",
|
|
32
34
|
"@types/jest": "~29.5.2",
|
|
33
35
|
"@types/minimist": "^1.2.2",
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
36
|
-
"@typescript-eslint/parser": "^
|
|
37
|
-
"cpy-cli": "^
|
|
36
|
+
"@types/node": "^20.0.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^6.19.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.
|
|
41
|
-
"eslint-plugin-jsdoc": "~
|
|
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": "^
|
|
45
|
+
"eslint-plugin-unicorn": "^50.0.0",
|
|
44
46
|
"jest": "~29.7.0",
|
|
45
47
|
"jest-junit": "~16.0.0",
|
|
46
|
-
"
|
|
48
|
+
"jsonc-eslint-parser": "~2.4.0",
|
|
49
|
+
"nx": "~17.2.0",
|
|
47
50
|
"rimraf": "^5.0.1",
|
|
48
51
|
"rxjs": "^7.8.1",
|
|
49
52
|
"ts-jest": "~29.1.1",
|
|
50
|
-
"type-fest": "^3.
|
|
51
|
-
"typescript": "~5.
|
|
53
|
+
"type-fest": "^4.3.1",
|
|
54
|
+
"typescript": "~5.2.2"
|
|
52
55
|
},
|
|
53
56
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
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
|
}
|