pob 38.10.0 → 38.12.0
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/lib/generators/app/PobAppGenerator.js +24 -5
- package/lib/generators/app/vite/AppViteGenerator.js +50 -3
- package/lib/generators/app/vite/templates/index.html.ejs +11 -0
- package/lib/generators/app/vite/templates/index.ts.ejs +1 -0
- package/lib/generators/app/vite/templates/vite.config.js.ejs +8 -0
- package/lib/generators/common/babel/templates/app.rollup.config.mjs.ejs +1 -0
- package/lib/generators/common/babel/templates/lib.rollup.config.mjs.ejs +1 -0
- package/lib/generators/common/e2e/CommonE2eGenerator.js +6 -1
- package/lib/generators/common/format-lint/CommonLintGenerator.js +142 -85
- package/lib/generators/common/format-lint/templates/oxfmtrc.jsonc.ejs +1 -0
- package/lib/generators/common/husky/templates/lint-staged.config.js.txt +1 -0
- package/lib/generators/common/release/templates/workflow-release.yml.ejs +2 -1
- package/lib/generators/common/testing/templates/vite.config.js.ejs +1 -0
- package/lib/generators/common/transpiler/templates/app.rollup.config.mjs.ejs +1 -0
- package/lib/generators/common/transpiler/templates/lib.rollup.config.mjs.ejs +1 -0
- package/lib/generators/common/typescript/templates/tsconfig.check-js.json.ejs +1 -0
- package/lib/generators/common/typescript/templates/tsconfig.json.ejs +1 -0
- package/lib/generators/common/typescript/templates/tsconfig.tools.json.ejs +1 -0
- package/lib/generators/core/bun/templates/bunfig.toml.ejs +1 -0
- package/lib/generators/core/ci/templates/github-action-documentation-workflow.yml.ejs +2 -1
- package/lib/generators/core/ci/templates/github-action-push-workflow-split.yml.ejs +6 -5
- package/lib/generators/core/ci/templates/github-action-push-workflow.yml.ejs +2 -1
- package/lib/generators/core/claude/CoreClaudeGenerator.js +1 -1
- package/lib/generators/core/editorconfig/templates/editorconfig +1 -0
- package/lib/generators/core/git/CoreGitGenerator.js +72 -57
- package/lib/generators/core/git/generators/github/CoreGitGithubGenerator.js +192 -145
- package/lib/generators/core/gitignore/templates/gitignore.ejs +1 -0
- package/lib/generators/core/npm/templates/npmignore.ejs +1 -0
- package/lib/generators/core/package/CorePackageGenerator.js +21 -8
- package/lib/generators/core/pnpm/CorePnpmGenerator.js +30 -9
- package/lib/generators/core/vscode/templates/extensions.json.ejs +1 -0
- package/lib/generators/core/vscode/templates/settings.json.ejs +1 -0
- package/lib/generators/core/yarn/templates/yarn_gitignore.ejs +1 -0
- package/lib/generators/lib/doc/LibDocGenerator.js +3 -1
- package/lib/generators/lib/doc/templates/tsconfig.doc.json.ejs +1 -0
- package/lib/generators/lib/doc/templates/tsconfig.doc.json.lerna.ejs +1 -0
- package/lib/generators/lib/readme/LibReadmeGenerator.js +2 -2
- package/lib/generators/monorepo/PobMonorepoGenerator.js +26 -5
- package/lib/generators/monorepo/templates/monorepo.rollup.config.mjs.ejs +1 -0
- package/lib/generators/monorepo/typescript/MonorepoTypescriptGenerator.js +21 -10
- package/lib/generators/monorepo/typescript/templates/tsconfig.json.ejs +1 -0
- package/lib/generators/monorepo/typescript/templates/tsconfig.tools.json.ejs +1 -0
- package/lib/generators/monorepo/workspaces/MonorepoWorkspacesGenerator.js +16 -8
- package/lib/generators/pob/PobBaseGenerator.js +1 -1
- package/lib/pob.js +49 -12
- package/lib/utils/git.js +34 -0
- package/lib/utils/git.test.js +71 -0
- package/lib/utils/workspaceUtils.js +10 -0
- package/lib/utils/workspaceUtils.test.js +15 -0
- package/package.json +13 -13
- package/lib/generators/common/format-lint/templates/eslint.config.js.ejs +0 -5
|
@@ -240,12 +240,14 @@ export default class PobAppGenerator extends Generator {
|
|
|
240
240
|
|
|
241
241
|
const enableHashSlash = shouldEnableHashSlash(this.appConfig.type);
|
|
242
242
|
|
|
243
|
+
this.useTypescript = Boolean(
|
|
244
|
+
typescript ||
|
|
245
|
+
pkg.pob?.typescript === "check-only" ||
|
|
246
|
+
(inMonorepo && inMonorepo.pobMonorepoConfig?.typescript === "check-only"),
|
|
247
|
+
);
|
|
248
|
+
|
|
243
249
|
this.composeWith("pob:common:typescript", {
|
|
244
|
-
enable:
|
|
245
|
-
typescript ||
|
|
246
|
-
pkg.pob?.typescript === "check-only" ||
|
|
247
|
-
(inMonorepo &&
|
|
248
|
-
inMonorepo.pobMonorepoConfig?.typescript === "check-only"),
|
|
250
|
+
enable: this.useTypescript,
|
|
249
251
|
onlyCheck:
|
|
250
252
|
pkg.pob?.typescript === "check-only" ||
|
|
251
253
|
(inMonorepo &&
|
|
@@ -387,6 +389,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
387
389
|
case "vite-with-server":
|
|
388
390
|
this.composeWith("pob:app:vite", {
|
|
389
391
|
enableServer: this.appConfig.type === "vite-with-server",
|
|
392
|
+
packageManager: this.options.packageManager,
|
|
390
393
|
});
|
|
391
394
|
break;
|
|
392
395
|
case "expo":
|
|
@@ -428,6 +431,22 @@ export default class PobAppGenerator extends Generator {
|
|
|
428
431
|
}
|
|
429
432
|
}
|
|
430
433
|
|
|
434
|
+
// consumers and their tools (bundlers, type-aware lint) resolve the
|
|
435
|
+
// package through package.json, not through the tsconfig paths
|
|
436
|
+
if (this.appConfig.type === "untranspiled-library") {
|
|
437
|
+
const entry =
|
|
438
|
+
["ts", "tsx", "js"]
|
|
439
|
+
.map((extension) => `./${srcDirectory}/index.${extension}`)
|
|
440
|
+
.find((path) => this.fs.exists(this.destinationPath(path))) ||
|
|
441
|
+
`./${srcDirectory}/index.${this.useTypescript ? "ts" : "js"}`;
|
|
442
|
+
if (!pkg.main) pkg.main = entry;
|
|
443
|
+
if (!pkg.exports) {
|
|
444
|
+
pkg.exports = { ".": entry };
|
|
445
|
+
} else if (typeof pkg.exports === "object" && !pkg.exports["."]) {
|
|
446
|
+
pkg.exports = { ".": entry, ...pkg.exports };
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
431
450
|
if (this.appConfig.type === "expo") {
|
|
432
451
|
pkg.expo = { install: { exclude: ["typescript"] } };
|
|
433
452
|
} else if (pkg.expo) {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import Generator from "yeoman-generator";
|
|
2
2
|
import * as packageUtils from "../../../utils/package.js";
|
|
3
|
+
import { packageManagerRun } from "../../../utils/packageManagerUtils.js";
|
|
4
|
+
import { copyAndFormatTpl } from "../../../utils/writeAndFormat.js";
|
|
5
|
+
|
|
6
|
+
const viteConfigFileNames = [
|
|
7
|
+
"vite.config.js",
|
|
8
|
+
"vite.config.mjs",
|
|
9
|
+
"vite.config.ts",
|
|
10
|
+
"vite.config.mts",
|
|
11
|
+
];
|
|
3
12
|
|
|
4
13
|
export default class AppViteGenerator extends Generator {
|
|
5
14
|
constructor(args, opts) {
|
|
@@ -8,18 +17,27 @@ export default class AppViteGenerator extends Generator {
|
|
|
8
17
|
type: Boolean,
|
|
9
18
|
default: false,
|
|
10
19
|
});
|
|
20
|
+
|
|
21
|
+
this.option("packageManager", {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "yarn",
|
|
24
|
+
});
|
|
11
25
|
}
|
|
12
26
|
|
|
13
|
-
writing() {
|
|
27
|
+
async writing() {
|
|
14
28
|
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
29
|
+
const run = (script) =>
|
|
30
|
+
packageManagerRun(this.options.packageManager, script);
|
|
31
|
+
|
|
32
|
+
packageUtils.addDevDependencies(pkg, ["vite"]);
|
|
15
33
|
|
|
16
34
|
if (this.options.enableServer) {
|
|
17
35
|
packageUtils.addScripts(pkg, {
|
|
18
|
-
build: "
|
|
36
|
+
build: `${run("build:client")} && ${run("build:server")}`,
|
|
19
37
|
"build:client": "vite build --outDir dist/client",
|
|
20
38
|
"build:server":
|
|
21
39
|
"vite build --ssr src/entry-server.tsx --outDir dist/server",
|
|
22
|
-
preview: "
|
|
40
|
+
preview: `${run("build")} && ${run("start:prod")}`,
|
|
23
41
|
start: "node server.js",
|
|
24
42
|
"start:prod": "NODE_ENV=production node server.js",
|
|
25
43
|
});
|
|
@@ -30,6 +48,35 @@ export default class AppViteGenerator extends Generator {
|
|
|
30
48
|
start: "vite",
|
|
31
49
|
serve: "vite preview",
|
|
32
50
|
});
|
|
51
|
+
|
|
52
|
+
// a new app: the files are never overwritten
|
|
53
|
+
const hasViteConfig = viteConfigFileNames.some((fileName) =>
|
|
54
|
+
this.fs.exists(this.destinationPath(fileName)),
|
|
55
|
+
);
|
|
56
|
+
if (!hasViteConfig) {
|
|
57
|
+
await copyAndFormatTpl(
|
|
58
|
+
this.fs,
|
|
59
|
+
this.templatePath("vite.config.js.ejs"),
|
|
60
|
+
this.destinationPath("vite.config.js"),
|
|
61
|
+
{},
|
|
62
|
+
);
|
|
63
|
+
if (!this.fs.exists(this.destinationPath("src/index.html"))) {
|
|
64
|
+
await copyAndFormatTpl(
|
|
65
|
+
this.fs,
|
|
66
|
+
this.templatePath("index.html.ejs"),
|
|
67
|
+
this.destinationPath("src/index.html"),
|
|
68
|
+
{ name: pkg.name },
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (!this.fs.exists(this.destinationPath("src/index.ts"))) {
|
|
72
|
+
await copyAndFormatTpl(
|
|
73
|
+
this.fs,
|
|
74
|
+
this.templatePath("index.ts.ejs"),
|
|
75
|
+
this.destinationPath("src/index.ts"),
|
|
76
|
+
{ name: pkg.name },
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
33
80
|
}
|
|
34
81
|
|
|
35
82
|
this.fs.writeJSON(this.destinationPath("package.json"), pkg);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title><%= name %></title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<script type="module" src="./index.ts"></script>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
document.body.append("<%= name %>");
|
|
@@ -24,7 +24,12 @@ export default class CommonE2eGenerator extends Generator {
|
|
|
24
24
|
]);
|
|
25
25
|
|
|
26
26
|
packageUtils.addOrRemoveScripts(pkg, this.options.enable, {
|
|
27
|
-
|
|
27
|
+
// keeps the browsers added by hand, like webkit for iPhone projects
|
|
28
|
+
"test:e2e:prepare": pkg.scripts?.["test:e2e:prepare"]?.startsWith(
|
|
29
|
+
"playwright install ",
|
|
30
|
+
)
|
|
31
|
+
? pkg.scripts["test:e2e:prepare"]
|
|
32
|
+
: "playwright install chromium",
|
|
28
33
|
"test:e2e": "playwright test -c e2e/playwright.config.ts",
|
|
29
34
|
});
|
|
30
35
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { format } from "oxfmt";
|
|
2
3
|
import Generator from "yeoman-generator";
|
|
3
4
|
import { quoteArg } from "../../../utils/execUtils.js";
|
|
4
5
|
import inMonorepo from "../../../utils/inMonorepo.js";
|
|
@@ -13,6 +14,48 @@ import {
|
|
|
13
14
|
} from "../../../utils/writeAndFormat.js";
|
|
14
15
|
import { appIgnorePaths } from "../../app/ignorePaths.js";
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} eslintConfigPath
|
|
19
|
+
* @param {{ imports: string[], flatCascade: string[] }} eslintConfig
|
|
20
|
+
*/
|
|
21
|
+
const renderEslintConfig = async (
|
|
22
|
+
eslintConfigPath,
|
|
23
|
+
{ imports, flatCascade },
|
|
24
|
+
) => {
|
|
25
|
+
const { code } = await format(
|
|
26
|
+
eslintConfigPath,
|
|
27
|
+
`${imports.map((value) => `${value};\n`).join("")}
|
|
28
|
+
export default [
|
|
29
|
+
${flatCascade.map((value) => ` ${value},\n`).join("")}];
|
|
30
|
+
`,
|
|
31
|
+
{ printWidth: 80 },
|
|
32
|
+
);
|
|
33
|
+
return code;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether the content is what pob writes for one of the other configs, so it
|
|
38
|
+
* can be updated without losing changes made by hand.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} eslintConfigPath
|
|
41
|
+
* @param {string} content
|
|
42
|
+
* @param {{ imports: string[], flatCascade: string[] }[]} previousEslintConfigs
|
|
43
|
+
*/
|
|
44
|
+
const isPreviousEslintConfigOutput = async (
|
|
45
|
+
eslintConfigPath,
|
|
46
|
+
content,
|
|
47
|
+
previousEslintConfigs,
|
|
48
|
+
) => {
|
|
49
|
+
for (const eslintConfig of previousEslintConfigs) {
|
|
50
|
+
if (
|
|
51
|
+
(await renderEslintConfig(eslintConfigPath, eslintConfig)) === content
|
|
52
|
+
) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
};
|
|
58
|
+
|
|
16
59
|
// same as the base ignores of @pob/eslint-config: ignorePatterns are not
|
|
17
60
|
// inherited through "extends"
|
|
18
61
|
const oxlintBaseIgnorePatterns = [
|
|
@@ -22,6 +65,7 @@ const oxlintBaseIgnorePatterns = [
|
|
|
22
65
|
"**/coverage/",
|
|
23
66
|
"**/.next/",
|
|
24
67
|
"**/.tamagui/",
|
|
68
|
+
"**/.expo/",
|
|
25
69
|
"**/*.d.ts",
|
|
26
70
|
];
|
|
27
71
|
|
|
@@ -102,6 +146,13 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
102
146
|
description: "src directory is root",
|
|
103
147
|
});
|
|
104
148
|
|
|
149
|
+
this.option("workspacesHaveReact", {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
required: false,
|
|
152
|
+
default: false,
|
|
153
|
+
description: "Monorepo root: a workspace package uses react",
|
|
154
|
+
});
|
|
155
|
+
|
|
105
156
|
this.option("appTypes", {
|
|
106
157
|
type: String,
|
|
107
158
|
required: false,
|
|
@@ -162,21 +213,16 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
162
213
|
? this.options.babel === "true"
|
|
163
214
|
: babelEnvs.length > 0;
|
|
164
215
|
const useTypescript = this.options.typescript;
|
|
165
|
-
const
|
|
216
|
+
const isMonorepoRoot =
|
|
217
|
+
this.options.monorepo || Boolean(inMonorepo && inMonorepo.root);
|
|
218
|
+
// a monorepo root lints its packages: it needs the react configs when one
|
|
219
|
+
// of them uses react
|
|
220
|
+
const hasReact =
|
|
221
|
+
useTypescript &&
|
|
222
|
+
(packageUtils.hasReact(pkg) ||
|
|
223
|
+
(isMonorepoRoot && this.options.workspacesHaveReact));
|
|
166
224
|
const useAppConfig = hasReact && this.options.isApp;
|
|
167
225
|
const useNode = !useBabel || babelEnvs.some((env) => env.target === "node");
|
|
168
|
-
const useNodeOnly =
|
|
169
|
-
(!useBabel && !useTypescript) ||
|
|
170
|
-
(useTypescript &&
|
|
171
|
-
(!pkg.pob?.envs ||
|
|
172
|
-
pkg.pob?.envs?.every((env) => env.target === "node")) &&
|
|
173
|
-
(!pkg.pob?.entries ||
|
|
174
|
-
pkg.pob?.entries.every(
|
|
175
|
-
(entry) =>
|
|
176
|
-
typeof entry === "string" ||
|
|
177
|
-
(entry.target && entry.target !== "node"),
|
|
178
|
-
))) ||
|
|
179
|
-
(babelEnvs.length > 0 && babelEnvs.every((env) => env.target === "node"));
|
|
180
226
|
|
|
181
227
|
if (this.fs.exists(this.destinationPath(".eslintignore"))) {
|
|
182
228
|
this.fs.delete(this.destinationPath(".eslintignore"));
|
|
@@ -346,7 +392,11 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
346
392
|
);
|
|
347
393
|
|
|
348
394
|
if ((inMonorepo && inMonorepo.root) || this.options.monorepo) {
|
|
349
|
-
if (
|
|
395
|
+
if (hasReact) {
|
|
396
|
+
packageUtils.addDevDependencies(pkg, [
|
|
397
|
+
"@pob/eslint-config-typescript-react",
|
|
398
|
+
]);
|
|
399
|
+
} else if (this.options.typescript) {
|
|
350
400
|
packageUtils.updateDevDependenciesIfPresent(pkg, [
|
|
351
401
|
"@pob/eslint-config-typescript-react",
|
|
352
402
|
]);
|
|
@@ -374,7 +424,10 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
374
424
|
}
|
|
375
425
|
}
|
|
376
426
|
|
|
377
|
-
|
|
427
|
+
/**
|
|
428
|
+
* @param {boolean} withReact
|
|
429
|
+
*/
|
|
430
|
+
const getEslintConfig = (withReact) => {
|
|
378
431
|
if (pkg.name === "@pob/eslint-config-monorepo") {
|
|
379
432
|
return {
|
|
380
433
|
imports: [
|
|
@@ -387,53 +440,50 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
387
440
|
};
|
|
388
441
|
}
|
|
389
442
|
|
|
443
|
+
const flatCascade = (() => {
|
|
444
|
+
if (!useTypescript) {
|
|
445
|
+
return [
|
|
446
|
+
useNode
|
|
447
|
+
? `...pobConfig.configs.node${pkg.type === "commonjs" ? "Commonjs" : "Module"}`
|
|
448
|
+
: `...pobConfig.configs.base${pkg.type === "commonjs" ? "Commonjs" : "Module"}`,
|
|
449
|
+
];
|
|
450
|
+
}
|
|
451
|
+
if (!withReact) {
|
|
452
|
+
return [
|
|
453
|
+
useNode ? "...pobConfig.configs.node" : "...pobConfig.configs.base",
|
|
454
|
+
];
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
return [
|
|
458
|
+
useNode
|
|
459
|
+
? "...pobTypescriptConfigReact.configs.node"
|
|
460
|
+
: "...pobTypescriptConfigReact.configs.base",
|
|
461
|
+
withReact && this.options.isApp && "...pobConfig.configs.app",
|
|
462
|
+
pkg.dependencies?.["react-native-web"] &&
|
|
463
|
+
'...pobTypescriptConfigReact.configs["react-native-web"]',
|
|
464
|
+
];
|
|
465
|
+
})().filter(Boolean);
|
|
466
|
+
|
|
467
|
+
// non-published typescript (scripts/**/*.ts, root *.config.ts) is
|
|
468
|
+
// type-checked against tsconfig.tools.json rather than any emitting
|
|
469
|
+
// tsconfig.json; point typed lint at that project. The monorepo root
|
|
470
|
+
// owns the shared tsconfig.tools.json (its **/scripts/** glob covers
|
|
471
|
+
// package scripts too), and single repos own their own; in-monorepo
|
|
472
|
+
// packages inherit the root config.
|
|
473
|
+
if ((isMonorepoRoot || !inMonorepo) && useTypescript) {
|
|
474
|
+
flatCascade.push("...pobConfig.configs.toolsProject");
|
|
475
|
+
}
|
|
476
|
+
|
|
390
477
|
return {
|
|
391
478
|
imports: [
|
|
392
479
|
'import pobConfig from "@pob/eslint-config"',
|
|
393
480
|
useTypescript &&
|
|
394
|
-
|
|
481
|
+
withReact &&
|
|
395
482
|
'import pobTypescriptConfigReact from "@pob/eslint-config-typescript-react"',
|
|
396
483
|
].filter(Boolean),
|
|
397
|
-
flatCascade
|
|
398
|
-
// TODO do something with useNodeOnly ?
|
|
399
|
-
console.log({ useNodeOnly });
|
|
400
|
-
|
|
401
|
-
if (!useTypescript) {
|
|
402
|
-
return [
|
|
403
|
-
useNode
|
|
404
|
-
? `...pobConfig.configs.node${pkg.type === "commonjs" ? "Commonjs" : "Module"}`
|
|
405
|
-
: `...pobConfig.configs.base${pkg.type === "commonjs" ? "Commonjs" : "Module"}`,
|
|
406
|
-
];
|
|
407
|
-
}
|
|
408
|
-
if (!hasReact) {
|
|
409
|
-
return [
|
|
410
|
-
useNode
|
|
411
|
-
? "...pobConfig.configs.node"
|
|
412
|
-
: "...pobConfig.configs.base",
|
|
413
|
-
];
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return [
|
|
417
|
-
useNode ? "...pobConfig.configs.node" : "...pobConfig.configs.base",
|
|
418
|
-
useAppConfig && "...pobConfig.configs.app",
|
|
419
|
-
pkg.dependencies?.["react-native-web"] &&
|
|
420
|
-
'...pobTypescriptConfigReact.configs["react-native-web"]',
|
|
421
|
-
];
|
|
422
|
-
})().filter(Boolean),
|
|
484
|
+
flatCascade,
|
|
423
485
|
};
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
const isMonorepoRoot =
|
|
427
|
-
this.options.monorepo || Boolean(inMonorepo && inMonorepo.root);
|
|
428
|
-
// non-published typescript (scripts/**/*.ts, root *.config.ts) is
|
|
429
|
-
// type-checked against tsconfig.tools.json rather than any emitting
|
|
430
|
-
// tsconfig.json; point typed lint at that project. The monorepo root owns
|
|
431
|
-
// the shared tsconfig.tools.json (its **/scripts/** glob covers package
|
|
432
|
-
// scripts too), and single repos own their own; in-monorepo packages
|
|
433
|
-
// inherit the root config.
|
|
434
|
-
if ((isMonorepoRoot || !inMonorepo) && useTypescript) {
|
|
435
|
-
flatCascade.push("...pobConfig.configs.toolsProject");
|
|
436
|
-
}
|
|
486
|
+
};
|
|
437
487
|
|
|
438
488
|
const eslintrcBadPath = this.destinationPath(".eslintrc");
|
|
439
489
|
this.fs.delete(eslintrcBadPath);
|
|
@@ -496,37 +546,44 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
496
546
|
};
|
|
497
547
|
|
|
498
548
|
const ignorePatterns = getRootIgnorePatterns();
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
549
|
+
const eslintConfigContent = await renderEslintConfig(
|
|
550
|
+
eslintConfigPath,
|
|
551
|
+
getEslintConfig(hasReact),
|
|
552
|
+
);
|
|
553
|
+
const existingEslintConfig = this.fs.read(eslintConfigPath, {
|
|
554
|
+
defaults: null,
|
|
555
|
+
});
|
|
556
|
+
if (
|
|
557
|
+
existingEslintConfig === null ||
|
|
558
|
+
// still the output of pob for other options: not edited by hand
|
|
559
|
+
(existingEslintConfig !== eslintConfigContent &&
|
|
560
|
+
(await isPreviousEslintConfigOutput(
|
|
561
|
+
eslintConfigPath,
|
|
562
|
+
existingEslintConfig,
|
|
563
|
+
[
|
|
564
|
+
getEslintConfig(!hasReact),
|
|
565
|
+
// before the react configs were used when react is detected
|
|
566
|
+
hasReact && {
|
|
567
|
+
...getEslintConfig(hasReact),
|
|
568
|
+
flatCascade: getEslintConfig(hasReact).flatCascade.map(
|
|
569
|
+
(config) =>
|
|
570
|
+
config.replace(
|
|
571
|
+
/^\.\.\.pobTypescriptConfigReact\.configs\.(node|base)$/,
|
|
572
|
+
"...pobConfig.configs.$1",
|
|
573
|
+
),
|
|
574
|
+
),
|
|
575
|
+
},
|
|
576
|
+
].filter(Boolean),
|
|
577
|
+
)))
|
|
578
|
+
) {
|
|
579
|
+
this.fs.write(eslintConfigPath, eslintConfigContent);
|
|
580
|
+
} else if (
|
|
581
|
+
hasReact &&
|
|
582
|
+
!existingEslintConfig.includes("@pob/eslint-config-typescript-react")
|
|
583
|
+
) {
|
|
584
|
+
console.warn(
|
|
585
|
+
`${path.basename(eslintConfigPath)} was edited by hand and is not updated: use the configs of @pob/eslint-config-typescript-react to lint react`,
|
|
515
586
|
);
|
|
516
|
-
// TODO
|
|
517
|
-
/* settings: {
|
|
518
|
-
"import/resolver": this.options.enableSrcResolver
|
|
519
|
-
? {
|
|
520
|
-
node: {
|
|
521
|
-
moduleDirectory: [
|
|
522
|
-
"node_modules",
|
|
523
|
-
this.options.srcDirectory,
|
|
524
|
-
],
|
|
525
|
-
},
|
|
526
|
-
}
|
|
527
|
-
: false,
|
|
528
|
-
},
|
|
529
|
-
*/
|
|
530
587
|
}
|
|
531
588
|
|
|
532
589
|
// keeps existing options, only enforces the shared config and ignores.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by pob: do not edit, it is overwritten on each pob run.
|
|
1
2
|
name: Release
|
|
2
3
|
on:
|
|
3
4
|
workflow_dispatch:
|
|
@@ -52,7 +53,7 @@ jobs:
|
|
|
52
53
|
- name: Install pnpm
|
|
53
54
|
uses: pnpm/action-setup@v6
|
|
54
55
|
with:
|
|
55
|
-
version:
|
|
56
|
+
version: 12
|
|
56
57
|
<% } -%>
|
|
57
58
|
|
|
58
59
|
- uses: actions/setup-node@v7
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by pob: do not edit, it is overwritten on each pob run.
|
|
1
2
|
name: 'Create documentation and deploy to Github pages'
|
|
2
3
|
on:
|
|
3
4
|
push:
|
|
@@ -24,7 +25,7 @@ jobs:
|
|
|
24
25
|
- name: Install pnpm
|
|
25
26
|
uses: pnpm/action-setup@v6
|
|
26
27
|
with:
|
|
27
|
-
version:
|
|
28
|
+
version: 12
|
|
28
29
|
|
|
29
30
|
<% } -%>
|
|
30
31
|
- uses: actions/setup-node@v7
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by pob: do not edit, it is overwritten on each pob run.
|
|
1
2
|
name: Push CI
|
|
2
3
|
permissions:
|
|
3
4
|
contents: read
|
|
@@ -25,7 +26,7 @@ jobs:
|
|
|
25
26
|
- name: Install pnpm
|
|
26
27
|
uses: pnpm/action-setup@v6
|
|
27
28
|
with:
|
|
28
|
-
version:
|
|
29
|
+
version: 12
|
|
29
30
|
|
|
30
31
|
<% } -%>
|
|
31
32
|
- uses: actions/setup-node@v7
|
|
@@ -70,7 +71,7 @@ jobs:
|
|
|
70
71
|
- name: Install pnpm
|
|
71
72
|
uses: pnpm/action-setup@v6
|
|
72
73
|
with:
|
|
73
|
-
version:
|
|
74
|
+
version: 12
|
|
74
75
|
|
|
75
76
|
<% } -%>
|
|
76
77
|
- uses: actions/setup-node@v7
|
|
@@ -117,7 +118,7 @@ jobs:
|
|
|
117
118
|
- name: Install pnpm
|
|
118
119
|
uses: pnpm/action-setup@v6
|
|
119
120
|
with:
|
|
120
|
-
version:
|
|
121
|
+
version: 12
|
|
121
122
|
|
|
122
123
|
<% } -%>
|
|
123
124
|
- uses: actions/setup-node@v7
|
|
@@ -183,7 +184,7 @@ jobs:
|
|
|
183
184
|
- name: Install pnpm
|
|
184
185
|
uses: pnpm/action-setup@v6
|
|
185
186
|
with:
|
|
186
|
-
version:
|
|
187
|
+
version: 12
|
|
187
188
|
|
|
188
189
|
<% } -%>
|
|
189
190
|
- uses: actions/setup-node@v7
|
|
@@ -259,7 +260,7 @@ jobs:
|
|
|
259
260
|
- name: Install pnpm
|
|
260
261
|
uses: pnpm/action-setup@v6
|
|
261
262
|
with:
|
|
262
|
-
version:
|
|
263
|
+
version: 12
|
|
263
264
|
|
|
264
265
|
<% } -%>
|
|
265
266
|
- uses: actions/setup-node@v7
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by pob: do not edit, it is overwritten on each pob run.
|
|
1
2
|
name: Push CI
|
|
2
3
|
permissions:
|
|
3
4
|
contents: read
|
|
@@ -28,7 +29,7 @@ jobs:
|
|
|
28
29
|
- name: Install pnpm
|
|
29
30
|
uses: pnpm/action-setup@v6
|
|
30
31
|
with:
|
|
31
|
-
version:
|
|
32
|
+
version: 12
|
|
32
33
|
|
|
33
34
|
<% } -%>
|
|
34
35
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
@@ -26,7 +26,7 @@ export default class CoreClaudeGenerator extends Generator {
|
|
|
26
26
|
|
|
27
27
|
this.fs.write(
|
|
28
28
|
claudeGitignorePath,
|
|
29
|
-
"/settings.local.json\n/skills/local.*\n",
|
|
29
|
+
"# Generated by pob: do not edit, it is overwritten on each pob run.\n/settings.local.json\n/skills/local.*\n",
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
const command =
|