@elliemae/pui-cli 9.0.0-alpha.10 → 9.0.0-alpha.12
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 +2 -1
- package/build/docs/404.html +2 -2
- package/build/docs/api/functions/loadRoutes/index.html +2 -2
- package/build/docs/api/index.html +2 -2
- package/build/docs/api/type-aliases/LIB_NAME/index.html +2 -2
- package/build/docs/api/variables/babelConfig/index.html +2 -2
- package/build/docs/api/variables/commitlintConfig/index.html +2 -2
- package/build/docs/api/variables/eslintBaseConfig/index.html +2 -2
- package/build/docs/api/variables/eslintConfig/index.html +2 -2
- package/build/docs/api/variables/eslintFlatBaseConfig/index.html +2 -2
- package/build/docs/api/variables/eslintFlatBaseConfigStrict/index.html +2 -2
- package/build/docs/api/variables/eslintFlatConfig/index.html +2 -2
- package/build/docs/api/variables/eslintFlatConfigStrict/index.html +2 -2
- package/build/docs/api/variables/jestConfig/index.html +2 -2
- package/build/docs/api/variables/jestNodeConfig/index.html +2 -2
- package/build/docs/api/variables/lintStagedConfig/index.html +2 -2
- package/build/docs/api/variables/prettierConfig/index.html +2 -2
- package/build/docs/api/variables/stylelintConfig/index.html +2 -2
- package/build/docs/api/variables/vitestConfig/index.html +2 -2
- package/build/docs/assets/js/04ee7372.2852111b.js +1 -0
- package/build/docs/assets/js/13097d8d.7877421c.js +1 -0
- package/build/docs/assets/js/4fb6949f.69e375e4.js +1 -0
- package/build/docs/assets/js/{main.00e13c37.js → main.d5acb4ca.js} +2 -2
- package/build/docs/assets/js/{runtime~main.cb214d1a.js → runtime~main.4f7cd700.js} +1 -1
- package/build/docs/eslint-rules-migration/index.html +6 -6
- package/build/docs/index.html +2 -2
- package/build/docs/pui-cli-9-migration/index.html +93 -6
- package/build/docs/ssl-certificate-setup/index.html +2 -2
- package/build/docs/stylelint-migration/index.html +2 -2
- package/build/docs/usage-guide/index.html +4 -4
- package/dist/cjs/commands/storybook.js +33 -4
- package/dist/cjs/lint-config/eslint/flat/compat.mjs +5 -5
- package/dist/cjs/skills/migrate-storybook-out-of-cjs/SKILL.md +188 -0
- package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +131 -18
- package/dist/cjs/testing/jest.config.cjs +5 -1
- package/dist/cjs/testing/setup-textencoder.cjs +4 -0
- package/dist/cjs/webpack/webpack.storybook.js +62 -0
- package/dist/esm/commands/storybook.js +22 -4
- package/dist/esm/lint-config/eslint/flat/compat.mjs +5 -5
- package/dist/esm/skills/migrate-storybook-out-of-cjs/SKILL.md +188 -0
- package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +131 -18
- package/dist/esm/testing/jest.config.cjs +5 -1
- package/dist/esm/testing/setup-textencoder.cjs +4 -0
- package/dist/esm/webpack/webpack.storybook.js +61 -0
- package/dist/types/lib/commands/storybook.d.ts +1 -0
- package/dist/types/lib/lint-config/eslint/flat/compat.d.mts +1 -1
- package/dist/types/lib/testing/setup-textencoder.d.cts +1 -0
- package/dist/types/lib/webpack/webpack.storybook.d.ts +2 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/lib/lint-config/eslint/flat/compat.mjs +5 -5
- package/lib/skills/migrate-storybook-out-of-cjs/SKILL.md +188 -0
- package/lib/skills/migrate-to-pui-cli-9/SKILL.md +131 -18
- package/package.json +18 -25
- package/build/docs/assets/js/04ee7372.eaa386ed.js +0 -1
- package/build/docs/assets/js/13097d8d.c1821d28.js +0 -1
- package/build/docs/assets/js/4fb6949f.369cc1b9.js +0 -1
- /package/build/docs/assets/js/{main.00e13c37.js.LICENSE.txt → main.d5acb4ca.js.LICENSE.txt} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ESLint 10 removed deprecated context APIs (e.g. getSourceCode, getScope, getFilename).
|
|
3
3
|
* Wrap legacy plugins via @eslint/compat v2 (ESLint 10–aware fixupPluginRules).
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { fixupPluginRules } from '@eslint/compat';
|
|
6
6
|
import react from 'eslint-plugin-react';
|
|
7
7
|
import reduxSaga from 'eslint-plugin-redux-saga';
|
|
8
8
|
import storybook from 'eslint-plugin-storybook';
|
|
@@ -20,8 +20,8 @@ export const reactPlugin = fixupPluginRules(react);
|
|
|
20
20
|
/** @type {import('eslint').ESLint.Plugin} */
|
|
21
21
|
export const reduxSagaPlugin = fixupPluginRules(reduxSaga);
|
|
22
22
|
|
|
23
|
-
/** Storybook flat presets —
|
|
23
|
+
/** Storybook flat presets — native flat config (eslint-plugin-storybook@10). */
|
|
24
24
|
/** @type {import('eslint').Linter.Config[]} */
|
|
25
|
-
export const storybookFlatConfigs =
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
export const storybookFlatConfigs = Array.isArray(storybookFlat)
|
|
26
|
+
? storybookFlat
|
|
27
|
+
: [storybookFlat];
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate-storybook-out-of-cjs
|
|
3
|
+
description: >-
|
|
4
|
+
Migrate PUI Storybook from CJS wrappers and @elliemae/pui-app-sdk/storybook/cjs/* to ESM
|
|
5
|
+
(.storybook/*.mjs) and @elliemae/pui-app-sdk/storybook/* imports. Use when upgrading Storybook
|
|
6
|
+
10 with pui-cli 9, replacing require() in .storybook/main.js, removing storybook/cjs/main or
|
|
7
|
+
storybook/cjs/middleware, deleting .storybook/middleware.js, or converting preview/manager/theme
|
|
8
|
+
to ESM.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Migrate Storybook out of CJS
|
|
12
|
+
|
|
13
|
+
Moves consumer repos from legacy CommonJS Storybook wrappers (`require('@elliemae/pui-app-sdk/storybook/cjs/...')`) to ESM (`.storybook/*.mjs` + `@elliemae/pui-app-sdk/storybook/*`).
|
|
14
|
+
|
|
15
|
+
Requires **pui-cli 9** and a matching **pui-app-sdk** release on the same train. The `storybook/cjs/*` package paths are **removed** from pui-app-sdk — repos still on CJS imports will fail at install or runtime.
|
|
16
|
+
|
|
17
|
+
For the full pui-cli 9 upgrade (Node 24, ESLint 10, etc.), install `migrate-to-pui-cli-9` first or in parallel.
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
- `.storybook/main.js` uses `require('@elliemae/pui-app-sdk/storybook/cjs/main')`
|
|
22
|
+
- `.storybook/middleware.js` exists or imports `storybook/cjs/middleware`
|
|
23
|
+
- Storybook fails after bumping pui-app-sdk with “Cannot find module …/storybook/cjs/…”
|
|
24
|
+
- Moving from Storybook 6 CJS config to Storybook 10 ESM config with pui-cli
|
|
25
|
+
|
|
26
|
+
## What changed
|
|
27
|
+
|
|
28
|
+
| Topic | Before (CJS / SB6) | After (ESM / SB10) |
|
|
29
|
+
| ----------------- | ------------------------------------------ | ---------------------------------------------------------------- |
|
|
30
|
+
| Consumer config | `.storybook/main.js` | `.storybook/main.mjs` |
|
|
31
|
+
| Shared import | `@elliemae/pui-app-sdk/storybook/cjs/main` | `@elliemae/pui-app-sdk/storybook/main` |
|
|
32
|
+
| Export name | `getConfig()` (CJS default) | **`getStorybookConfig()`** (named export) |
|
|
33
|
+
| API mocks | `.storybook/middleware.js` | Built into pui-cli Storybook dev server |
|
|
34
|
+
| Preview / manager | `.storybook/preview.js`, `manager.js` | `.storybook/preview.mjs`, `manager.mjs` (when using ESM imports) |
|
|
35
|
+
| CLI | `start-storybook` / `build-storybook` | `pui-cli storybook` → `storybook dev` / `storybook build` |
|
|
36
|
+
| Addons | Installed in consumer `package.json` | Bundled in pui-cli; resolved via pui-app-sdk |
|
|
37
|
+
|
|
38
|
+
## Pre-flight
|
|
39
|
+
|
|
40
|
+
1. Bump `@elliemae/pui-cli@9` and `@elliemae/pui-app-sdk@*` together.
|
|
41
|
+
2. Run `pnpm install`. If using a local `file:` link to pui-app-sdk, reinstall after rebuilding app-sdk so workspace `node_modules` picks up fresh dist.
|
|
42
|
+
3. Confirm the repo uses `pui-cli storybook` (not raw `start-storybook` scripts).
|
|
43
|
+
|
|
44
|
+
## Migration steps
|
|
45
|
+
|
|
46
|
+
### Step 1 — Replace `.storybook/main.js`
|
|
47
|
+
|
|
48
|
+
Delete `main.js`. Create `.storybook/main.mjs`:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
import { getStorybookConfig } from '@elliemae/pui-app-sdk/storybook/main';
|
|
52
|
+
|
|
53
|
+
export default getStorybookConfig();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Do not** use `getConfig` or `require('…/storybook/cjs/main')` — those paths and names are removed.
|
|
57
|
+
|
|
58
|
+
### Step 2 — Remove middleware
|
|
59
|
+
|
|
60
|
+
Delete `.storybook/middleware.js` if present.
|
|
61
|
+
|
|
62
|
+
pui-cli registers mock API routes during `storybook dev`. The deprecated `@elliemae/pui-app-sdk/storybook/middleware` export exists only for repos not yet on pui-cli 9 Storybook — **do not** add it back in new ESM configs.
|
|
63
|
+
|
|
64
|
+
### Step 3 — Convert preview, manager, theme (if customized)
|
|
65
|
+
|
|
66
|
+
If the repo only uses shared pui-app-sdk defaults, you may have no preview file — skip.
|
|
67
|
+
|
|
68
|
+
**Minimal preview** (no custom theme):
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
// .storybook/preview.mjs
|
|
72
|
+
export {
|
|
73
|
+
decorators,
|
|
74
|
+
parameters,
|
|
75
|
+
loaders,
|
|
76
|
+
} from '@elliemae/pui-app-sdk/storybook/preview';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Preview with local theme** (see `pui-react-boilerplate`, `pui-app-sdk`):
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
// .storybook/preview.mjs
|
|
83
|
+
import {
|
|
84
|
+
getParameters,
|
|
85
|
+
loaders,
|
|
86
|
+
decorators,
|
|
87
|
+
} from '@elliemae/pui-app-sdk/storybook/preview';
|
|
88
|
+
import { theme } from './theme.mjs';
|
|
89
|
+
|
|
90
|
+
const parameters = getParameters(theme);
|
|
91
|
+
|
|
92
|
+
export { decorators, parameters, loaders };
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Manager / theme** — convert `manager.js` → `manager.mjs`, `theme.js` → `theme.mjs` when they use `import`/`export`:
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
// .storybook/manager.mjs
|
|
99
|
+
export { managerConfig } from '@elliemae/pui-app-sdk/storybook/manager';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
// .storybook/theme.mjs
|
|
104
|
+
export { theme } from '@elliemae/pui-app-sdk/storybook/theme';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Keep `.storybook/preview-head.html` unchanged.
|
|
108
|
+
|
|
109
|
+
Delete obsolete `.js` duplicates after creating `.mjs` files (`preview.js`, `manager.js`, `theme.js`, `middleware.js`).
|
|
110
|
+
|
|
111
|
+
### Step 4 — Monorepo lib packages (no `app/` directory)
|
|
112
|
+
|
|
113
|
+
pui-app-sdk omits `../app/**` story globs when no `app/` folder exists. If globs still fail, filter explicitly in `main.mjs`:
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
import { getStorybookConfig } from '@elliemae/pui-app-sdk/storybook/main';
|
|
117
|
+
|
|
118
|
+
const config = getStorybookConfig();
|
|
119
|
+
config.stories = config.stories.filter((s) => !s.includes('/app/'));
|
|
120
|
+
|
|
121
|
+
export default config;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Pilot: `pui-mono-repo-boilerplate/libs/foo`.
|
|
125
|
+
|
|
126
|
+
### Step 5 — Stories and types
|
|
127
|
+
|
|
128
|
+
- Prefer CSF3 and `@storybook/react-webpack5` types where TypeScript fails.
|
|
129
|
+
- Remove Storybook 6 webpack alias workarounds (MDX pinning, react-select hacks) unless a story still breaks after upgrade.
|
|
130
|
+
- Consumers do **not** install `@storybook/addon-*` separately — addons resolve from pui-cli via pui-app-sdk.
|
|
131
|
+
|
|
132
|
+
### Step 6 — ESLint
|
|
133
|
+
|
|
134
|
+
Ensure `.storybook/**` is linted. After pui-cli 9 ESLint flat config migration, run `pnpm exec pui-cli lint` on story files.
|
|
135
|
+
|
|
136
|
+
## Verify
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
pnpm exec pui-cli storybook # dev, default port 11000
|
|
140
|
+
pnpm exec pui-cli storybook -b # static build to demo/
|
|
141
|
+
pnpm exec pui-cli storybook -b --docs # docs build
|
|
142
|
+
pnpm exec pui-cli lint
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Checklist:
|
|
146
|
+
|
|
147
|
+
- [ ] No `require('@elliemae/pui-app-sdk/storybook/cjs/…')` anywhere
|
|
148
|
+
- [ ] `.storybook/main.mjs` exists; `main.js` removed
|
|
149
|
+
- [ ] `.storybook/middleware.js` removed (if it existed)
|
|
150
|
+
- [ ] Story dev server starts; mock API routes work without middleware file
|
|
151
|
+
- [ ] Static build succeeds
|
|
152
|
+
|
|
153
|
+
## Troubleshooting
|
|
154
|
+
|
|
155
|
+
| Symptom | Fix |
|
|
156
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
157
|
+
| `Cannot find module '…/storybook/cjs/main'` | Migrate to `@elliemae/pui-app-sdk/storybook/main` in `main.mjs` |
|
|
158
|
+
| `getConfig is not a function` | Use named import **`getStorybookConfig`**, not `getConfig` |
|
|
159
|
+
| `Can't resolve './app'` in lib-only package | Use conditional globs in app-sdk or filter `config.stories` in `main.mjs` |
|
|
160
|
+
| `Failed to load native binding` / SWC errors | Rebuild pui-app-sdk; reinstall workspace; Babel compiler addon is bundled via pui-cli |
|
|
161
|
+
| “Using default Webpack5 setup” (no Babel) | Refresh pnpm install after bumping `file:` pui-cli / pui-app-sdk links |
|
|
162
|
+
| API mocks missing | Delete middleware file; use `pui-cli storybook` (not legacy CLI) |
|
|
163
|
+
| Stale app-sdk in monorepo | `pnpm install --ignore-scripts` after rebuilding linked packages |
|
|
164
|
+
|
|
165
|
+
## Reference repos
|
|
166
|
+
|
|
167
|
+
- `pui-react-boilerplate` — app with `app/` stories
|
|
168
|
+
- `pui-mono-repo-boilerplate/libs/foo` — lib-only package
|
|
169
|
+
- `pui-app-sdk/.storybook/` — dogfood ESM wrappers
|
|
170
|
+
|
|
171
|
+
Full guide: [pui-cli 9 migration — Storybook 10](https://docs.pui.mortgagetech.q1.ice.com/cli/pui-cli-9-migration) (`docs/pui-cli-9-migration.md` in pui-cli).
|
|
172
|
+
|
|
173
|
+
## Install this skill
|
|
174
|
+
|
|
175
|
+
From a consumer repo (after `@elliemae/pui-cli` is installed):
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
pnpm exec pui-cli skills list
|
|
179
|
+
pnpm exec pui-cli skills install migrate-storybook-out-of-cjs --target all
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Skills are copied to `.cursor/skills/`, `.claude/skills/`, and `.github/skills/`.
|
|
183
|
+
|
|
184
|
+
## What NOT to change
|
|
185
|
+
|
|
186
|
+
- Production Webpack build config — Storybook migration is dev/docs tooling only
|
|
187
|
+
- Business logic in stories unless types or CSF3 require it
|
|
188
|
+
- Do not re-add `@storybook/*` addon packages to consumer `package.json` unless pui-cli docs explicitly require an exception
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
name: migrate-to-pui-cli-9
|
|
3
3
|
description: >-
|
|
4
4
|
Migrate a PUI app or library to pui-cli 9 (Node 24, pnpm 11, ESLint 10 flat config, Stylelint 17,
|
|
5
|
-
Husky 9, Vitest 4, semantic-release 25). Use when upgrading @elliemae/pui-cli,
|
|
6
|
-
.eslintrc.cjs to eslint.config.mjs, release.config.cjs to release.config.mjs,
|
|
7
|
-
hooks, fixing Vitest 4 / coverage-v8 breakages,
|
|
8
|
-
|
|
5
|
+
Husky 9, Vitest 4, semantic-release 25, Lerna 9, Nx 22). Use when upgrading @elliemae/pui-cli,
|
|
6
|
+
migrating from .eslintrc.cjs to eslint.config.mjs, release.config.cjs to release.config.mjs,
|
|
7
|
+
upgrading Husky 8 hooks, fixing Vitest 4 / coverage-v8 breakages, migrating monorepo nx.json from
|
|
8
|
+
@nrwl/workspace to nx 22, moving shamefully-hoist from .npmrc to pnpm-workspace.yaml for pnpm 11,
|
|
9
|
+
or adopting shared configs from pui-cli. App/library production builds stay on Webpack.
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
# Migrate to pui-cli 9
|
|
@@ -34,9 +35,46 @@ pnpm install
|
|
|
34
35
|
|
|
35
36
|
1. Update `.node-version` to `24` if needed.
|
|
36
37
|
2. Ensure CI Jenkins/docker images use Node 24.
|
|
37
|
-
3. Upgrade pnpm to 11
|
|
38
|
+
3. Upgrade pnpm to 11 — set `engines.pnpm` to `>=11` in root `package.json` (do not pin an exact version in `packageManager`; customers may use any pnpm 11 minor/patch).
|
|
38
39
|
4. Run `pnpm install`, `pnpm test`, `pnpm run build` — fix any Node/pnpm breakages only.
|
|
39
40
|
|
|
41
|
+
### Phase 1b — pnpm 11 hoisting (`pnpm-workspace.yaml`)
|
|
42
|
+
|
|
43
|
+
**Required for every repo** (apps, libs, monorepos). pnpm 11 ignores hoist settings in `.npmrc`.
|
|
44
|
+
|
|
45
|
+
1. **Keep org hoisting policy** — set `shamefullyHoist: true` in `pnpm-workspace.yaml` (same as legacy `shamefully-hoist=true`). Do not switch to isolated/no-hoist; PUI apps use `@elliemae/app-react-dependencies` and pui-cli webpack `getAlias()` expects deps at repo root `node_modules/`.
|
|
46
|
+
|
|
47
|
+
2. **Create or update `pnpm-workspace.yaml`** at the repo root. Move settings out of `.npmrc` using camelCase:
|
|
48
|
+
|
|
49
|
+
| `.npmrc` (ignored by pnpm 11) | `pnpm-workspace.yaml` |
|
|
50
|
+
| --------------------------------- | ----------------------------- |
|
|
51
|
+
| `shamefully-hoist=true` | `shamefullyHoist: true` |
|
|
52
|
+
| `public-hoist-pattern[]=…` | `publicHoistPattern: [ "…" ]` |
|
|
53
|
+
| `strict-peer-dependencies` | `strictPeerDependencies` |
|
|
54
|
+
| `auto-install-peers` | `autoInstallPeers` |
|
|
55
|
+
| `package.json` `"pnpm".overrides` | top-level `overrides:` |
|
|
56
|
+
|
|
57
|
+
3. **Single-package repo** — include `packages: ['.']`. Reference: `pui-react-boilerplate/pnpm-workspace.yaml`.
|
|
58
|
+
|
|
59
|
+
4. **Monorepo** — include `packages: ["libs/*", "apps/*"]`. Optional explicit `publicHoistPattern` for webpack alias targets: `esbuild-loader`, `@elliemae/*`, `styled-components`, `history`, `lodash`. Reference: `pui-microfe/pnpm-workspace.yaml`.
|
|
60
|
+
|
|
61
|
+
5. **Migrate `allowBuilds`** — replace `onlyBuiltDependencies` / placeholder `allowBuilds` entries with `true` for packages that need postinstall scripts (`@swc/core`, `esbuild`, `nx`, etc.). Fix `ERR_PNPM_IGNORED_BUILDS`.
|
|
62
|
+
|
|
63
|
+
6. **Trim `.npmrc`** — keep auth/registry only (for example `legacy-peer-deps=true`).
|
|
64
|
+
|
|
65
|
+
7. **Clean reinstall and verify:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
rm -rf node_modules libs/*/node_modules # if monorepo
|
|
69
|
+
SKIP_POST_INSTALL_BUILD=1 pnpm install --no-frozen-lockfile
|
|
70
|
+
grep publicHoistPattern node_modules/.modules.yaml # must NOT be []
|
|
71
|
+
pnpm run build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Symptoms if skipped:** `Can't resolve 'esbuild-loader'` / `styled-components` / `@elliemae/pui-theme` during webpack; `publicHoistPattern: []` in `.modules.yaml`.
|
|
75
|
+
|
|
76
|
+
See migration guide section **1b. Migrate pnpm hoisting to `pnpm-workspace.yaml`**.
|
|
77
|
+
|
|
40
78
|
### Phase 2 — Bump pui-cli
|
|
41
79
|
|
|
42
80
|
```bash
|
|
@@ -221,29 +259,103 @@ export default {
|
|
|
221
259
|
|
|
222
260
|
5. Dry-run: `pnpm exec semantic-release --dry-run`
|
|
223
261
|
|
|
224
|
-
### Phase 9 —
|
|
262
|
+
### Phase 9 — Lerna 9 and Nx 22 (monorepos only)
|
|
263
|
+
|
|
264
|
+
Skip for single-package apps/libs. Applies to repos with `lerna.json`, `nx.json`, and `libs/*` workspaces.
|
|
265
|
+
|
|
266
|
+
1. After `@elliemae/pui-cli@9` is installed, confirm CLIs:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
pnpm install
|
|
270
|
+
pnpm exec nx --version # 22.x
|
|
271
|
+
pnpm exec lerna --version # 9.x
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
2. Remove legacy pins if present (`@nrwl/cli`, `@nrwl/tao`, `@nrwl/workspace`, direct `lerna`/`nx`).
|
|
275
|
+
|
|
276
|
+
3. Migrate `nx.json`:
|
|
277
|
+
- `extends`: `@nrwl/workspace/presets/npm.json` → `nx/presets/npm.json`
|
|
278
|
+
- Add `$schema`: `./node_modules/nx/schemas/nx-schema.json`
|
|
279
|
+
- Replace `targetDependencies` with `targetDefaults.<target>.dependsOn` (use `^target` for dependency projects)
|
|
280
|
+
- Remove `tasksRunnerOptions`; move cacheable targets to `"cache": true` in `targetDefaults`
|
|
281
|
+
- Optional: `pnpm exec nx migrate latest && pnpm exec nx migrate --run-migrations`
|
|
282
|
+
|
|
283
|
+
4. Lerna 9: stop using `lerna bootstrap` / `lerna add` / `lerna link` — use pnpm workspaces. Keep existing `lerna.json` unless it referenced removed commands. `pui-cli version` unchanged.
|
|
284
|
+
|
|
285
|
+
5. Smoke-test:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
pnpm exec nx run-many --target=build --all --parallel
|
|
289
|
+
pnpm exec nx affected --target=lint --uncommitted
|
|
290
|
+
pnpm exec pui-cli lint
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
See [pui-cli 9 migration guide](https://docs.pui.mortgagetech.q1.ice.com/cli/pui-cli-9-migration) — **Lerna 9 and Nx 22** section for the full `nx.json` template.
|
|
294
|
+
|
|
295
|
+
### Phase 11 — Storybook 10 (out of CJS)
|
|
296
|
+
|
|
297
|
+
Applies when the repo uses `pui-cli storybook`. Requires pui-cli 9 **and** a matching pui-app-sdk release.
|
|
298
|
+
|
|
299
|
+
Install the dedicated skill for agents:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
pnpm exec pui-cli skills install migrate-storybook-out-of-cjs --target all
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Follow **`migrate-storybook-out-of-cjs`** for the full CJS → ESM playbook (`storybook/cjs/*` removed; use `.storybook/main.mjs` + `getStorybookConfig()`). Summary:
|
|
306
|
+
|
|
307
|
+
1. Bump `@elliemae/pui-app-sdk` with `@elliemae/pui-cli@9`.
|
|
308
|
+
2. Replace `.storybook/main.js` with `.storybook/main.mjs` importing `@elliemae/pui-app-sdk/storybook/main`.
|
|
309
|
+
3. Delete `.storybook/middleware.js`; migrate `preview` / `manager` / `theme` to `.mjs` when customized.
|
|
310
|
+
4. Update stories to CSF3 where types fail; remove SB6 webpack alias workarounds unless still required.
|
|
311
|
+
|
|
312
|
+
Verify:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
pnpm exec pui-cli storybook
|
|
316
|
+
pnpm exec pui-cli storybook -b
|
|
317
|
+
pnpm exec pui-cli lint
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
See [pui-cli 9 migration guide — Storybook 10](https://docs.pui.mortgagetech.q1.ice.com/cli/pui-cli-9-migration) for addon removals and troubleshooting.
|
|
321
|
+
|
|
322
|
+
### Phase 10 — Verify
|
|
225
323
|
|
|
324
|
+
- [ ] `shamefullyHoist` in `pnpm-workspace.yaml` (not `.npmrc`); `publicHoistPattern` not `[]` in `.modules.yaml`
|
|
226
325
|
- [ ] `pnpm exec pui-cli lint` — 0 errors
|
|
227
326
|
- [ ] `pnpm exec pui-cli tscheck --files`
|
|
228
327
|
- [ ] `pnpm test` (or `pui-cli vitest` if applicable)
|
|
229
328
|
- [ ] `pnpm run build` (or `pui-cli build`) — Webpack, unchanged
|
|
230
329
|
- [ ] Pre-commit / lint-staged passes (after Husky 9 migration if applicable)
|
|
330
|
+
- [ ] Monorepos: `nx run-many --target=build --all` and `pui-cli version --help`
|
|
231
331
|
- [ ] CI green on the target branch
|
|
232
332
|
|
|
233
333
|
## Common lint fixes after upgrade
|
|
234
334
|
|
|
235
|
-
| Symptom
|
|
236
|
-
|
|
|
237
|
-
| `import-x/no-unresolved`
|
|
238
|
-
| `@typescript-eslint/no-explicit-any`
|
|
239
|
-
| `@typescript-eslint/no-unused-vars`
|
|
240
|
-
| Stale `eslint-disable` comments
|
|
241
|
-
| Test/fixture files flagged
|
|
242
|
-
| `.d.ts` files
|
|
243
|
-
| Cannot find module `vite` in tscheck
|
|
244
|
-
| Vitest `optimizer.web` unknown
|
|
245
|
-
| Coverage fails after upgrade
|
|
246
|
-
| `release.config.cjs` extends fails
|
|
335
|
+
| Symptom | Fix |
|
|
336
|
+
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
337
|
+
| `import-x/no-unresolved` | Use `import type` for type-only imports |
|
|
338
|
+
| `@typescript-eslint/no-explicit-any` | Type the value or add targeted override (warn) during transition |
|
|
339
|
+
| `@typescript-eslint/no-unused-vars` | Remove or prefix with `_` |
|
|
340
|
+
| Stale `eslint-disable` comments | Remove disables for rules no longer in config |
|
|
341
|
+
| Test/fixture files flagged | Shared config includes `lib/**/tests/**` globs — ensure pui-cli 9.0.0+ |
|
|
342
|
+
| `.d.ts` files | pui-cli turns off `no-explicit-any` for `**/*.d.ts` |
|
|
343
|
+
| Cannot find module `vite` in tscheck | Set `moduleResolution: "bundler"` or extend pui-cli 9 tsconfig |
|
|
344
|
+
| Vitest `optimizer.web` unknown | Rename to `test.deps.optimizer.client` (Vitest 4) |
|
|
345
|
+
| Coverage fails after upgrade | Remove `@vitest/coverage-c8`; use `@vitest/coverage-v8@4` |
|
|
346
|
+
| `release.config.cjs` extends fails | Migrate to `release.config.mjs`; requires semantic-release 22+ (pui-cli 9 ships 25) |
|
|
347
|
+
| `nx` fails after pui-cli 9 bump | Migrate `nx.json` off `@nrwl/*`; use `targetDefaults` not `targetDependencies` |
|
|
348
|
+
| `lerna bootstrap` / `add` / `link` | Removed in lerna 9 — use `pnpm` workspaces and `pnpm add --filter` |
|
|
349
|
+
| Stale `@nrwl/workspace` in lockfile | Remove direct `@nrwl/*` pins; rely on pui-cli's `nx` + `@nx/workspace` |
|
|
350
|
+
| `Can't resolve 'esbuild-loader'` | Move `shamefullyHoist: true` to `pnpm-workspace.yaml`; clean reinstall |
|
|
351
|
+
| `Can't resolve 'styled-components'` / `@elliemae/pui-theme` | Same — hoisting ignored if still only in `.npmrc` |
|
|
352
|
+
| `publicHoistPattern: []` in `.modules.yaml` | Migrate hoist settings from `.npmrc` to `pnpm-workspace.yaml` |
|
|
353
|
+
| `ERR_PNPM_IGNORED_BUILDS` | Set real `allowBuilds` in `pnpm-workspace.yaml` or run `pnpm approve-builds` |
|
|
354
|
+
| `husky: command not found` on prepare | `shamefullyHoist` + `publicHoistPattern: [husky]` or direct root `devDependency` |
|
|
355
|
+
| Storybook fails after pui-cli 9 bump | Migrate `.storybook/main.js` → `main.mjs`; import `@elliemae/pui-app-sdk/storybook/main` |
|
|
356
|
+
| `Failed to load native binding` / SWC errors | Ensure pui-app-sdk resolves Babel compiler from pui-cli; rebuild app-sdk and reinstall workspace deps |
|
|
357
|
+
| `middleware.js` ignored / API mocks missing | Delete middleware file; pui-cli Storybook dev server loads routes automatically |
|
|
358
|
+
| Jest `TextEncoder is not defined` | Built into pui-cli `jestConfig` — remove repo `jest-textencoder-setup.cjs`; keep `delete moduleNameMapper['@elliemae/pui-diagnostics']` only if using real package |
|
|
247
359
|
|
|
248
360
|
Full rule comparison: [eslint-rules-migration.md](https://docs.pui.mortgagetech.q1.ice.com/cli/eslint-rules-migration) (also at `docs/eslint-rules-migration.md` in pui-cli).
|
|
249
361
|
|
|
@@ -262,6 +374,7 @@ Skills are copied to `.cursor/skills/`, `.claude/skills/`, and `.github/skills/`
|
|
|
262
374
|
- Application business logic — migration is tooling/config only
|
|
263
375
|
- Webpack/babel production build config — pui-cli 9 does not migrate apps to Vite for bundling
|
|
264
376
|
- Prettier / commitlint configs unless pui-cli 9 bumps those presets
|
|
377
|
+
- **Org hoisting policy** — keep `shamefullyHoist: true`; do not remove hoisting or duplicate webpack deps in root `package.json` as a workaround
|
|
265
378
|
|
|
266
379
|
## Additional resources
|
|
267
380
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.12",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"default": "./lib/release.config.mjs"
|
|
21
21
|
},
|
|
22
22
|
"./storybook": {
|
|
23
|
+
"types": "./dist/types/lib/webpack/webpack.storybook.d.ts",
|
|
24
|
+
"import": "./dist/esm/webpack/webpack.storybook.js",
|
|
23
25
|
"require": "./dist/cjs/webpack/webpack.storybook.js"
|
|
24
26
|
},
|
|
25
27
|
"./vitest": {
|
|
@@ -88,30 +90,23 @@
|
|
|
88
90
|
"@babel/preset-react": "~7.29.7",
|
|
89
91
|
"@babel/preset-typescript": "~7.29.7",
|
|
90
92
|
"@babel/runtime": "~7.29.7",
|
|
91
|
-
"@commitlint/cli": "21.0.
|
|
92
|
-
"@commitlint/config-conventional": "21.0.
|
|
93
|
+
"@commitlint/cli": "21.0.2",
|
|
94
|
+
"@commitlint/config-conventional": "21.0.2",
|
|
93
95
|
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.15.0",
|
|
94
96
|
"@eslint/compat": "~2.1.0",
|
|
95
97
|
"@eslint/js": "~10.0.1",
|
|
96
98
|
"@faker-js/faker": "~7.6.0",
|
|
97
|
-
"@
|
|
98
|
-
"
|
|
99
|
-
"@nrwl/workspace": "~15.9.7",
|
|
99
|
+
"@nx/workspace": "~22.7.5",
|
|
100
|
+
"nx": "~22.7.5",
|
|
100
101
|
"@pmmmwh/react-refresh-webpack-plugin": "~0.6.2",
|
|
101
102
|
"@semantic-release/changelog": "~6.0.3",
|
|
102
103
|
"@semantic-release/exec": "~7.1.0",
|
|
103
104
|
"@semantic-release/git": "~10.0.1",
|
|
104
|
-
"@storybook/addon-a11y": "~
|
|
105
|
-
"@storybook/addon-
|
|
106
|
-
"@storybook/addon-
|
|
107
|
-
"@storybook/
|
|
108
|
-
"
|
|
109
|
-
"@storybook/addon-storysource": "~6.5.16",
|
|
110
|
-
"@storybook/builder-vite": "~0.4.2",
|
|
111
|
-
"@storybook/builder-webpack5": "~6.5.16",
|
|
112
|
-
"@storybook/manager-webpack5": "~6.5.16",
|
|
113
|
-
"@storybook/react": "~6.5.16",
|
|
114
|
-
"@storybook/theming": "~6.5.16",
|
|
105
|
+
"@storybook/addon-a11y": "~10.4.0",
|
|
106
|
+
"@storybook/addon-docs": "~10.4.0",
|
|
107
|
+
"@storybook/addon-webpack5-compiler-babel": "~4.0.1",
|
|
108
|
+
"@storybook/react-webpack5": "~10.4.0",
|
|
109
|
+
"storybook": "~10.4.0",
|
|
115
110
|
"@svgr/webpack": "~7.0.0",
|
|
116
111
|
"@swc/cli": "~0.8.1",
|
|
117
112
|
"@swc/core": "1.15.40",
|
|
@@ -133,7 +128,7 @@
|
|
|
133
128
|
"@types/lodash": "~4.17.24",
|
|
134
129
|
"@types/minimist": "~1.2.5",
|
|
135
130
|
"@types/moment-locales-webpack-plugin": "~1.2.6",
|
|
136
|
-
"@types/node": "~24.
|
|
131
|
+
"@types/node": "~24.13.1",
|
|
137
132
|
"@types/normalize-path": "~3.0.2",
|
|
138
133
|
"@types/postcss-preset-env": "~7.7.0",
|
|
139
134
|
"@types/rimraf": "~3.0.2",
|
|
@@ -176,7 +171,7 @@
|
|
|
176
171
|
"dotenv": "~17.4.2",
|
|
177
172
|
"dotenv-webpack": "~8.1.1",
|
|
178
173
|
"duplicate-package-checker-webpack-plugin": "~3.0.0",
|
|
179
|
-
"enhanced-resolve": "~5.
|
|
174
|
+
"enhanced-resolve": "~5.23.0",
|
|
180
175
|
"esbuild": "~0.28.0",
|
|
181
176
|
"esbuild-loader": "~3.2.0",
|
|
182
177
|
"esbuild-plugin-svgr": "~1.1.0",
|
|
@@ -190,7 +185,7 @@
|
|
|
190
185
|
"eslint-plugin-react": "~7.37.5",
|
|
191
186
|
"eslint-plugin-react-hooks": "~7.1.1",
|
|
192
187
|
"eslint-plugin-redux-saga": "~1.3.2",
|
|
193
|
-
"eslint-plugin-storybook": "~
|
|
188
|
+
"eslint-plugin-storybook": "~10.4.0",
|
|
194
189
|
"eslint-plugin-testing-library": "~7.16.2",
|
|
195
190
|
"eslint-plugin-wdio": "~9.27.2",
|
|
196
191
|
"execa": "~9.6.1",
|
|
@@ -219,7 +214,7 @@
|
|
|
219
214
|
"jest-watch-typeahead": "~2.2.2",
|
|
220
215
|
"jscodeshift": "~0.16.1",
|
|
221
216
|
"jsdoc": "~4.0.5",
|
|
222
|
-
"lerna": "~
|
|
217
|
+
"lerna": "~9.0.7",
|
|
223
218
|
"lint-staged": "~17.0.7",
|
|
224
219
|
"lodash": "~4.18.1",
|
|
225
220
|
"mini-css-extract-plugin": "~2.10.2",
|
|
@@ -227,7 +222,7 @@
|
|
|
227
222
|
"moment": "~2.30.1",
|
|
228
223
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
229
224
|
"msw": "~1.3.5",
|
|
230
|
-
"node-gyp": "~12.
|
|
225
|
+
"node-gyp": "~12.4.0",
|
|
231
226
|
"node-plop": "~0.32.3",
|
|
232
227
|
"nodemon": "~3.1.14",
|
|
233
228
|
"normalize-path": "~3.0.0",
|
|
@@ -257,10 +252,8 @@
|
|
|
257
252
|
"semantic-release": "~25.0.3",
|
|
258
253
|
"slackify-markdown": "~4.5.0",
|
|
259
254
|
"speed-measure-webpack-plugin": "~1.6.0",
|
|
260
|
-
"storybook-addon-turbo-build": "~1.1.0",
|
|
261
|
-
"storybook-react-router": "~1.0.8",
|
|
262
255
|
"style-loader": "~3.3.4",
|
|
263
|
-
"stylelint": "~17.
|
|
256
|
+
"stylelint": "~17.13.0",
|
|
264
257
|
"stylelint-config-recommended": "~18.0.0",
|
|
265
258
|
"supertest": "~6.3.4",
|
|
266
259
|
"swc-loader": "~0.2.7",
|