@elliemae/pui-cli 9.0.0-alpha.3 → 9.0.0-alpha.5
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 +10 -0
- package/dist/cjs/cli.js +2 -0
- package/dist/cjs/commands/skills.js +207 -0
- package/dist/cjs/lint-config/eslint/flat/common.mjs +6 -0
- package/dist/cjs/lint-config/eslint/flat/index.mjs +1 -0
- package/dist/cjs/lint-config/eslint/flat/presets.mjs +15 -0
- package/dist/cjs/lint-config/eslint/flat/rules.mjs +16 -0
- package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
- package/dist/esm/cli.js +2 -0
- package/dist/esm/commands/skills.js +176 -0
- package/dist/esm/lint-config/eslint/flat/common.mjs +6 -0
- package/dist/esm/lint-config/eslint/flat/index.mjs +1 -0
- package/dist/esm/lint-config/eslint/flat/presets.mjs +15 -0
- package/dist/esm/lint-config/eslint/flat/rules.mjs +16 -0
- package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
- package/dist/types/lib/commands/skills.d.ts +11 -0
- package/dist/types/lib/lint-config/eslint/flat/index.d.mts +1 -1
- package/dist/types/lib/lint-config/eslint/flat/presets.d.mts +6 -0
- package/dist/types/lib/lint-config/eslint/flat/rules.d.mts +15 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/lib/lint-config/eslint/flat/common.mjs +6 -0
- package/lib/lint-config/eslint/flat/index.mjs +1 -0
- package/lib/lint-config/eslint/flat/presets.mjs +15 -0
- package/lib/lint-config/eslint/flat/rules.mjs +16 -0
- package/lib/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
- package/package.json +2 -1
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
jestRecommendedRules,
|
|
13
13
|
sharedCoreRules,
|
|
14
14
|
testFiles,
|
|
15
|
+
testFixtureFiles,
|
|
15
16
|
testJsxFiles,
|
|
16
17
|
testingLibraryDomRules,
|
|
17
18
|
testingLibraryReactRules,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
jsRules,
|
|
25
26
|
typescriptRules,
|
|
26
27
|
typescriptStrictRules,
|
|
28
|
+
testFixtureRelaxedRules,
|
|
27
29
|
typescriptTestRelaxedRules,
|
|
28
30
|
} from './rules.mjs';
|
|
29
31
|
|
|
@@ -113,6 +115,10 @@ export function createBaseFlatConfigs(tsRules) {
|
|
|
113
115
|
'testing-library/no-node-access': 'off',
|
|
114
116
|
},
|
|
115
117
|
},
|
|
118
|
+
{
|
|
119
|
+
files: testFixtureFiles,
|
|
120
|
+
rules: testFixtureRelaxedRules,
|
|
121
|
+
},
|
|
116
122
|
{
|
|
117
123
|
files: wdioSpecFiles,
|
|
118
124
|
plugins: { wdio, jest },
|
|
@@ -12,11 +12,26 @@ import storybook from 'eslint-plugin-storybook';
|
|
|
12
12
|
import testingLibrary from 'eslint-plugin-testing-library';
|
|
13
13
|
import wdio from 'eslint-plugin-wdio';
|
|
14
14
|
|
|
15
|
+
/** Application and integration tests (Jest + relaxed type-checked rules). */
|
|
15
16
|
export const testFiles = [
|
|
16
17
|
'**/*.{test,spec}.{js,jsx,ts,tsx}',
|
|
17
18
|
'**/__tests__/**',
|
|
18
19
|
'**/lib/testing/**',
|
|
19
20
|
'**/mocks/**',
|
|
21
|
+
// PUI libs/apps co-locate tests under lib/ (e.g. pui-app-sdk, pui-app-loader).
|
|
22
|
+
'lib/**/tests/**',
|
|
23
|
+
'app/**/tests/**',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Generated or vendored JS under test trees (checksum bundles, MSW endpoints, pinned assets).
|
|
28
|
+
* Not maintained source — relax structural rules only.
|
|
29
|
+
*/
|
|
30
|
+
export const testFixtureFiles = [
|
|
31
|
+
'**/*.checksum*.js',
|
|
32
|
+
'**/*.endpoint.js',
|
|
33
|
+
'**/tests/**/latest/*.{js,cjs,mjs}',
|
|
34
|
+
'**/tests/**/[0-9]*.[0-9]*/*.{js,cjs,mjs}',
|
|
20
35
|
];
|
|
21
36
|
|
|
22
37
|
export const testJsxFiles = ['**/*.{test,spec}.{jsx,tsx}'];
|
|
@@ -49,6 +49,22 @@ export const typescriptTestRelaxedRules = {
|
|
|
49
49
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
50
50
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
51
51
|
'@typescript-eslint/unbound-method': 'off',
|
|
52
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
|
|
53
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
|
54
|
+
'@typescript-eslint/await-thenable': 'off',
|
|
55
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
|
|
56
|
+
'no-constant-binary-expression': 'off',
|
|
57
|
+
'valid-typeof': 'off',
|
|
58
|
+
'prefer-const': 'off',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** Relaxed core rules for generated test fixture JS (checksum mocks, etc.). */
|
|
62
|
+
export const testFixtureRelaxedRules = {
|
|
63
|
+
'no-unused-vars': 'off',
|
|
64
|
+
'no-console': 'off',
|
|
65
|
+
'max-lines': 'off',
|
|
66
|
+
'max-statements': 'off',
|
|
67
|
+
complexity: 'off',
|
|
52
68
|
};
|
|
53
69
|
|
|
54
70
|
export const jsRules = {
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate-to-pui-cli-9
|
|
3
|
+
description: >-
|
|
4
|
+
Migrate a PUI app or library to pui-cli 9 (Node 24, pnpm 11, ESLint 9 flat config).
|
|
5
|
+
Use when upgrading @elliemae/pui-cli, migrating from .eslintrc.cjs to eslint.config.mjs,
|
|
6
|
+
fixing ESLint 9 lint failures, or adopting the shared flat config from pui-cli.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Migrate to pui-cli 9
|
|
10
|
+
|
|
11
|
+
Upgrades a PUI repo from pui-cli 8 (ESLint 8 + `.eslintrc.cjs`) to pui-cli 9
|
|
12
|
+
(ESLint 9 + `eslint.config.mjs` + Node 24 + pnpm 11).
|
|
13
|
+
|
|
14
|
+
## Pre-flight: Toolchain
|
|
15
|
+
|
|
16
|
+
| Requirement | Version |
|
|
17
|
+
| ------------------- | --------------------------------- |
|
|
18
|
+
| Node.js | **24** (see repo `.node-version`) |
|
|
19
|
+
| pnpm | **11** |
|
|
20
|
+
| `@elliemae/pui-cli` | **9.x** (alpha/beta until GA) |
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
fnm use 24 # or nvm/volta equivalent
|
|
24
|
+
corepack enable
|
|
25
|
+
pnpm install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Migration steps (phased PRs recommended)
|
|
29
|
+
|
|
30
|
+
### Phase 1 — Toolchain only
|
|
31
|
+
|
|
32
|
+
1. Update `.node-version` to `24` if needed.
|
|
33
|
+
2. Ensure CI Jenkins/docker images use Node 24.
|
|
34
|
+
3. Upgrade pnpm to 11 (`packageManager` field in root `package.json`).
|
|
35
|
+
4. Run `pnpm install`, `pnpm test`, `pnpm run build` — fix any Node/pnpm breakages only.
|
|
36
|
+
|
|
37
|
+
### Phase 2 — Bump pui-cli
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm add -D @elliemae/pui-cli@9
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Re-run install and smoke-test build/test without ESLint changes yet if the bump is large.
|
|
44
|
+
|
|
45
|
+
### Phase 3 — ESLint 9 flat config
|
|
46
|
+
|
|
47
|
+
**React apps and libraries:**
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
// eslint.config.mjs
|
|
51
|
+
import { eslintFlatConfig } from '@elliemae/pui-cli/eslint';
|
|
52
|
+
|
|
53
|
+
export default eslintFlatConfig;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Node / TS services (non-React):**
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
// eslint.config.mjs
|
|
60
|
+
import { eslintFlatBaseConfig } from '@elliemae/pui-cli/eslint';
|
|
61
|
+
|
|
62
|
+
export default eslintFlatBaseConfig;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then:
|
|
66
|
+
|
|
67
|
+
1. Delete `.eslintrc.cjs` and `.eslintignore` (ignores are in the shared config).
|
|
68
|
+
2. Run `pnpm exec pui-cli lint --fix`.
|
|
69
|
+
3. Run `pnpm exec pui-cli lint` until **zero errors** (warnings may remain).
|
|
70
|
+
|
|
71
|
+
**Strict mode** (only after default config is clean):
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { eslintFlatConfigStrict } from '@elliemae/pui-cli/eslint';
|
|
75
|
+
export default eslintFlatConfigStrict;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Phase 4 — Repo-specific overrides (if needed)
|
|
79
|
+
|
|
80
|
+
Add overrides **after** importing the shared config only when lint debt blocks the migration:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import { eslintFlatConfig } from '@elliemae/pui-cli/eslint';
|
|
84
|
+
|
|
85
|
+
export default [
|
|
86
|
+
...eslintFlatConfig,
|
|
87
|
+
{
|
|
88
|
+
rules: {
|
|
89
|
+
// Temporary: legacy had ~100 no-explicit-any warnings via @typescript-eslint v5
|
|
90
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Remove overrides in a follow-up debt PR. Do not copy Airbnb or legacy `.eslintrc` rules.
|
|
97
|
+
|
|
98
|
+
### Phase 5 — Verify
|
|
99
|
+
|
|
100
|
+
- [ ] `pnpm exec pui-cli lint` — 0 errors
|
|
101
|
+
- [ ] `pnpm exec pui-cli tscheck --files`
|
|
102
|
+
- [ ] `pnpm test`
|
|
103
|
+
- [ ] `pnpm run build` (or `pui-cli build`)
|
|
104
|
+
- [ ] Pre-commit / lint-staged passes
|
|
105
|
+
- [ ] CI green on the target branch
|
|
106
|
+
|
|
107
|
+
## Common lint fixes after upgrade
|
|
108
|
+
|
|
109
|
+
| Symptom | Fix |
|
|
110
|
+
| ------------------------------------ | ---------------------------------------------------------------------- |
|
|
111
|
+
| `import-x/no-unresolved` | Use `import type` for type-only imports |
|
|
112
|
+
| `@typescript-eslint/no-explicit-any` | Type the value or add targeted override (warn) during transition |
|
|
113
|
+
| `@typescript-eslint/no-unused-vars` | Remove or prefix with `_` |
|
|
114
|
+
| Stale `eslint-disable` comments | Remove disables for rules no longer in config |
|
|
115
|
+
| Test/fixture files flagged | Shared config includes `lib/**/tests/**` globs — ensure pui-cli 9.0.0+ |
|
|
116
|
+
| `.d.ts` files | pui-cli turns off `no-explicit-any` for `**/*.d.ts` |
|
|
117
|
+
|
|
118
|
+
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).
|
|
119
|
+
|
|
120
|
+
## Install this skill in Cursor
|
|
121
|
+
|
|
122
|
+
From the consumer repo (after `@elliemae/pui-cli` is installed):
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pnpm exec pui-cli skills install migrate-to-pui-cli-9 --target all
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Skills are copied to `.cursor/skills/`, `.claude/skills/`, and `.github/skills/` for Cursor, Claude Code, and GitHub Copilot.
|
|
129
|
+
|
|
130
|
+
## What NOT to change
|
|
131
|
+
|
|
132
|
+
- Application business logic — migration is tooling/config only
|
|
133
|
+
- Webpack/babel config unless pui-cli 9 release notes require it
|
|
134
|
+
- Prettier / Stylelint / commitlint configs unless pui-cli 9 bumps those presets
|
|
135
|
+
|
|
136
|
+
## Additional resources
|
|
137
|
+
|
|
138
|
+
- [pui-cli 9 migration guide](https://docs.pui.mortgagetech.q1.ice.com/cli/pui-cli-9-migration)
|
|
139
|
+
- [ESLint rules migration guide](https://docs.pui.mortgagetech.q1.ice.com/cli/eslint-rules-migration)
|
|
140
|
+
- Reference one-liner: `pui-react-boilerplate/eslint.config.mjs`
|
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.5",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"dist",
|
|
38
38
|
"build",
|
|
39
39
|
"lib/lint-config",
|
|
40
|
+
"lib/skills",
|
|
40
41
|
"./app.tsconfig.json",
|
|
41
42
|
"./library.tsconfig.json"
|
|
42
43
|
],
|