@dsivd/prestations-ng 19.2.0-beta.20 → 19.2.0-beta.22
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/ANGULAR_SIGNALS.md +4 -0
- package/CHANGELOG.md +113 -3
- package/CONTRIBUTING.md +2 -2
- package/ESLINT_PLUGIN.md +146 -28
- package/GOOD_PRACTICES.md +258 -58
- package/INTRODUCTION_ANGULAR_SIGNALS.md +29 -2
- package/UPGRADING_V19.md +233 -31
- package/eslint/configs/template-rules.mjs +5 -0
- package/eslint/configs/ts-recommended.mjs +4 -0
- package/eslint/form-reads.mjs +63 -0
- package/eslint/rules/index.mjs +4 -0
- package/eslint/rules/no-direct-signal-mutation.mjs +57 -19
- package/eslint/rules/no-item-track-in-form-list.mjs +172 -0
- package/eslint/rules/no-uninvoked-signal-in-template.mjs +8 -3
- package/eslint/rules/require-model-change.mjs +89 -0
- package/eslint/template-ast.mjs +12 -2
- package/fesm2022/dsivd-prestations-ng.mjs +948 -692
- package/fesm2022/dsivd-prestations-ng.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/migration-collection.json +5 -0
- package/schematics/ng-update/migrations/update-19_2_0/index.js +39 -0
- package/schematics/utility/form-signal/class-migration.js +671 -0
- package/schematics/utility/form-signal/edits.js +34 -0
- package/schematics/utility/form-signal/form-signal-migration.js +184 -0
- package/schematics/utility/form-signal/page-classes.js +129 -0
- package/schematics/utility/form-signal/template-migration.js +666 -0
- package/src/eslint/configs/template-rules.mjs +5 -0
- package/src/eslint/configs/ts-recommended.mjs +4 -0
- package/src/eslint/form-reads.mjs +63 -0
- package/src/eslint/rules/__tests__/no-direct-signal-mutation.test.mjs +58 -0
- package/src/eslint/rules/__tests__/no-item-track-in-form-list.test.mjs +234 -0
- package/src/eslint/rules/__tests__/no-uninvoked-signal-in-template.test.mjs +6 -0
- package/src/eslint/rules/__tests__/require-model-change.test.mjs +93 -0
- package/src/eslint/rules/index.mjs +4 -0
- package/src/eslint/rules/no-direct-signal-mutation.mjs +57 -19
- package/src/eslint/rules/no-item-track-in-form-list.mjs +172 -0
- package/src/eslint/rules/no-uninvoked-signal-in-template.mjs +8 -3
- package/src/eslint/rules/require-model-change.mjs +89 -0
- package/src/eslint/template-ast.mjs +12 -2
- package/types/dsivd-prestations-ng.d.ts +266 -35
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"ng-update": {
|
|
40
40
|
"migrations": "./schematics/migration-collection.json"
|
|
41
41
|
},
|
|
42
|
-
"version": "19.2.0-beta.
|
|
42
|
+
"version": "19.2.0-beta.22",
|
|
43
43
|
"module": "fesm2022/dsivd-prestations-ng.mjs",
|
|
44
44
|
"typings": "types/dsivd-prestations-ng.d.ts",
|
|
45
45
|
"exports": {
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"version": "14.5.0",
|
|
21
21
|
"description": "Updates prestations-ng for Angular to v14.5.0",
|
|
22
22
|
"factory": "./ng-update/migrations/update-14_5_0"
|
|
23
|
+
},
|
|
24
|
+
"migration-v19_2_0": {
|
|
25
|
+
"version": "19.2.0",
|
|
26
|
+
"description": "The form and the reference of the pages are signals: their templates and classes read them through calls, and write the form with patchForm() and patchItem()",
|
|
27
|
+
"factory": "./ng-update/migrations/update-19_2_0"
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
+
const form_signal_migration_1 = require("../../../utility/form-signal/form-signal-migration");
|
|
14
|
+
const version = '19.2.0';
|
|
15
|
+
/**
|
|
16
|
+
* `@angular/compiler` is an ES module: imported, not required. A `Function` keeps TypeScript from turning the import
|
|
17
|
+
* into a `require()`.
|
|
18
|
+
*/
|
|
19
|
+
const loadCompiler = () => new Function('specifier', 'return import(specifier)')('@angular/compiler');
|
|
20
|
+
exports.default = () => (tree, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
// Let's make sure we're in an angular workspace
|
|
22
|
+
if (!tree.exists('angular.json')) {
|
|
23
|
+
throw new schematics_1.SchematicsException('This is not an Angular workspace. Try again in an Angular project.');
|
|
24
|
+
}
|
|
25
|
+
context.logger.info(`Applying migration for prestations-ng to version ${version}: the form and the reference of the pages are signals`);
|
|
26
|
+
const report = (0, form_signal_migration_1.migrateFormSignal)(tree, yield loadCompiler());
|
|
27
|
+
context.logger.info(`Migrated ${report.pages} pages and ${report.templates} templates: ${report.writes} writes of the form, ` +
|
|
28
|
+
`${report.tracks} lists tracked by $index, ${report.listPaths} getList() replaced by getListPath(), ` +
|
|
29
|
+
`${report.redeclarations} fields hiding a signal of the page removed.`);
|
|
30
|
+
if (report.warnings.length) {
|
|
31
|
+
context.logger.warn([
|
|
32
|
+
`To check by hand (${report.warnings.length}), see "The form of your pages is a signal" and ` +
|
|
33
|
+
`"\`reference\` of your pages is a signal" in UPGRADING_V19.md:`,
|
|
34
|
+
...report.warnings.map((warning) => ` ${warning}`),
|
|
35
|
+
].join('\n'));
|
|
36
|
+
}
|
|
37
|
+
return tree;
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5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