pob 28.3.0 → 29.0.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/lib/generators/app/PobAppGenerator.js +26 -14
  3. package/lib/generators/app/ignorePaths.js +1 -1
  4. package/lib/generators/app/vite/AppViteGenerator.js +17 -0
  5. package/lib/generators/common/babel/CommonBabelGenerator.js +14 -7
  6. package/lib/generators/common/release/CommonReleaseGenerator.js +2 -0
  7. package/lib/generators/common/release/templates/workflow-release.yml.ejs +1 -1
  8. package/lib/generators/common/testing/CommonTestingGenerator.js +3 -26
  9. package/lib/generators/common/transpiler/CommonTranspilerGenerator.js +165 -110
  10. package/lib/generators/common/typescript/CommonTypescriptGenerator.js +12 -5
  11. package/lib/generators/common/typescript/templates/tsconfig.check-js.json.ejs +1 -1
  12. package/lib/generators/common/typescript/templates/tsconfig.json.ejs +6 -4
  13. package/lib/generators/core/ci/CoreCIGenerator.js +4 -1
  14. package/lib/generators/core/ci/templates/github-action-documentation-workflow.yml.ejs +1 -1
  15. package/lib/generators/core/ci/templates/github-action-push-workflow-split.yml.ejs +9 -9
  16. package/lib/generators/core/ci/templates/github-action-push-workflow.yml.ejs +11 -11
  17. package/lib/generators/core/git/CoreGitGenerator.js +7 -0
  18. package/lib/generators/core/git/generators/github/CoreGitGithubGenerator.js +8 -6
  19. package/lib/generators/core/package/CorePackageGenerator.js +3 -3
  20. package/lib/generators/core/yarn/CoreYarnGenerator.js +2 -2
  21. package/lib/generators/lib/PobLibGenerator.js +15 -14
  22. package/lib/generators/monorepo/PobMonorepoGenerator.js +1 -0
  23. package/lib/generators/monorepo/typescript/MonorepoTypescriptGenerator.js +7 -16
  24. package/lib/generators/pob/PobBaseGenerator.js +24 -1
  25. package/lib/pob.js +6 -0
  26. package/lib/utils/nodeVersions.js +2 -0
  27. package/package.json +12 -12
  28. package/lib/generators/common/testing/templates/tsconfig.test.json.ejs +0 -10
  29. package/lib/utils/node.js +0 -2
@@ -25,6 +25,12 @@ export default class CoreGitGenerator extends Generator {
25
25
  required: true,
26
26
  description: "split CI jobs for faster result",
27
27
  });
28
+
29
+ this.option("ciEnabled", {
30
+ type: Boolean,
31
+ required: true,
32
+ description: "ci enabled",
33
+ });
28
34
  }
29
35
 
30
36
  async initializing() {
@@ -107,6 +113,7 @@ export default class CoreGitGenerator extends Generator {
107
113
  repoName: this.repoName,
108
114
  onlyLatestLTS: this.options.onlyLatestLTS,
109
115
  splitCIJobs: this.options.splitCIJobs,
116
+ ciEnabled: this.options.ciEnabled,
110
117
  });
111
118
  }
112
119
  }
@@ -212,12 +212,14 @@ export default class CoreGitGithubGenerator extends Generator {
212
212
  ...githubRepoConfig,
213
213
  });
214
214
 
215
- await configureProtectionRule(
216
- owner,
217
- repo,
218
- this.options.onlyLatestLTS,
219
- this.spawnCommandSync.bind(this),
220
- );
215
+ if (this.options.ci) {
216
+ await configureProtectionRule(
217
+ owner,
218
+ repo,
219
+ this.options.onlyLatestLTS,
220
+ this.spawnCommandSync.bind(this),
221
+ );
222
+ }
221
223
  }
222
224
  }
223
225
  }
@@ -60,15 +60,15 @@ export default class CorePackageGenerator extends Generator {
60
60
  !pkg.engines.node ||
61
61
  !(
62
62
  pkg.engines.node.startsWith(">=22.") ||
63
- pkg.engines.node.startsWith(">=20.")
63
+ pkg.engines.node.startsWith(">=24.")
64
64
  )
65
65
  ) {
66
66
  // this might be overridden by babel generator
67
- pkg.engines.node = ">=20.11.0"; // .9.0 is the first lts node 20 version, 20.11.0 is the version with backported import.meta feature
67
+ pkg.engines.node = ">=22.18.0"; // 22.18.0 is the version with strip typescript out of experimental status
68
68
  }
69
69
 
70
70
  if (pkg.engines.node.startsWith(">=22.11.")) {
71
- pkg.engines.node = ">=22.14.0"; // 22.14 is the first version with findPackageJSON
71
+ pkg.engines.node = ">=22.18.0";
72
72
  }
73
73
 
74
74
  if (!this.options.isRoot) {
@@ -142,9 +142,9 @@ export default class CoreYarnGenerator extends Generator {
142
142
  if (
143
143
  !pkg.packageManager ||
144
144
  !pkg.packageManager.startsWith("yarn@") ||
145
- lt(pkg.packageManager.slice("yarn@".length), "4.7.0")
145
+ lt(pkg.packageManager.slice("yarn@".length), "4.9.2")
146
146
  ) {
147
- pkg.packageManager = "yarn@4.7.0";
147
+ pkg.packageManager = "yarn@4.9.2";
148
148
  }
149
149
 
150
150
  // must be done after plugins installed
@@ -1,7 +1,7 @@
1
1
  import { rmSync } from "node:fs";
2
2
  import Generator from "yeoman-generator";
3
3
  import inMonorepo from "../../utils/inMonorepo.js";
4
- import { latestLTS } from "../../utils/node.js";
4
+ import { latestLTS } from "../../utils/nodeVersions.js";
5
5
  import * as packageUtils from "../../utils/package.js";
6
6
 
7
7
  export default class PobLibGenerator extends Generator {
@@ -42,6 +42,13 @@ export default class PobLibGenerator extends Generator {
42
42
  description:
43
43
  "Disable git cache. See https://yarnpkg.com/features/caching#offline-mirror.",
44
44
  });
45
+
46
+ this.option("ci", {
47
+ type: Boolean,
48
+ required: false,
49
+ default: true,
50
+ description: "ci enabled",
51
+ });
45
52
  }
46
53
 
47
54
  initializing() {
@@ -134,9 +141,11 @@ export default class PobLibGenerator extends Generator {
134
141
  } else if (this.pobjson.testing) {
135
142
  delete this.pobjson.testing.travisci;
136
143
  if ("circleci" in this.pobjson.testing) {
137
- this.pobjson.testing.ci = this.pobjson.testing.circleci;
138
144
  delete this.pobjson.testing.circleci;
139
145
  }
146
+ if ("ci" in this.pobjson.testing) {
147
+ delete this.pobjson.testing.ci;
148
+ }
140
149
  }
141
150
 
142
151
  if (typeof this.pobjson.documentation === "object") {
@@ -206,13 +215,6 @@ export default class PobLibGenerator extends Generator {
206
215
 
207
216
  if (this.pobjson.testing && !(inMonorepo || inMonorepo.root)) {
208
217
  const testingPrompts = await this.prompt([
209
- {
210
- type: "confirm",
211
- name: "ci",
212
- message: "Would you like ci with github actions ?",
213
- when: !this.updateOnly || this.pobjson.testing?.ci === undefined,
214
- default: this.pobjson.testing.ci !== false,
215
- },
216
218
  {
217
219
  type: "list",
218
220
  name: "runner",
@@ -302,8 +304,7 @@ export default class PobLibGenerator extends Generator {
302
304
 
303
305
  this.composeWith("pob:common:remove-old-dependencies");
304
306
 
305
- const enableReleasePlease =
306
- !inMonorepo && this.pobjson.testing && this.pobjson.testing.ci;
307
+ const enableReleasePlease = !inMonorepo && this.options.ci;
307
308
 
308
309
  this.composeWith("pob:common:testing", {
309
310
  enable: this.pobjson.testing,
@@ -320,7 +321,7 @@ export default class PobLibGenerator extends Generator {
320
321
  typescript: withTypescript,
321
322
  documentation: !!this.pobjson.documentation,
322
323
  codecov: this.pobjson.testing && this.pobjson.testing.codecov,
323
- ci: this.pobjson.testing && this.pobjson.testing.ci,
324
+ ci: this.options.ci,
324
325
  packageManager: this.options.packageManager,
325
326
  isApp: false,
326
327
  splitCIJobs: false,
@@ -353,7 +354,7 @@ export default class PobLibGenerator extends Generator {
353
354
  this.composeWith("pob:lib:readme", {
354
355
  documentation: !!this.pobjson.documentation,
355
356
  testing: !!this.pobjson.testing,
356
- ci: this.pobjson.testing && this.pobjson.testing.ci,
357
+ ci: this.options.ci,
357
358
  codecov: this.pobjson.testing && this.pobjson.testing.codecov,
358
359
  });
359
360
 
@@ -365,7 +366,7 @@ export default class PobLibGenerator extends Generator {
365
366
  withTypescript,
366
367
  isMonorepo: false,
367
368
  enableYarnVersion: true,
368
- ci: this.pobjson.testing && this.pobjson.testing.ci,
369
+ ci: this.options.ci,
369
370
  disableYarnGitCache: this.options.disableYarnGitCache,
370
371
  updateOnly: this.options.updateOnly,
371
372
  });
@@ -330,6 +330,7 @@ export default class PobMonorepoGenerator extends Generator {
330
330
  packageNames: JSON.stringify(packageNames),
331
331
  packagePaths: JSON.stringify(packagePaths),
332
332
  testRunner: this.pobLernaConfig.testRunner,
333
+ onlyLatestLTS: this.options.onlyLatestLTS,
333
334
  });
334
335
 
335
336
  this.fs.writeJSON(this.destinationPath("package.json"), pkg);
@@ -1,4 +1,3 @@
1
- import { existsSync } from "node:fs";
2
1
  import Generator from "yeoman-generator";
3
2
  import * as packageUtils from "../../../utils/package.js";
4
3
  import { copyAndFormatTpl } from "../../../utils/writeAndFormat.js";
@@ -40,6 +39,12 @@ export default class MonorepoTypescriptGenerator extends Generator {
40
39
  required: false,
41
40
  default: false,
42
41
  });
42
+
43
+ this.option("onlyLatestLTS", {
44
+ type: Boolean,
45
+ required: false,
46
+ default: false,
47
+ });
43
48
  }
44
49
 
45
50
  writing() {
@@ -103,12 +108,12 @@ export default class MonorepoTypescriptGenerator extends Generator {
103
108
  const tsconfigCheckPath = this.destinationPath("tsconfig.check.json");
104
109
  const tsconfigBuildPath = this.destinationPath("tsconfig.build.json");
105
110
  const tsconfigTestPath = this.destinationPath("tsconfig.test.json");
111
+ this.fs.delete(tsconfigTestPath);
106
112
 
107
113
  if (!this.options.enable) {
108
114
  this.fs.delete(tsconfigPath);
109
115
  this.fs.delete(tsconfigCheckPath);
110
116
  this.fs.delete(tsconfigBuildPath);
111
- this.fs.delete(tsconfigTestPath);
112
117
  } else {
113
118
  const packagePaths = JSON.parse(this.options.packagePaths);
114
119
 
@@ -122,20 +127,6 @@ export default class MonorepoTypescriptGenerator extends Generator {
122
127
  },
123
128
  );
124
129
 
125
- if (this.options.testRunner === "node") {
126
- copyAndFormatTpl(
127
- this.fs,
128
- this.templatePath("tsconfig.json.ejs"),
129
- tsconfigTestPath,
130
- {
131
- packagePaths: packagePaths.filter((packagePath) =>
132
- existsSync(`${packagePath}/tsconfig.test.json`),
133
- ),
134
- tsConfigSuffix: "test",
135
- },
136
- );
137
- }
138
-
139
130
  this.fs.delete(tsconfigCheckPath);
140
131
  this.fs.delete(tsconfigBuildPath);
141
132
  // if (this.options.isAppProject) {
@@ -60,7 +60,12 @@ export default class PobBaseGenerator extends Generator {
60
60
 
61
61
  async prompting() {
62
62
  let config = this.config.get("project");
63
- if (config && config.type && config.packageManager) {
63
+ if (
64
+ config &&
65
+ config.type &&
66
+ config.packageManager &&
67
+ config.ci !== undefined
68
+ ) {
64
69
  this.projectConfig = config;
65
70
  return;
66
71
  }
@@ -114,6 +119,21 @@ export default class PobBaseGenerator extends Generator {
114
119
  choices: ["node-modules", "pnp", "pnpm"],
115
120
  default: config.yarnNodeLinker || "node-modules",
116
121
  },
122
+ {
123
+ when: () => {
124
+ if (this.hasAncestor) {
125
+ return false;
126
+ }
127
+ if (this.options.updateOnly) {
128
+ return config.ci === undefined;
129
+ }
130
+ return true;
131
+ },
132
+ name: "ci",
133
+ message: "Would you like ci with github actions ?",
134
+ type: "confirm",
135
+ default: !config || config.ci === undefined ? true : config.ci,
136
+ },
117
137
  ]);
118
138
 
119
139
  this.projectConfig = { ...config, ...responses };
@@ -184,6 +204,7 @@ export default class PobBaseGenerator extends Generator {
184
204
  this.composeWith("pob:core:git", {
185
205
  onlyLatestLTS,
186
206
  splitCIJobs,
207
+ ciEnabled: this.options.ci,
187
208
  });
188
209
  } else {
189
210
  if (this.fs.exists(".git-hooks")) this.fs.delete(".git-hooks");
@@ -232,6 +253,7 @@ export default class PobBaseGenerator extends Generator {
232
253
  fromPob: this.options.fromPob,
233
254
  packageManager: this.projectConfig.packageManager,
234
255
  yarnNodeLinker: this.projectConfig.yarnNodeLinker,
256
+ ci: this.options.ci,
235
257
  });
236
258
  break;
237
259
  case "app":
@@ -244,6 +266,7 @@ export default class PobBaseGenerator extends Generator {
244
266
  fromPob: this.options.fromPob,
245
267
  packageManager: this.projectConfig.packageManager,
246
268
  yarnNodeLinker: this.projectConfig.yarnNodeLinker,
269
+ ci: this.options.ci,
247
270
  });
248
271
  break;
249
272
  default:
package/lib/pob.js CHANGED
@@ -15,6 +15,7 @@ import PobAppGenerator from "./generators/app/PobAppGenerator.js";
15
15
  import AppE2ETestingGenerator from "./generators/app/e2e-testing/AppE2ETestingGenerator.js";
16
16
  import AppNextjsGenerator from "./generators/app/nextjs/AppNextjsGenerator.js";
17
17
  import AppRemixGenerator from "./generators/app/remix/AppRemixGenerator.js";
18
+ import AppViteGenerator from "./generators/app/vite/AppViteGenerator.js";
18
19
  import CommonBabelGenerator from "./generators/common/babel/CommonBabelGenerator.js";
19
20
  import CommonLintGenerator from "./generators/common/format-lint/CommonLintGenerator.js";
20
21
  import CommonHuskyGenerator from "./generators/common/husky/CommonHuskyGenerator.js";
@@ -106,6 +107,11 @@ env.registerStub(
106
107
  "pob:app:remix",
107
108
  `${__dirname}/generators/app/nextjs/AppRemixGenerator.js`,
108
109
  );
110
+ env.registerStub(
111
+ AppViteGenerator,
112
+ "pob:app:vite",
113
+ `${__dirname}/generators/app/vite/AppViteGenerator.js`,
114
+ );
109
115
  env.registerStub(
110
116
  CommonBabelGenerator,
111
117
  "pob:common:babel",
@@ -0,0 +1,2 @@
1
+ export const latestLTS = "22";
2
+ export const maintenanceLTS = "22";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "28.3.0",
3
+ "version": "29.0.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "type": "module",
20
20
  "engines": {
21
- "node": ">=22.14.0"
21
+ "node": ">=22.18.0"
22
22
  },
23
23
  "sideEffects": false,
24
24
  "bin": "./lib/pob.js",
@@ -43,13 +43,13 @@
43
43
  },
44
44
  "prettier": "@pob/root/prettier-config",
45
45
  "dependencies": {
46
- "@pob/eslint-config": "60.1.0",
47
- "@pob/eslint-config-typescript": "60.1.0",
48
- "@pob/eslint-config-typescript-react": "60.1.0",
49
- "@pob/sort-object": "9.0.2",
50
- "@pob/sort-pkg": "11.0.3",
46
+ "@pob/eslint-config": "61.1.0",
47
+ "@pob/eslint-config-typescript": "61.1.0",
48
+ "@pob/eslint-config-typescript-react": "61.1.0",
49
+ "@pob/sort-object": "10.0.0",
50
+ "@pob/sort-pkg": "12.0.0",
51
51
  "@prettier/sync": "0.6.1",
52
- "@types/inquirer": "9.0.8",
52
+ "@types/inquirer": "9.0.9",
53
53
  "@yarnpkg/cli": "4.9.2",
54
54
  "@yarnpkg/core": "4.4.2",
55
55
  "@yarnpkg/fslib": "3.1.2",
@@ -66,17 +66,17 @@
66
66
  "mem-fs-editor": "11.1.4",
67
67
  "minimist": "1.2.8",
68
68
  "parse-author": "2.0.0",
69
- "pob-dependencies": "19.2.0",
69
+ "pob-dependencies": "20.0.0",
70
70
  "prettier": "3.6.2",
71
71
  "semver": "7.7.2",
72
72
  "typescript": "5.8.3",
73
73
  "validate-npm-package-name": "^6.0.1",
74
- "yarn-workspace-utils": "8.9.0",
74
+ "yarn-workspace-utils": "9.0.0",
75
75
  "yeoman-environment": "4.4.3",
76
76
  "yeoman-generator": "7.5.1"
77
77
  },
78
78
  "devDependencies": {
79
- "@pob/root": "18.2.0",
80
- "@types/node": "22.15.32"
79
+ "@pob/root": "19.0.0",
80
+ "@types/node": "22.17.2"
81
81
  }
82
82
  }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": [
3
- "./tsconfig.json",
4
- "@pob/root/tsconfigs/targets/node-<%= nodeVersion %>.json"
5
- ],
6
- "ts-node": {
7
- "esm": true,
8
- "transpileOnly": true
9
- }
10
- }
package/lib/utils/node.js DELETED
@@ -1,2 +0,0 @@
1
- export const latestLTS = "22";
2
- export const maintenanceLTS = "20";