@o3r/core 11.5.0-prerelease.9 → 11.6.0-prerelease.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.
- package/README.md +7 -4
- package/package.json +8 -4
- package/schematics/scripts/exported-actions.d.ts +0 -2
- package/schematics/scripts/exported-actions.d.ts.map +0 -1
- package/schematics/scripts/exported-actions.js +0 -25
- package/schematics/scripts/sub-entry-imports.d.ts +0 -2
- package/schematics/scripts/sub-entry-imports.d.ts.map +0 -1
- package/schematics/scripts/sub-entry-imports.js +0 -55
package/README.md
CHANGED
|
@@ -32,18 +32,21 @@ during the installation of the `@o3r/core`.
|
|
|
32
32
|
npm install --global yarn
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
### Creating a new Otter
|
|
35
|
+
### Creating a new Otter project
|
|
36
36
|
|
|
37
37
|
```shell
|
|
38
|
-
# Create new application
|
|
39
38
|
npm create @o3r my-project
|
|
40
|
-
# Or
|
|
41
|
-
|
|
39
|
+
# Or a project using the yarn package manager
|
|
40
|
+
npm create @o3r my-project -- --package-manager=yarn
|
|
42
41
|
```
|
|
43
42
|
|
|
44
43
|
> [!TIP]
|
|
45
44
|
> Get more details on [@o3r/create](https://www.npmjs.com/package/@o3r/create).
|
|
46
45
|
|
|
46
|
+
> [!NOTE]
|
|
47
|
+
> If you want to add o3r to an existing project, you will first need to install @o3r/schematics via
|
|
48
|
+
> `ng add @o3r/schematics` and then `ng add @o3r/core`.
|
|
49
|
+
|
|
47
50
|
### Adding Material design theming
|
|
48
51
|
|
|
49
52
|
```shell
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/core",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.0-prerelease.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
"@ngrx/entity": "~18.0.0",
|
|
26
26
|
"@ngrx/store": "~18.0.0",
|
|
27
27
|
"@nx/angular": "~19.5.0",
|
|
28
|
-
"@o3r/telemetry": "^11.
|
|
28
|
+
"@o3r/telemetry": "^11.6.0-prerelease.0",
|
|
29
29
|
"@schematics/angular": "~18.2.0",
|
|
30
30
|
"chokidar": "^3.5.2",
|
|
31
31
|
"globby": "^11.1.0",
|
|
32
32
|
"rxjs": "^7.8.1",
|
|
33
|
+
"type-fest": "^4.10.2",
|
|
33
34
|
"typescript": "~5.5.4"
|
|
34
35
|
},
|
|
35
36
|
"peerDependenciesMeta": {
|
|
@@ -56,10 +57,13 @@
|
|
|
56
57
|
},
|
|
57
58
|
"globby": {
|
|
58
59
|
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"type-fest": {
|
|
62
|
+
"optional": true
|
|
59
63
|
}
|
|
60
64
|
},
|
|
61
65
|
"dependencies": {
|
|
62
|
-
"@o3r/schematics": "^11.
|
|
66
|
+
"@o3r/schematics": "^11.6.0-prerelease.0",
|
|
63
67
|
"tslib": "^2.6.2",
|
|
64
68
|
"uuid": "^10.0.0"
|
|
65
69
|
},
|
|
@@ -69,7 +73,7 @@
|
|
|
69
73
|
"@ngrx/router-store": "~18.0.0",
|
|
70
74
|
"@ngrx/effects": "~18.0.0",
|
|
71
75
|
"@ngrx/store-devtools": "~18.0.0",
|
|
72
|
-
"@o3r/store-sync": "^11.
|
|
76
|
+
"@o3r/store-sync": "^11.6.0-prerelease.0",
|
|
73
77
|
"@types/jest": "~29.5.2",
|
|
74
78
|
"nx": "~19.5.0",
|
|
75
79
|
"@typescript-eslint/parser": "^7.14.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exported-actions.d.ts","sourceRoot":"","sources":["../../../schematics/scripts/exported-actions.ts"],"names":[],"mappings":""}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schematics_1 = require("@o3r/schematics");
|
|
4
|
-
const ts = require("typescript");
|
|
5
|
-
const fs = require("node:fs");
|
|
6
|
-
const globby_1 = require("globby");
|
|
7
|
-
const path = require("node:path");
|
|
8
|
-
const moduleName = 'store';
|
|
9
|
-
const moduleFolderPath = path.resolve(__dirname, '..', '..', '..', '..', '..', 'packages', '@o3r', moduleName, 'src');
|
|
10
|
-
const outputJsonPath = path.resolve(__dirname, 'exported-actions-v3.json');
|
|
11
|
-
const actionFiles = (0, globby_1.sync)(path.posix.join(moduleFolderPath, '**', '*.actions.ts').replace(/\\/g, '/'));
|
|
12
|
-
const actionsProgram = ts.createProgram(actionFiles, {});
|
|
13
|
-
const exportedActions = actionFiles.reduce((acc, actionFile) => {
|
|
14
|
-
// Because v3 actions were classes, we retrieve all the classes exported by the Actions files
|
|
15
|
-
(0, schematics_1.getExportedSymbolsFromFile)(actionsProgram, actionFile)
|
|
16
|
-
// eslint-disable-next-line no-bitwise
|
|
17
|
-
.filter((symbol) => symbol.flags & ts.SymbolFlags.Class)
|
|
18
|
-
.forEach((symbol) => {
|
|
19
|
-
// And pre-populate the migrated name which in 80% of the case will be a lowerCamelCase version of the classname
|
|
20
|
-
acc[symbol.name] = symbol.name.charAt(0).toLowerCase() + symbol.name.slice(1);
|
|
21
|
-
});
|
|
22
|
-
return acc;
|
|
23
|
-
}, {});
|
|
24
|
-
fs.writeFileSync(outputJsonPath, JSON.stringify(exportedActions, null, 2));
|
|
25
|
-
//# sourceMappingURL=exported-actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sub-entry-imports.d.ts","sourceRoot":"","sources":["../../../schematics/scripts/sub-entry-imports.ts"],"names":[],"mappings":""}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schematics_1 = require("@o3r/schematics");
|
|
4
|
-
const ts = require("typescript");
|
|
5
|
-
const fs = require("node:fs");
|
|
6
|
-
const minimist = require("minimist");
|
|
7
|
-
const path = require("node:path");
|
|
8
|
-
const argv = minimist(process.argv.slice(2));
|
|
9
|
-
const moduleName = argv._[0];
|
|
10
|
-
const moduleFolderPath = path.resolve(__dirname, '..', '..', '..', '..', '..', 'packages', '@o3r', moduleName, 'src');
|
|
11
|
-
const outputJsonPath = path.resolve(__dirname, `${moduleName}-mapping.json`);
|
|
12
|
-
// Build a list of the index files of every sub-entry
|
|
13
|
-
const subEntries = fs.readdirSync(moduleFolderPath, { withFileTypes: true })
|
|
14
|
-
.filter(dirent => dirent.isDirectory())
|
|
15
|
-
.map(dirent => ({
|
|
16
|
-
indexFile: path.join(moduleFolderPath, dirent.name, 'index.ts').replace(/\\/g, '/'),
|
|
17
|
-
name: dirent.name
|
|
18
|
-
}));
|
|
19
|
-
// Build a list of the fixture.ts file of every sub-entry (today only applicable to services)
|
|
20
|
-
const fixtureFiles = fs.readdirSync(moduleFolderPath, { withFileTypes: true })
|
|
21
|
-
.filter(dirent => dirent.isDirectory())
|
|
22
|
-
.map(dirent => ({
|
|
23
|
-
indexFile: path.join(moduleFolderPath, dirent.name, 'fixtures.ts').replace(/\\/g, '/'),
|
|
24
|
-
name: dirent.name
|
|
25
|
-
}))
|
|
26
|
-
.filter((fixture) => fs.existsSync(fixture.indexFile));
|
|
27
|
-
const subEntriesProgram = ts.createProgram(subEntries.map((subEntry) => subEntry.indexFile), {});
|
|
28
|
-
// Build an association between a sub-entry name and all the symbols exported by its index file
|
|
29
|
-
const mapping = subEntries.reduce((acc, subEntry) => {
|
|
30
|
-
const exports = (0, schematics_1.getExportedSymbolsFromFile)(subEntriesProgram, subEntry.indexFile)
|
|
31
|
-
.map((symbol) => symbol.name);
|
|
32
|
-
exports.forEach((exportedMember) => {
|
|
33
|
-
if (!acc[subEntry.name]) {
|
|
34
|
-
acc[subEntry.name] = [];
|
|
35
|
-
}
|
|
36
|
-
acc[subEntry.name].push(exportedMember);
|
|
37
|
-
});
|
|
38
|
-
return acc;
|
|
39
|
-
}, {});
|
|
40
|
-
// If working with fixtures, build a separate list of all the symbols exported by fixtures files
|
|
41
|
-
if (fixtureFiles.length > 0) {
|
|
42
|
-
const fixturesProgram = ts.createProgram(fixtureFiles.map((fixture) => fixture.indexFile), {});
|
|
43
|
-
const availableFixtures = [];
|
|
44
|
-
fixtureFiles.forEach((fixture) => {
|
|
45
|
-
const exports = (0, schematics_1.getExportedSymbolsFromFile)(fixturesProgram, fixture.indexFile)
|
|
46
|
-
.map((symbol) => symbol.name);
|
|
47
|
-
availableFixtures.push(...exports);
|
|
48
|
-
});
|
|
49
|
-
if (availableFixtures.length > 0) {
|
|
50
|
-
mapping['fixtures/fixtures'] = availableFixtures;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const content = { [moduleName]: mapping };
|
|
54
|
-
fs.writeFileSync(outputJsonPath, JSON.stringify(content, null, 2));
|
|
55
|
-
//# sourceMappingURL=sub-entry-imports.js.map
|