@plumeria/init 22.0.6 → 22.0.8
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 -6
- package/dist/setup.d.ts +0 -2
- package/dist/setup.js +2 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,11 +13,10 @@ writes. Nothing is installed or patched before you say so.
|
|
|
13
13
|
```
|
|
14
14
|
✔ detected next pnpm typescript
|
|
15
15
|
|
|
16
|
-
➡︎ install @plumeria/core @plumeria/next-plugin @plumeria/eslint-plugin
|
|
16
|
+
➡︎ install @plumeria/core @plumeria/next-plugin @plumeria/eslint-plugin
|
|
17
17
|
+ write plumeria.d.ts sx
|
|
18
18
|
~ patch next.config.ts withPlumeria(...)
|
|
19
19
|
~ patch eslint.config.ts plumeria.configs.recommended
|
|
20
|
-
~ patch package.json predev: rimraf .next, prebuild: rimraf .next
|
|
21
20
|
```
|
|
22
21
|
|
|
23
22
|
## What it detects
|
|
@@ -70,10 +69,7 @@ the `build` script is prefixed with `plumeria-lint --` instead.
|
|
|
70
69
|
- `eslint.config.ts` — `plumeria.configs.recommended` plus the rules that were
|
|
71
70
|
asked for, and `settings.plumeria.styleProp` when the styling prop was renamed. An existing flat config is extended rather than replaced.
|
|
72
71
|
- `package.json` — on esbuild and Bun, `plumeria-lint --` in front of the `build`
|
|
73
|
-
script, with `--style-prop` when the styling prop was renamed
|
|
74
|
-
not read as a compile error. A `pre` script is added only for a script the
|
|
75
|
-
project actually has, and one it already wrote is left alone. Clearing the
|
|
76
|
-
cache is a Next.js concern rather than a lint one, so `--no-eslint` keeps it.
|
|
72
|
+
script, with `--style-prop` when the styling prop was renamed.
|
|
77
73
|
|
|
78
74
|
What counts as already set up is the plugin being *called*, not merely imported.
|
|
79
75
|
A bare `plumeria.version`, and a call inside a comment, a string or a regex
|
package/dist/setup.d.ts
CHANGED
|
@@ -62,6 +62,4 @@ export declare const OXLINT_PLUGIN: {
|
|
|
62
62
|
export declare const OXLINT_RECOMMENDED: Record<string, 'error' | 'warn'>;
|
|
63
63
|
type JsonObject = Record<string, unknown>;
|
|
64
64
|
export declare const oxlintEntries: (answers: Answers) => JsonObject;
|
|
65
|
-
export declare const CLEAN_SCRIPT = "rimraf .next";
|
|
66
|
-
export declare const cleanScripts: (scripts: Record<string, string>) => Record<string, string>;
|
|
67
65
|
export {};
|
package/dist/setup.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.oxlintEntries = exports.OXLINT_RECOMMENDED = exports.OXLINT_PLUGIN = exports.plan = exports.buildScript = exports.installCommand = exports.packages = exports.eslintEntries = exports.eslintSource = exports.bundlerSource = exports.declarationSource = exports.pluginCall = exports.pluginOptions = exports.lintRules = exports.spellingRule = exports.compilerOption = exports.rejectedSpelling = exports.DEFAULT_ANSWERS = exports.assertStyleProp = exports.DEFAULT_STYLE_PROP = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const detect_1 = require("./detect");
|
|
@@ -228,10 +228,6 @@ const packages = (detected, answers) => {
|
|
|
228
228
|
wanted.push('typescript-eslint');
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
if (detected.bundler === 'next' &&
|
|
232
|
-
Object.keys((0, exports.cleanScripts)(detected.manifest.scripts ?? {})).length > 0) {
|
|
233
|
-
wanted.push('rimraf');
|
|
234
|
-
}
|
|
235
231
|
return wanted.filter((name) => !(name in present));
|
|
236
232
|
};
|
|
237
233
|
exports.packages = packages;
|
|
@@ -277,8 +273,7 @@ const plan = (detected, answers) => {
|
|
|
277
273
|
actions.push(bundlerAction(detected, answers));
|
|
278
274
|
if (answers.eslint)
|
|
279
275
|
actions.push(eslintAction(detected, answers));
|
|
280
|
-
if (
|
|
281
|
-
detected.bundler === 'next')
|
|
276
|
+
if (answers.eslint && guardsByScript(detected))
|
|
282
277
|
actions.push(scriptAction(detected, answers));
|
|
283
278
|
return actions;
|
|
284
279
|
};
|
|
@@ -560,18 +555,6 @@ const eslintAction = (detected, answers) => {
|
|
|
560
555
|
snippet: entries.join(',\n'),
|
|
561
556
|
};
|
|
562
557
|
};
|
|
563
|
-
exports.CLEAN_SCRIPT = 'rimraf .next';
|
|
564
|
-
const cleanScripts = (scripts) => {
|
|
565
|
-
const added = {};
|
|
566
|
-
for (const name of ['dev', 'build']) {
|
|
567
|
-
if (scripts[name] === undefined)
|
|
568
|
-
continue;
|
|
569
|
-
if (scripts[`pre${name}`] === undefined)
|
|
570
|
-
added[`pre${name}`] = exports.CLEAN_SCRIPT;
|
|
571
|
-
}
|
|
572
|
-
return added;
|
|
573
|
-
};
|
|
574
|
-
exports.cleanScripts = cleanScripts;
|
|
575
558
|
const scriptAction = (detected, answers) => {
|
|
576
559
|
const source = read(detected, 'package.json');
|
|
577
560
|
const manifest = JSON.parse(source);
|
|
@@ -587,13 +570,6 @@ const scriptAction = (detected, answers) => {
|
|
|
587
570
|
scripts.build = (0, exports.buildScript)(existing, answers.styleProp);
|
|
588
571
|
notes.push(`build: ${scripts.build}`);
|
|
589
572
|
}
|
|
590
|
-
if (detected.bundler === 'next') {
|
|
591
|
-
const added = (0, exports.cleanScripts)(scripts);
|
|
592
|
-
for (const [name, script] of Object.entries(added)) {
|
|
593
|
-
scripts[name] = script;
|
|
594
|
-
notes.push(`${name}: ${script}`);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
573
|
if (notes.length === 0) {
|
|
598
574
|
return {
|
|
599
575
|
kind: 'skip',
|
package/package.json
CHANGED