@elliemae/ds-codemods 3.80.0-next.22 → 3.80.0-next.30
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.
|
@@ -27,7 +27,7 @@ registered, separately invocable CLI commands (see `commands.mjs`,
|
|
|
27
27
|
referenced by name in Confluence pages and recorded walkthroughs, so the command names and their
|
|
28
28
|
CLI-visible behavior must keep working exactly as they did before, indefinitely.
|
|
29
29
|
|
|
30
|
-
What moved is only
|
|
30
|
+
What moved is only _where their implementation lives on disk_: their import maps,
|
|
31
31
|
`packageJsonReplaceLogic.mjs`, and core logic now live in `26-3/` and `27-1/` in this folder, each
|
|
32
32
|
exposing a `run26dot3MigrationLogic()` / `run27dot1MigrationLogic()` function.
|
|
33
33
|
`execute-commands-map.mjs`'s cases for those two commands call those functions directly - they are
|
|
@@ -42,12 +42,20 @@ dedicated command**. Instead:
|
|
|
42
42
|
1. Add a new subfolder here, named after the dot-release (E.G. `27-3/`).
|
|
43
43
|
2. Give it its own `legacyXXdotYImportMap.mjs` (exact-match capture-group regex, same technique as
|
|
44
44
|
every other one here) and `packageJsonReplaceLogic.mjs`, mirroring `27-2/`'s exact shape - `27-2/`
|
|
45
|
-
is the reference pattern for a
|
|
45
|
+
is the reference pattern for a _fully self-contained_ subfolder (not a thin wrapper around an
|
|
46
46
|
external, independently-registered command, unlike `26-3/`/`27-1/`).
|
|
47
47
|
3. Expose a `runXXdotYMigrationLogic()` function from an `index.mjs`-equivalent file in that
|
|
48
48
|
subfolder (name it `runXXdotYMigrationLogic.mjs`, matching the existing convention).
|
|
49
49
|
4. Wire it into this folder's `index.mjs`: import it, add its dot-release key to
|
|
50
50
|
`AVAILABLE_MIGRATIONS`, and add its conditional call in `legacyDeprecation()`.
|
|
51
|
+
5. Update the consumer-facing surfaces: the `readme.md` of this package (the `legacy-deprecation`
|
|
52
|
+
section lists which migrations `all` runs), a migration guide under
|
|
53
|
+
`stories/docs/confluence-content/migrations/dimsum-3-x/` (plus its entry in `AIndex.md` and export
|
|
54
|
+
in `index.stories.jsx`), and the release's Go-to-market delta brief under
|
|
55
|
+
`stories/docs/confluence-content/release-notes/`. Wording rules: see the "Terminology for
|
|
56
|
+
consumer-facing docs" section below.
|
|
57
|
+
6. Add the moved package to `bin/cli/constants/deprecatedPackages.mjs` so the usage report and the
|
|
58
|
+
Storybook legacy-usage checker surface it.
|
|
51
59
|
|
|
52
60
|
No new `commands.mjs` entry, no new `execute-commands-map.mjs` case, no new
|
|
53
61
|
`inquirer-questions-prompter.mjs` case, no new CLI flag - the existing `legacy-deprecation` command
|
|
@@ -65,3 +73,39 @@ extra prompt. Pass it as a comma separated string, E.G. `--migrations 26.3,27.1`
|
|
|
65
73
|
alongside it (E.G. `--migrations 26.3,all`) - this is intentional, not a bug: "all" existing in the
|
|
66
74
|
list at all means "run everything," full stop, so a consumer/CI script that defaults to `all` can't
|
|
67
75
|
be accidentally narrowed by a stray extra pick.
|
|
76
|
+
|
|
77
|
+
## Terminology for consumer-facing docs (curated by the CTO)
|
|
78
|
+
|
|
79
|
+
When a package moves to its `-legacy-` counterpart, the docs that consumers read (the release notes'
|
|
80
|
+
Go-to-market delta brief, the migration guide under `stories/docs/confluence-content/migrations/`,
|
|
81
|
+
and this package's `readme.md`) use the CTO-curated wording, chosen to transmit the actual immediate impact in the release:
|
|
82
|
+
|
|
83
|
+
- **"import only"** - the change consumers make. Running this command is an import-only,
|
|
84
|
+
development-time change (source imports and `package.json`) with no runtime impact on end users.
|
|
85
|
+
- **"the package moved"** (or "relocated") - what happened to the package. Not "deleted", not
|
|
86
|
+
"rewritten".
|
|
87
|
+
- **"migration" is reserved for adapting code.** That is why a release's kickoff charter can say
|
|
88
|
+
"No forced migration" while the brief labels the same item "Breaking": the item is breaking only
|
|
89
|
+
because the import stops resolving. Do not describe this command's work as "a migration" in consumer
|
|
90
|
+
docs. The consumer would still get the same behaviour they got up until now. Migration is reserved for having to change,
|
|
91
|
+
adapt, and modify consumer facing behaviours and developer facing API interfaces.
|
|
92
|
+
- **"Codemod provided"** is the existing way to say the tooling exists (see the 26.3 "Deprecated
|
|
93
|
+
Components Package Rename" row in `stories/docs/confluence-content/release-notes/v26-3/ReleaseKickoffCharter.md`).
|
|
94
|
+
- Keep it short and factual, in the shape of the neighboring guides in
|
|
95
|
+
`migrations/dimsum-3-x/` (Rationale, then Migration Steps). The ds-mobile move is the reference:
|
|
96
|
+
`DsMobileToDsLegacyMobile.md` and the `ds-mobile` section of
|
|
97
|
+
`release-notes/v27-2/GoToMarketDeltaBrief.md`. Point to those instead of copying their text here.
|
|
98
|
+
|
|
99
|
+
Evidence rule for "Known differences": list only what a side-by-side run of the live package against the
|
|
100
|
+
legacy build that will actually ship shows (DOM, ARIA, `data-testid`, screenshots). The ds-mobile move used
|
|
101
|
+
the standalone Playwright harness that lives in the dimsum-legacy repo at
|
|
102
|
+
`environments/compare-live-vs-legacy` (its `AGENTS.md` explains the toolchain and how to point the legacy side
|
|
103
|
+
at a `pnpm pack` tarball of the ported package). Do not
|
|
104
|
+
carry a differences list forward from an earlier state of the legacy code.
|
|
105
|
+
|
|
106
|
+
Placement constraint: a guide that shows `from '<old package>'` samples must live under `migrations/`,
|
|
107
|
+
`release-notes/` or `a11y-rationale/`, because `checkLegacyCodeUsage.mjs` (run in `build-storybook`)
|
|
108
|
+
fails on any other scanned file that imports the moved package.
|
|
109
|
+
|
|
110
|
+
This file's own history section still says "mechanical rename". That is internal wording and can stay;
|
|
111
|
+
the terms above apply to what consumers read.
|
|
@@ -710,10 +710,11 @@ export const DISMISSED_BEFORE_DEPRECATION_FLOWS_EXISTED = [
|
|
|
710
710
|
/**
|
|
711
711
|
* for packages we are not actively investing in and have no committed replacement (unlike
|
|
712
712
|
* LEGACY_WITH_NEW_*_MIGRATION_EFFORT) and that are not being "removed in favor of examples" either
|
|
713
|
-
* (unlike DISMISSED_WITH_EXAMPLE)
|
|
714
|
-
*
|
|
715
|
-
*
|
|
716
|
-
*
|
|
713
|
+
* (unlike DISMISSED_WITH_EXAMPLE). A mechanical rename to the `-legacy-` package may exist (E.G.
|
|
714
|
+
* `legacy-deprecation --migrations 27.2` for @elliemae/ds-mobile), but there is no live replacement to
|
|
715
|
+
* migrate to, so the effort of leaving the legacy package stays case-by-case: if/when a real consumer
|
|
716
|
+
* shows up asking "what do I use instead", that becomes an ad-hoc discussion (potentially a dedicated
|
|
717
|
+
* effort for the specific components they need) rather than a pre-baked migration path here.
|
|
717
718
|
* @type {DeprecatedPackageMatch[]}
|
|
718
719
|
*/
|
|
719
720
|
/* prettier-ignore */
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -372,3 +372,63 @@ npx @elliemae/ds-codemods components-usage-report
|
|
|
372
372
|
```
|
|
373
373
|
npx @elliemae/ds-codemods components-usage-report --append --org='ICE' --repo='Dimsum'
|
|
374
374
|
```
|
|
375
|
+
|
|
376
|
+
## Moving Packages to their `-legacy-` Counterpart (`legacy-deprecation`)
|
|
377
|
+
|
|
378
|
+
Some packages were pulled out of live's normal publish set and only remain available through their `-legacy-` prefixed package. This script does the import-only change for them: it rewrites the `from '<package>'` imports/exports in the scanned files and swaps the entries in the `dependencies`, `devDependencies` and `peerDependencies` of every `package.json` (version set to `"*"`).
|
|
379
|
+
|
|
380
|
+
It bundles three dot-release migrations:
|
|
381
|
+
|
|
382
|
+
- `26.3`: `@elliemae/ds-button` -> `@elliemae/ds-legacy-button`, `@elliemae/ds-date-range-picker` -> `@elliemae/ds-legacy-date-range-picker`, `@elliemae/ds-header` -> `@elliemae/ds-legacy-header`, `@elliemae/ds-number-range-field` -> `@elliemae/ds-legacy-number-range-field`, `@elliemae/ds-slider` -> `@elliemae/ds-legacy-slider`, `@elliemae/ds-zipcode-search` -> `@elliemae/ds-legacy-zipcode-search`, `@elliemae/ds-button-group` -> `@elliemae/ds-legacy-button-group`, `@elliemae/ds-date-range-selector` -> `@elliemae/ds-legacy-date-range-selector`, `@elliemae/ds-hidden` -> `@elliemae/ds-legacy-hidden`, `@elliemae/ds-page-number` -> `@elliemae/ds-legacy-page-number`, `@elliemae/ds-spinner` -> `@elliemae/ds-legacy-spinner`, `@elliemae/ds-zoom` -> `@elliemae/ds-legacy-zoom`, `@elliemae/ds-button-v1` -> `@elliemae/ds-legacy-button-v1`, `@elliemae/ds-date-time-recurrence-picker` -> `@elliemae/ds-legacy-date-time-recurrence-picker`, `@elliemae/ds-label-value` -> `@elliemae/ds-legacy-label-value`, `@elliemae/ds-pills` -> `@elliemae/ds-legacy-pills`, `@elliemae/ds-text-wrapper` -> `@elliemae/ds-legacy-text-wrapper`, `@elliemae/ds-card-array` -> `@elliemae/ds-legacy-card-array`, `@elliemae/ds-dropdownmenu` -> `@elliemae/ds-legacy-dropdownmenu`, `@elliemae/ds-list-section-header` -> `@elliemae/ds-legacy-list-section-header`, `@elliemae/ds-popover` -> `@elliemae/ds-legacy-popover`, `@elliemae/ds-time-picker` -> `@elliemae/ds-legacy-time-picker`, `@elliemae/ds-common` -> `@elliemae/ds-legacy-common`, `@elliemae/ds-filterbar` -> `@elliemae/ds-legacy-filterbar`, `@elliemae/ds-menu` -> `@elliemae/ds-legacy-menu`, `@elliemae/ds-popper` -> `@elliemae/ds-legacy-popper`, `@elliemae/ds-toolbar` -> `@elliemae/ds-legacy-toolbar`, `@elliemae/ds-datagrids` -> `@elliemae/ds-legacy-datagrids`, `@elliemae/ds-form` -> `@elliemae/ds-legacy-form`, `@elliemae/ds-mini-toolbar` -> `@elliemae/ds-legacy-mini-toolbar`, `@elliemae/ds-search-field` -> `@elliemae/ds-legacy-search-field`, `@elliemae/ds-uploader` -> `@elliemae/ds-legacy-uploader`, `@elliemae/ds-date-picker` -> `@elliemae/ds-legacy-date-picker`, `@elliemae/ds-group-box` -> `@elliemae/ds-legacy-group-box`, `@elliemae/ds-modal` -> `@elliemae/ds-legacy-modal`, `@elliemae/ds-shuttle` -> `@elliemae/ds-legacy-shuttle`, `@elliemae/ds-wysiwygeditor` -> `@elliemae/ds-legacy-wysiwygeditor`.
|
|
383
|
+
- `27.1`: `@elliemae/ds-truncated-tooltip-text` -> `@elliemae/ds-legacy-truncated-tooltip-text`.
|
|
384
|
+
- `27.2`: `@elliemae/ds-mobile` -> `@elliemae/ds-legacy-mobile`.
|
|
385
|
+
|
|
386
|
+
`all` (the default) runs all of them; pass `--migrations 27.2` to run only one.
|
|
387
|
+
|
|
388
|
+
This is an import-only, development-time change (source imports and `package.json`) with no runtime impact on end users. The legacy package is the live source on `@elliemae/ds-legacy-*` dependencies: all 85 exports are present and DOM, ARIA and `data-testid` values match except where a legacy dependency renders differently (accordion header element, tabs swipe-card layer, `aria-disabled="false"` on legacy buttons, multi-select checkbox and infinite-loader test ids); the slot system (`data-dimsum-slot`) is not present in the legacy package. Read the [`@elliemae/ds-mobile` -> `@elliemae/ds-legacy-mobile` migration guide](/?path=/story/resources-migrations-dimsum3-x--ds-mobile-to-ds-legacy-mobile) for the details.
|
|
389
|
+
|
|
390
|
+
What it does NOT rewrite: `require(...)`, dynamic `import(...)`, side-effect `import '<package>'`, `jest.mock(...)`/`jest.requireActual(...)`, TS `import('<package>')` types, bundler alias/externals config, `.md`/`.mdx`/`.cjs`/`.mts`/`.cts` files, `package.json` `optionalDependencies`/`resolutions`/`overrides`/`pnpm.overrides`, `tsconfig` `paths` and lockfiles (run `pnpm i --fix-lockfile` afterwards). Do not run it inside a workspace where the package is a `workspace:*` dependency.
|
|
391
|
+
|
|
392
|
+
### Command
|
|
393
|
+
|
|
394
|
+
`npx @elliemae/ds-codemods legacy-deprecation`
|
|
395
|
+
|
|
396
|
+
### Arguments
|
|
397
|
+
|
|
398
|
+
- `startingDirPath`
|
|
399
|
+
|
|
400
|
+
Please provide the project root directory (where node_modules folder lives), relative to the current working directory
|
|
401
|
+
|
|
402
|
+
default: `'./'`
|
|
403
|
+
|
|
404
|
+
- `gitIgnorePath`
|
|
405
|
+
|
|
406
|
+
Please provide the path to the .gitignore file (if a non-matching path is provided, node_modules, dist and build will be ignored)
|
|
407
|
+
|
|
408
|
+
default: `'./.gitignore'`
|
|
409
|
+
|
|
410
|
+
- `migrations` (CLI Only)
|
|
411
|
+
|
|
412
|
+
A comma separated list of the migrations to run, E.G. `27.2`. Never prompted for. `all` (the default) always wins, even if specific migrations are passed alongside it.
|
|
413
|
+
|
|
414
|
+
default: `'all'`
|
|
415
|
+
|
|
416
|
+
- `debug` (CLI Only)
|
|
417
|
+
|
|
418
|
+
Log the changes that would be made without writing any file
|
|
419
|
+
|
|
420
|
+
default: `false`
|
|
421
|
+
|
|
422
|
+
### Usage
|
|
423
|
+
|
|
424
|
+
- **CLI**
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
npx @elliemae/ds-codemods legacy-deprecation --migrations 27.2 --startingDirPath='./' --gitIgnorePath='./.gitignore'
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
- **Guided CLI**
|
|
431
|
+
|
|
432
|
+
```
|
|
433
|
+
npx @elliemae/ds-codemods legacy-deprecation
|
|
434
|
+
```
|