@eui/core 22.0.0-alpha.64 → 22.0.0-alpha.65
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/CHANGELOG.md +9 -0
- package/docs/changelog.html +14 -0
- package/docs/interfaces/MigrateEclSchema.html +413 -0
- package/docs/js/menu-wc.js +3 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +1450 -1328
- package/docs/llms.txt +12 -1
- package/docs/miscellaneous/functions.html +83 -0
- package/docs/overview.html +1 -1
- package/docs/properties.html +1 -1
- package/package.json +2 -2
- package/schematics/collection.json +6 -0
- package/schematics/migrate/index.js +2 -2
- package/schematics/migrate-ecl/index.d.ts +24 -0
- package/schematics/migrate-ecl/index.js +43 -0
- package/schematics/migrate-ecl/index.js.map +1 -0
- package/schematics/migrate-ecl/schema.json +25 -0
- package/schematics/migrate-eui-datepicker/index.d.ts +18 -0
- package/schematics/migrate-eui-datepicker/index.js +101 -0
- package/schematics/migrate-eui-datepicker/index.js.map +1 -0
- package/schematics/migrate-eui-datepicker/schema.json +19 -0
- package/schematics/migrate-eui-tooltip/schema.json +19 -0
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# eui documentation
|
|
2
2
|
|
|
3
|
-
> Generated by compodoc 2.0.0 at 2026-11-
|
|
3
|
+
> Generated by compodoc 2.0.0 at 2026-11-12T11:50:51.917Z, llm-md export.
|
|
4
4
|
|
|
5
5
|
## Modules
|
|
6
6
|
|
|
@@ -1123,6 +1123,15 @@ Properties:
|
|
|
1123
1123
|
- `path?: string`
|
|
1124
1124
|
- `useClassArray?: boolean`
|
|
1125
1125
|
|
|
1126
|
+
### MigrateEclSchema
|
|
1127
|
+
|
|
1128
|
+
File: `packages/core/schematics/migrate-ecl/index.ts`
|
|
1129
|
+
|
|
1130
|
+
Properties:
|
|
1131
|
+
- `dryRun?: boolean`
|
|
1132
|
+
- `path?: string`
|
|
1133
|
+
- `useClassArray?: boolean`
|
|
1134
|
+
|
|
1126
1135
|
### MigrateResult
|
|
1127
1136
|
|
|
1128
1137
|
File: `packages/core/schematics/migrate-to-signals/index.ts`
|
|
@@ -2120,6 +2129,8 @@ Properties:
|
|
|
2120
2129
|
Defined in `packages/core/schematics/migrate-all/index.ts`
|
|
2121
2130
|
- `migrateChipListElement(element: TmplAstElement, source: string, edits): void`
|
|
2122
2131
|
Defined in `packages/core/schematics/migrate-eui-chip-list/index.ts`
|
|
2132
|
+
- `migrateEcl(options: MigrateEclSchema): Rule` — Runs the full set of ECL (eUI-ECL) migration schematics needed to migrate an eUI-ECL application from v21 to v22, in the correct order: Per-component ECL selector / input / structural migrations (migrate-ecl-\*). migrate-ecl-removed-components — report-only warnings for members that require manual migration. migrate-to-signals — rewrites programmatic comp.prop accesses to comp.prop() for signal-migrated components (the engine is shared with eUI but covers ECL via its ECL signal map). add-eui-imports — adds the required EUI\_ECL\_\* imports to standalone components / declaring NgModules based on template selector usage. fix-no-multiple-empty-lines — cosmetic cleanup after the edits above. It deliberately excludes the eUI (Material) migrations ( migrate , migrate-eui-\* , migrate-to-standalone ), which do not apply to eUI-ECL apps.
|
|
2133
|
+
Defined in `packages/core/schematics/migrate-ecl/index.ts`
|
|
2123
2134
|
- `migrateEclBreadcrumb(options: Schema = {}): Rule`
|
|
2124
2135
|
Defined in `packages/core/schematics/migrate-ecl-breadcrumb/index.ts`
|
|
2125
2136
|
- `migrateEclFile(options: Schema = {}): Rule`
|
|
@@ -869,6 +869,9 @@
|
|
|
869
869
|
<li>
|
|
870
870
|
<a href="#migrateChipListElement" title="packages/core/schematics/migrate-eui-chip-list/index.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>migrateChipListElement</b> (packages/.../index.ts)</span></a>
|
|
871
871
|
</li>
|
|
872
|
+
<li>
|
|
873
|
+
<a href="#migrateEcl" title="packages/core/schematics/migrate-ecl/index.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>migrateEcl</b> (packages/.../index.ts)</span></a>
|
|
874
|
+
</li>
|
|
872
875
|
<li>
|
|
873
876
|
<a href="#migrateEclBreadcrumb" title="packages/core/schematics/migrate-ecl-breadcrumb/index.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>migrateEclBreadcrumb</b> (packages/.../index.ts)</span></a>
|
|
874
877
|
</li>
|
|
@@ -34878,6 +34881,86 @@ It needs to be added in your application main.ts file.</p>
|
|
|
34878
34881
|
</tbody>
|
|
34879
34882
|
</table>
|
|
34880
34883
|
</section>
|
|
34884
|
+
<h3>packages/core/schematics/migrate-ecl/index.ts</h3>
|
|
34885
|
+
<section data-compodoc="block-methods">
|
|
34886
|
+
<h3></h3> <table class="table table-sm table-bordered">
|
|
34887
|
+
<tbody>
|
|
34888
|
+
<tr>
|
|
34889
|
+
<td class="col-md-4">
|
|
34890
|
+
<a name="migrateEcl"></a>
|
|
34891
|
+
<span class="name">
|
|
34892
|
+
<span ><b>migrateEcl</b></span>
|
|
34893
|
+
<a href="#migrateEcl"><span class="icon ion-ios-link"></span></a>
|
|
34894
|
+
</span>
|
|
34895
|
+
</td>
|
|
34896
|
+
</tr>
|
|
34897
|
+
<tr>
|
|
34898
|
+
<td class="col-md-4">
|
|
34899
|
+
<code>migrateEcl(options: <a href="../interfaces/MigrateEclSchema.html" target="_self">MigrateEclSchema</a>)</code>
|
|
34900
|
+
</td>
|
|
34901
|
+
</tr>
|
|
34902
|
+
|
|
34903
|
+
|
|
34904
|
+
|
|
34905
|
+
|
|
34906
|
+
<tr>
|
|
34907
|
+
<td class="col-md-4">
|
|
34908
|
+
<div class="io-description"><p>Runs the full set of ECL (eUI-ECL) migration schematics needed to migrate an
|
|
34909
|
+
eUI-ECL application from v21 to v22, in the correct order:</p>
|
|
34910
|
+
<ol>
|
|
34911
|
+
<li>Per-component ECL selector / input / structural migrations (migrate-ecl-*).</li>
|
|
34912
|
+
<li>migrate-ecl-removed-components — report-only warnings for members that
|
|
34913
|
+
require manual migration.</li>
|
|
34914
|
+
<li>migrate-to-signals — rewrites programmatic <code>comp.prop</code> accesses to
|
|
34915
|
+
<code>comp.prop()</code> for signal-migrated components (the engine is shared with
|
|
34916
|
+
eUI but covers ECL via its ECL signal map).</li>
|
|
34917
|
+
<li>add-eui-imports — adds the required EUI_ECL_* imports to standalone
|
|
34918
|
+
components / declaring NgModules based on template selector usage.</li>
|
|
34919
|
+
<li>fix-no-multiple-empty-lines — cosmetic cleanup after the edits above.</li>
|
|
34920
|
+
</ol>
|
|
34921
|
+
<p>It deliberately excludes the eUI (Material) migrations (<code>migrate</code>,
|
|
34922
|
+
<code>migrate-eui-*</code>, <code>migrate-to-standalone</code>), which do not apply to eUI-ECL apps.</p>
|
|
34923
|
+
</div>
|
|
34924
|
+
|
|
34925
|
+
<div class="io-description">
|
|
34926
|
+
<b>Parameters :</b>
|
|
34927
|
+
|
|
34928
|
+
<table class="params">
|
|
34929
|
+
<thead>
|
|
34930
|
+
<tr>
|
|
34931
|
+
<td>Name</td>
|
|
34932
|
+
<td>Type</td>
|
|
34933
|
+
<td>Optional</td>
|
|
34934
|
+
</tr>
|
|
34935
|
+
</thead>
|
|
34936
|
+
<tbody>
|
|
34937
|
+
<tr>
|
|
34938
|
+
<td>options</td>
|
|
34939
|
+
<td>
|
|
34940
|
+
<code><a href="../interfaces/MigrateEclSchema.html" target="_self" >MigrateEclSchema</a></code>
|
|
34941
|
+
</td>
|
|
34942
|
+
|
|
34943
|
+
<td>
|
|
34944
|
+
No
|
|
34945
|
+
</td>
|
|
34946
|
+
|
|
34947
|
+
|
|
34948
|
+
</tr>
|
|
34949
|
+
</tbody>
|
|
34950
|
+
</table>
|
|
34951
|
+
</div>
|
|
34952
|
+
<div class="io-description">
|
|
34953
|
+
<b>Returns : </b> <code>Rule</code>
|
|
34954
|
+
|
|
34955
|
+
</div>
|
|
34956
|
+
<div class="io-description">
|
|
34957
|
+
|
|
34958
|
+
</div>
|
|
34959
|
+
</td>
|
|
34960
|
+
</tr>
|
|
34961
|
+
</tbody>
|
|
34962
|
+
</table>
|
|
34963
|
+
</section>
|
|
34881
34964
|
<h3>packages/core/src/lib/services/app/eui-init-app.ts</h3>
|
|
34882
34965
|
<section data-compodoc="block-methods">
|
|
34883
34966
|
<h3></h3> <table class="table table-sm table-bordered">
|
package/docs/overview.html
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
<div class="card text-center">
|
|
162
162
|
<div class="card-block">
|
|
163
163
|
<h4 class="card-title"><span class="icon ion-md-information-circle-outline"></span></h4>
|
|
164
|
-
<p class="card-text">
|
|
164
|
+
<p class="card-text">87 Interfaces</p>
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
</div>
|
package/docs/properties.html
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eui/core",
|
|
3
|
-
"version": "22.0.0-alpha.
|
|
3
|
+
"version": "22.0.0-alpha.65",
|
|
4
4
|
"tag": "next",
|
|
5
5
|
"description": "eUI core package - holding UI components for Desktop applications",
|
|
6
6
|
"homepage": "https://eui.ecdevops.eu",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://sdlc.webcloud.ec.europa.eu/csdr/eui/eui.git"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@eui/base": "22.0.0-alpha.
|
|
13
|
+
"@eui/base": "22.0.0-alpha.65",
|
|
14
14
|
"rxjs": "^7.8.0",
|
|
15
15
|
"extend": "^3.0.2",
|
|
16
16
|
"localforage": "^1.10.0",
|
|
@@ -119,6 +119,12 @@
|
|
|
119
119
|
"factory": "./migrate-to-signals/index#migrateToSignals",
|
|
120
120
|
"schema": "./migrate-to-signals/schema.json"
|
|
121
121
|
},
|
|
122
|
+
"migrate-ecl": {
|
|
123
|
+
"description": "Runs all eUI-ECL migration schematics in sequence to fully migrate an eUI-ECL app (per-component ECL migrations, signal access migration, import additions, cleanup).",
|
|
124
|
+
"factory": "./migrate-ecl/index#migrateEcl",
|
|
125
|
+
"schema": "./migrate-ecl/schema.json",
|
|
126
|
+
"aliases": ["ecl-migrate-all"]
|
|
127
|
+
},
|
|
122
128
|
"migrate-ecl-breadcrumb": {
|
|
123
129
|
"description": "Migrates the removed ecl-breadcrumb element selector to nav[eclBreadcrumb].",
|
|
124
130
|
"factory": "./migrate-ecl-breadcrumb/index#migrateEclBreadcrumb",
|
|
@@ -11,8 +11,8 @@ function migrate(options) {
|
|
|
11
11
|
return (tree, context) => {
|
|
12
12
|
const version = (0, utils_1.detectEuiVersion)(tree);
|
|
13
13
|
context.logger.info(`Detected eUI version: ${version || 'unknown'}`);
|
|
14
|
-
if (!version || !version.startsWith('
|
|
15
|
-
context.logger.warn(`This migration schematic targets eUI
|
|
14
|
+
if (!version || !version.startsWith('22')) {
|
|
15
|
+
context.logger.warn(`This migration schematic targets eUI 22.x. Detected: ${version || 'unknown'}. Skipping.`);
|
|
16
16
|
return tree;
|
|
17
17
|
}
|
|
18
18
|
const scanPath = options.path || './src';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export interface MigrateEclSchema {
|
|
3
|
+
path?: string;
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
useClassArray?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Runs the full set of ECL (eUI-ECL) migration schematics needed to migrate an
|
|
9
|
+
* eUI-ECL application from v21 to v22, in the correct order:
|
|
10
|
+
*
|
|
11
|
+
* 1. Per-component ECL selector / input / structural migrations (migrate-ecl-*).
|
|
12
|
+
* 2. migrate-ecl-removed-components — report-only warnings for members that
|
|
13
|
+
* require manual migration.
|
|
14
|
+
* 3. migrate-to-signals — rewrites programmatic `comp.prop` accesses to
|
|
15
|
+
* `comp.prop()` for signal-migrated components (the engine is shared with
|
|
16
|
+
* eUI but covers ECL via its ECL signal map).
|
|
17
|
+
* 4. add-eui-imports — adds the required EUI_ECL_* imports to standalone
|
|
18
|
+
* components / declaring NgModules based on template selector usage.
|
|
19
|
+
* 5. fix-no-multiple-empty-lines — cosmetic cleanup after the edits above.
|
|
20
|
+
*
|
|
21
|
+
* It deliberately excludes the eUI (Material) migrations (`migrate`,
|
|
22
|
+
* `migrate-eui-*`, `migrate-to-standalone`), which do not apply to eUI-ECL apps.
|
|
23
|
+
*/
|
|
24
|
+
export declare function migrateEcl(options: MigrateEclSchema): Rule;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateEcl = migrateEcl;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
/**
|
|
6
|
+
* Runs the full set of ECL (eUI-ECL) migration schematics needed to migrate an
|
|
7
|
+
* eUI-ECL application from v21 to v22, in the correct order:
|
|
8
|
+
*
|
|
9
|
+
* 1. Per-component ECL selector / input / structural migrations (migrate-ecl-*).
|
|
10
|
+
* 2. migrate-ecl-removed-components — report-only warnings for members that
|
|
11
|
+
* require manual migration.
|
|
12
|
+
* 3. migrate-to-signals — rewrites programmatic `comp.prop` accesses to
|
|
13
|
+
* `comp.prop()` for signal-migrated components (the engine is shared with
|
|
14
|
+
* eUI but covers ECL via its ECL signal map).
|
|
15
|
+
* 4. add-eui-imports — adds the required EUI_ECL_* imports to standalone
|
|
16
|
+
* components / declaring NgModules based on template selector usage.
|
|
17
|
+
* 5. fix-no-multiple-empty-lines — cosmetic cleanup after the edits above.
|
|
18
|
+
*
|
|
19
|
+
* It deliberately excludes the eUI (Material) migrations (`migrate`,
|
|
20
|
+
* `migrate-eui-*`, `migrate-to-standalone`), which do not apply to eUI-ECL apps.
|
|
21
|
+
*/
|
|
22
|
+
function migrateEcl(options) {
|
|
23
|
+
const base = { path: options.path || './src', dryRun: options.dryRun || false };
|
|
24
|
+
return (0, schematics_1.chain)([
|
|
25
|
+
(0, schematics_1.schematic)('migrate-ecl-breadcrumb', base),
|
|
26
|
+
(0, schematics_1.schematic)('migrate-ecl-page-header', base),
|
|
27
|
+
(0, schematics_1.schematic)('migrate-ecl-page-summary', base),
|
|
28
|
+
(0, schematics_1.schematic)('migrate-ecl-site-footer', base),
|
|
29
|
+
(0, schematics_1.schematic)('migrate-ecl-timeline', base),
|
|
30
|
+
(0, schematics_1.schematic)('migrate-ecl-pagination', base),
|
|
31
|
+
(0, schematics_1.schematic)('migrate-ecl-inpage-navigation', base),
|
|
32
|
+
(0, schematics_1.schematic)('migrate-ecl-tabs', base),
|
|
33
|
+
(0, schematics_1.schematic)('migrate-ecl-file', base),
|
|
34
|
+
(0, schematics_1.schematic)('migrate-ecl-quiz', base),
|
|
35
|
+
(0, schematics_1.schematic)('migrate-ecl-link', base),
|
|
36
|
+
(0, schematics_1.schematic)('migrate-ecl-icon', base),
|
|
37
|
+
(0, schematics_1.schematic)('migrate-to-signals', base),
|
|
38
|
+
(0, schematics_1.schematic)('migrate-ecl-removed-components', base),
|
|
39
|
+
(0, schematics_1.schematic)('add-eui-imports', { ...base, useClassArray: options.useClassArray || false }),
|
|
40
|
+
(0, schematics_1.schematic)('fix-no-multiple-empty-lines', base),
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/migrate-ecl/index.ts"],"names":[],"mappings":";;AAyBA,gCAqBC;AA9CD,2DAAoE;AAQpE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,UAAU,CAAC,OAAyB;IAClD,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;IAEhF,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,sBAAS,EAAC,wBAAwB,EAAE,IAAI,CAAC;QACzC,IAAA,sBAAS,EAAC,yBAAyB,EAAE,IAAI,CAAC;QAC1C,IAAA,sBAAS,EAAC,0BAA0B,EAAE,IAAI,CAAC;QAC3C,IAAA,sBAAS,EAAC,yBAAyB,EAAE,IAAI,CAAC;QAC1C,IAAA,sBAAS,EAAC,sBAAsB,EAAE,IAAI,CAAC;QACvC,IAAA,sBAAS,EAAC,wBAAwB,EAAE,IAAI,CAAC;QACzC,IAAA,sBAAS,EAAC,+BAA+B,EAAE,IAAI,CAAC;QAChD,IAAA,sBAAS,EAAC,kBAAkB,EAAE,IAAI,CAAC;QACnC,IAAA,sBAAS,EAAC,kBAAkB,EAAE,IAAI,CAAC;QACnC,IAAA,sBAAS,EAAC,kBAAkB,EAAE,IAAI,CAAC;QACnC,IAAA,sBAAS,EAAC,kBAAkB,EAAE,IAAI,CAAC;QACnC,IAAA,sBAAS,EAAC,kBAAkB,EAAE,IAAI,CAAC;QACnC,IAAA,sBAAS,EAAC,oBAAoB,EAAE,IAAI,CAAC;QACrC,IAAA,sBAAS,EAAC,gCAAgC,EAAE,IAAI,CAAC;QACjD,IAAA,sBAAS,EAAC,iBAAiB,EAAE,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,KAAK,EAAE,CAAC;QACxF,IAAA,sBAAS,EAAC,6BAA6B,EAAE,IAAI,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "MigrateEclSchema",
|
|
3
|
+
"title": "Migrate eUI-ECL application",
|
|
4
|
+
"description": "Runs all eUI-ECL migration schematics in sequence to fully migrate an eUI-ECL app (per-component ECL migrations, signal access migration, import additions, cleanup).",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The path to scan for files to migrate.",
|
|
10
|
+
"default": "./src",
|
|
11
|
+
"visible": true
|
|
12
|
+
},
|
|
13
|
+
"dryRun": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"default": false,
|
|
16
|
+
"description": "Whether to run in dry-run mode without making actual changes."
|
|
17
|
+
},
|
|
18
|
+
"useClassArray": {
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"default": false,
|
|
21
|
+
"description": "When true, uses spread CLASS arrays (e.g. ...EUI_ECL_BUTTON) instead of individual class names for add-eui-imports."
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": []
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
interface Schema {
|
|
3
|
+
path?: string;
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Advisory migration for the eui-datepicker moment-locale breaking change.
|
|
8
|
+
*
|
|
9
|
+
* `eui-datepicker` no longer bundles the moment locale data (the internal
|
|
10
|
+
* `import 'moment/min/locales'` was removed). Apps that relied on the datepicker
|
|
11
|
+
* implicitly registering every moment locale must now import the locales they use
|
|
12
|
+
* themselves, e.g. `import 'moment/locale/fr';`. This schematic cannot know which
|
|
13
|
+
* locales an app needs (and auto-importing all of them would reintroduce the bundle
|
|
14
|
+
* cost the change removed), so it only reports the files that use `eui-datepicker`
|
|
15
|
+
* and the manual action required.
|
|
16
|
+
*/
|
|
17
|
+
export declare function migrateEuiDatepicker(options?: Schema): Rule;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateEuiDatepicker = migrateEuiDatepicker;
|
|
4
|
+
const compiler_1 = require("@angular/compiler");
|
|
5
|
+
const dry_run_1 = require("../utils/dry-run");
|
|
6
|
+
/**
|
|
7
|
+
* Advisory migration for the eui-datepicker moment-locale breaking change.
|
|
8
|
+
*
|
|
9
|
+
* `eui-datepicker` no longer bundles the moment locale data (the internal
|
|
10
|
+
* `import 'moment/min/locales'` was removed). Apps that relied on the datepicker
|
|
11
|
+
* implicitly registering every moment locale must now import the locales they use
|
|
12
|
+
* themselves, e.g. `import 'moment/locale/fr';`. This schematic cannot know which
|
|
13
|
+
* locales an app needs (and auto-importing all of them would reintroduce the bundle
|
|
14
|
+
* cost the change removed), so it only reports the files that use `eui-datepicker`
|
|
15
|
+
* and the manual action required.
|
|
16
|
+
*/
|
|
17
|
+
function migrateEuiDatepicker(options = {}) {
|
|
18
|
+
return (tree, context) => {
|
|
19
|
+
const scanPath = options.path ? '/' + options.path.replace(/^\.?\//, '').replace(/\/$/, '') : '';
|
|
20
|
+
const matches = [];
|
|
21
|
+
const dir = tree.getDir(scanPath || '/');
|
|
22
|
+
visitDir(dir, (path) => {
|
|
23
|
+
const buffer = tree.read(path);
|
|
24
|
+
if (!buffer)
|
|
25
|
+
return;
|
|
26
|
+
const content = buffer.toString('utf-8');
|
|
27
|
+
if (!content.includes('eui-datepicker'))
|
|
28
|
+
return;
|
|
29
|
+
const usesDatepicker = path.endsWith('.html')
|
|
30
|
+
? templateUsesDatepicker(content)
|
|
31
|
+
: inlineTemplateUsesDatepicker(content);
|
|
32
|
+
if (usesDatepicker) {
|
|
33
|
+
matches.push(path);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
if (matches.length === 0) {
|
|
37
|
+
context.logger.info('No eui-datepicker usage found; no moment-locale action required.');
|
|
38
|
+
return tree;
|
|
39
|
+
}
|
|
40
|
+
context.logger.warn('Breaking change: eui-datepicker no longer bundles moment locale data. '
|
|
41
|
+
+ 'Import the moment locales your app uses (e.g. `import \'moment/locale/fr\';`) '
|
|
42
|
+
+ 'in the module/bootstrap where the datepicker is used; otherwise dates fall back '
|
|
43
|
+
+ 'to the active moment locale and may format incorrectly.');
|
|
44
|
+
for (const path of matches) {
|
|
45
|
+
context.logger.warn(` Manual action needed: ${path} uses eui-datepicker — ensure the required moment locale(s) are imported.`);
|
|
46
|
+
}
|
|
47
|
+
context.logger.info(`eui-datepicker moment-locale check: ${matches.length} file(s) use eui-datepicker.`);
|
|
48
|
+
if (options.dryRun) {
|
|
49
|
+
(0, dry_run_1.logDryRunNote)(context);
|
|
50
|
+
}
|
|
51
|
+
return tree;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function visitDir(dir, callback) {
|
|
55
|
+
for (const file of dir.subfiles) {
|
|
56
|
+
if (file.endsWith('.d.ts'))
|
|
57
|
+
continue;
|
|
58
|
+
if (!file.endsWith('.html') && !file.endsWith('.ts'))
|
|
59
|
+
continue;
|
|
60
|
+
callback(`${dir.path}/${file}`);
|
|
61
|
+
}
|
|
62
|
+
for (const sub of dir.subdirs) {
|
|
63
|
+
if (sub === 'node_modules' || sub === 'dist')
|
|
64
|
+
continue;
|
|
65
|
+
visitDir(dir.dir(sub), callback);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function templateUsesDatepicker(source) {
|
|
69
|
+
try {
|
|
70
|
+
const parsed = (0, compiler_1.parseTemplate)(source, '', { preserveWhitespaces: true });
|
|
71
|
+
return nodesContainDatepicker(parsed.nodes);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// Fall back to a substring check if the template cannot be parsed.
|
|
75
|
+
return source.includes('eui-datepicker');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function inlineTemplateUsesDatepicker(source) {
|
|
79
|
+
const templateRegex = /template\s*:\s*`([^`]*)`/gs;
|
|
80
|
+
let match;
|
|
81
|
+
while ((match = templateRegex.exec(source)) !== null) {
|
|
82
|
+
if (match[1].includes('eui-datepicker') && templateUsesDatepicker(match[1])) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
function nodesContainDatepicker(nodes) {
|
|
89
|
+
for (const node of nodes) {
|
|
90
|
+
if (node instanceof compiler_1.TmplAstElement) {
|
|
91
|
+
if (node.name === 'eui-datepicker') {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (nodesContainDatepicker(node.children)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/migrate-eui-datepicker/index.ts"],"names":[],"mappings":";;AAoBA,oDA2CC;AA/DD,gDAA+E;AAE/E,8CAAiD;AAOjD;;;;;;;;;;GAUG;AACH,SAAgB,oBAAoB,CAAC,UAAkB,EAAE;IACvD,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjG,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;QACzC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,CAAC,MAAM;gBAAE,OAAO;YAEpB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACzC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAAE,OAAO;YAEhD,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC3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AAC;gBAC1C,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "MigrateEuiDatepickerSchema",
|
|
4
|
+
"title": "Migrate EUI datepicker moment-locale breaking change",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The path to scan for files.",
|
|
10
|
+
"default": "./",
|
|
11
|
+
"visible": true
|
|
12
|
+
},
|
|
13
|
+
"dryRun": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"default": false,
|
|
16
|
+
"description": "Whether to run in dry-run mode without making actual changes."
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "MigrateEuiTooltipSchema",
|
|
4
|
+
"title": "Migrate EUI tooltip deprecated EuiTooltipConfig class to EuiTooltipInterface",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The path to scan for files.",
|
|
10
|
+
"default": "./",
|
|
11
|
+
"visible": true
|
|
12
|
+
},
|
|
13
|
+
"dryRun": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"default": false,
|
|
16
|
+
"description": "Whether to run in dry-run mode without making actual changes."
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|