@ethlete/cdk 5.0.0-next.5 → 5.0.0-next.51
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 +381 -30
- package/fesm2022/ethlete-cdk.mjs +29295 -18544
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/generators/generators.json +5 -0
- package/generators/migrate-from-cdk/components-classes.js +1178 -0
- package/generators/migrate-from-cdk/imports.js +250 -0
- package/generators/migrate-from-cdk/installed-version.js +86 -0
- package/generators/migrate-from-cdk/migration-map.js +21 -0
- package/generators/migrate-from-cdk/migration-scope.js +30 -0
- package/generators/migrate-from-cdk/migration.js +151 -0
- package/generators/migrate-from-cdk/report.js +401 -0
- package/generators/migrate-from-cdk/schema.json +30 -0
- package/generators/migrate-from-cdk/templates.js +91 -0
- package/generators/migrate-to-v5/cdk-menu.js +3 -8
- package/generators/migrate-to-v5/color-themes.js +110 -6
- package/generators/migrate-to-v5/dialog-bottom-sheet.js +0 -2
- package/generators/migrate-to-v5/et-let.js +2 -2
- package/generators/migrate-to-v5/overlay-positions.js +4 -44
- package/migration-map.json +3611 -0
- package/migrations/from-cdk-decisions.md +41 -0
- package/migrations.json +31 -0
- package/package.json +35 -19
- package/types/ethlete-cdk.d.ts +12592 -8700
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Work through the cdk migration tasks
|
|
2
|
+
|
|
3
|
+
`nx g @ethlete/cdk:migrate-from-cdk` rewrites every import whose successor in `@ethlete/components` or
|
|
4
|
+
`@ethlete/core` has the same contract. What it cannot rewrite, it writes into
|
|
5
|
+
`migrate-from-cdk-tasks.md` at the repository root. That file is the input for this task.
|
|
6
|
+
|
|
7
|
+
If `migrate-from-cdk-tasks.md` is not there, the generator found nothing that needs a decision, and
|
|
8
|
+
there is nothing to do here.
|
|
9
|
+
|
|
10
|
+
## How to work the file
|
|
11
|
+
|
|
12
|
+
Take one section at a time. Every entry names a `file:line`, so read the call site before you change
|
|
13
|
+
it. Each section states what the successor API expects.
|
|
14
|
+
|
|
15
|
+
- **`<et-picture>` without `alt`.** `alt` is required on the components picture. `alt=""` is allowed and
|
|
16
|
+
states that the image is decorative. Which one a site needs is a product decision: read the
|
|
17
|
+
surrounding markup, and use `alt=""` only where the image carries no information. Where a real
|
|
18
|
+
description is needed and nothing in the code holds one, leave the site in the report and say so.
|
|
19
|
+
- **Picture class inputs.** `imgClass`, `pictureClass`, `figureClass` and `figcaptionClass` are gone.
|
|
20
|
+
The report groups each site by what its classes express: a definite box in both axes takes `fit` on
|
|
21
|
+
the host, a single constrained axis takes a style on `.et-picture-img`. Follow the group, not a
|
|
22
|
+
uniform rewrite - `fit` on an image that sizes its own box collapses the layout.
|
|
23
|
+
- **Themed spinners.** The cdk spinner defaulted to a themed blue; the components spinner defaults to
|
|
24
|
+
`currentColor`. A spinner inside a button or a link should inherit. A standalone one that carried the
|
|
25
|
+
brand colour needs `color="brand"`, using the theme name that app registers.
|
|
26
|
+
- **Spinner `[mode]` bindings.** `mode` split into the `determinate` boolean. Rewrite the expression by
|
|
27
|
+
what it meant, for example `[mode]="isKnown ? 'determinate' : 'indeterminate'"` becomes
|
|
28
|
+
`[determinate]="isKnown"`.
|
|
29
|
+
- **Symbols whose contract changed.** These imports still point at `@ethlete/cdk` on purpose. Move one
|
|
30
|
+
only when its call site matches the successor API. The entry names the successor and links its guide.
|
|
31
|
+
- **Successors that need a newer package.** Do not touch these. Update `@ethlete/components` or
|
|
32
|
+
`@ethlete/core` first, then run `nx g @ethlete/cdk:migrate-from-cdk` again.
|
|
33
|
+
|
|
34
|
+
## When you are done
|
|
35
|
+
|
|
36
|
+
1. Run the type check and the lint task of every project you changed.
|
|
37
|
+
2. Run the tests that cover the components you touched.
|
|
38
|
+
3. Delete the entries you finished from `migrate-from-cdk-tasks.md`, and delete the file once it is
|
|
39
|
+
empty. Leave any entry you could not decide, with a line saying what is missing.
|
|
40
|
+
|
|
41
|
+
The cdk migration guide is at <https://ethlete-sdk-docs.web.app/cdk/migration>.
|
package/migrations.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"migrations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "to-v5",
|
|
5
|
+
"version": "5.0.0-beta.12",
|
|
6
|
+
"kind": "auto",
|
|
7
|
+
"level": "required",
|
|
8
|
+
"description": "Rewrite the v4 cdk API into its v5 shape.",
|
|
9
|
+
"generator": "@ethlete/cdk:migrate-to-v5",
|
|
10
|
+
"docs": "/cdk/migration"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "from-cdk",
|
|
14
|
+
"version": "5.0.0-next.25",
|
|
15
|
+
"kind": "auto",
|
|
16
|
+
"level": "optional",
|
|
17
|
+
"description": "Rewrite the mechanical part of the move off @ethlete/cdk, and write migrate-from-cdk-tasks.md for the rest.",
|
|
18
|
+
"generator": "@ethlete/cdk:migrate-from-cdk",
|
|
19
|
+
"docs": "/cdk/migration"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "from-cdk-decisions",
|
|
23
|
+
"version": "5.0.0-next.25",
|
|
24
|
+
"kind": "assisted",
|
|
25
|
+
"level": "optional",
|
|
26
|
+
"description": "Work through migrate-from-cdk-tasks.md: the call sites whose successor API behaves differently.",
|
|
27
|
+
"instructions": "./migrations/from-cdk-decisions.md",
|
|
28
|
+
"docs": "/cdk/migration"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/cdk",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.51",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/ethlete-io/ethdk",
|
|
7
|
+
"directory": "libs/cdk"
|
|
8
|
+
},
|
|
4
9
|
"license": "MIT",
|
|
5
10
|
"sideEffects": false,
|
|
6
11
|
"exports": {
|
|
@@ -9,33 +14,44 @@
|
|
|
9
14
|
"types": "./types/ethlete-cdk.d.ts",
|
|
10
15
|
"default": "./fesm2022/ethlete-cdk.mjs"
|
|
11
16
|
},
|
|
17
|
+
"./migration-map.json": {
|
|
18
|
+
"default": "./migration-map.json"
|
|
19
|
+
},
|
|
12
20
|
"./package.json": {
|
|
13
21
|
"default": "./package.json"
|
|
14
22
|
}
|
|
15
23
|
},
|
|
16
24
|
"peerDependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"@angular/
|
|
19
|
-
"@angular/
|
|
20
|
-
"@angular/
|
|
21
|
-
"@angular/
|
|
22
|
-
"@angular/
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"@ethlete/
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
25
|
+
"@angular/cdk": "^22.1.0",
|
|
26
|
+
"@angular/common": "^22.1.0",
|
|
27
|
+
"@angular/core": "^22.1.0",
|
|
28
|
+
"@angular/forms": "^22.1.0",
|
|
29
|
+
"@angular/platform-browser": "^22.1.0",
|
|
30
|
+
"@angular/router": "^22.1.0",
|
|
31
|
+
"@ethlete/core": "^5.0.0-beta.11",
|
|
32
|
+
"@ethlete/query": "^6.0.0-beta.8",
|
|
33
|
+
"@ethlete/types": "^2.0.0-beta.4",
|
|
34
|
+
"@floating-ui/dom": "^1.6.0",
|
|
35
|
+
"@nx/devkit": ">=23.0.0",
|
|
36
|
+
"date-fns": "^4.0.0",
|
|
37
|
+
"rxjs": "^7.8.0",
|
|
38
|
+
"typescript": "^6.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"@nx/devkit": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"typescript": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"ethlete": {
|
|
49
|
+
"migrations": "./migrations.json"
|
|
35
50
|
},
|
|
36
51
|
"generators": "./generators/generators.json",
|
|
37
52
|
"module": "fesm2022/ethlete-cdk.mjs",
|
|
38
53
|
"typings": "types/ethlete-cdk.d.ts",
|
|
54
|
+
"type": "module",
|
|
39
55
|
"dependencies": {
|
|
40
56
|
"tslib": "^2.3.0"
|
|
41
57
|
}
|