pob 31.1.0 → 31.2.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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [31.2.0](https://github.com/christophehurpeau/pob/compare/pob@31.1.0...pob@31.2.0) (2025-12-06)
7
+
8
+ ### Features
9
+
10
+ * refine script management for yarn and improve handling of postinstall and prepare scripts
11
+
12
+ Version bump for dependency: @pob/root
13
+
14
+
6
15
  ## [31.1.0](https://github.com/christophehurpeau/pob/compare/pob@31.0.2...pob@31.1.0) (2025-12-06)
7
16
 
8
17
  ### Features
@@ -172,7 +172,6 @@ export default class CommonFormatLintGenerator extends Generator {
172
172
  delete pkg.scripts.preparecommitmsg;
173
173
  delete pkg.scripts.prepublish;
174
174
  delete pkg.scripts.postpublish;
175
- delete pkg.scripts.prepare;
176
175
  }
177
176
 
178
177
  delete pkg.standard;
@@ -110,7 +110,6 @@ export default class CommonHuskyGenerator extends Generator {
110
110
  delete pkg.scripts.commitmsg;
111
111
  delete pkg.scripts.precommit;
112
112
  delete pkg.scripts.prepublish;
113
- delete pkg.scripts.prepare;
114
113
  delete pkg.scripts.preparecommitmsg;
115
114
  delete pkg.scripts.postcheckout;
116
115
  delete pkg.scripts.postmerge;
@@ -311,6 +311,7 @@ export default class CommonTypescriptGenerator extends Generator {
311
311
  // for apps, only enable incremental. Composite is meant for libraries to build and export before the ones depending on them.
312
312
  composite:
313
313
  monorepoComposite &&
314
+ monorepoComposite !== "check-only" &&
314
315
  (!this.options.isApp || this.options.isAppLibrary),
315
316
  incremental: monorepoComposite,
316
317
  dom,
@@ -357,17 +357,29 @@ export default class CorePackageGenerator extends Generator {
357
357
  };
358
358
  if (this.options.inMonorepo || inMonorepo || pkg.private) {
359
359
  uninstallPostinstallScript("postinstallDev");
360
- if (this.options.isRoot) {
361
- installPostinstallScript("postinstall");
360
+ if (this.options.packageManager === "yarn") {
361
+ uninstallPostinstallScript("prepare");
362
+ if (this.options.isRoot) {
363
+ installPostinstallScript("postinstall");
364
+ } else {
365
+ uninstallPostinstallScript("postinstall");
366
+ }
362
367
  } else {
363
368
  uninstallPostinstallScript("postinstall");
369
+ if (this.options.isRoot) {
370
+ installPostinstallScript("prepare");
371
+ } else {
372
+ uninstallPostinstallScript("prepare");
373
+ }
364
374
  }
365
375
  } else if (this.options.packageManager === "yarn") {
366
376
  uninstallPostinstallScript("postinstallDev");
377
+ uninstallPostinstallScript("prepare");
367
378
  installPostinstallScript("postinstall");
368
379
  } else {
369
380
  uninstallPostinstallScript("postinstallDev");
370
- installPostinstallScript("postinstall");
381
+ uninstallPostinstallScript("postinstall");
382
+ installPostinstallScript("prepare");
371
383
  }
372
384
 
373
385
  this.fs.writeJSON(this.destinationPath("package.json"), pkg);
@@ -61,6 +61,22 @@ export default class CoreYarnGenerator extends Generator {
61
61
  writing() {
62
62
  const pkg = this.fs.readJSON(this.destinationPath("package.json"));
63
63
 
64
+ if (this.options.enable && !inMonorepo && !pkg.private) {
65
+ packageUtils.addDevDependencies(pkg, ["pinst"]);
66
+ packageUtils.addScripts(pkg, {
67
+ prepack: "pinst --disable",
68
+ postpack: "pinst --enable",
69
+ });
70
+ } else {
71
+ packageUtils.removeDevDependencies(pkg, ["pinst"]);
72
+ if (pkg.scripts.prepack === "pinst --disable") {
73
+ delete pkg.scripts.prepack;
74
+ }
75
+ if (pkg.scripts.postpack === "pinst --enable") {
76
+ delete pkg.scripts.postpack;
77
+ }
78
+ }
79
+
64
80
  if (this.options.enable) {
65
81
  this.fs.copyTpl(
66
82
  this.templatePath("yarn_gitignore.ejs"),
@@ -109,20 +125,6 @@ export default class CoreYarnGenerator extends Generator {
109
125
  const legacyVersionPluginName = "@yarnpkg/plugin-conventional-version";
110
126
 
111
127
  removePluginIfInstalled(postinstallDevPluginName);
112
- if (!inMonorepo && !pkg.private) {
113
- packageUtils.addDevDependencies(pkg, ["pinst"]);
114
- packageUtils.addScripts(pkg, {
115
- prepack: "pinst --disable",
116
- postpack: "pinst --enable",
117
- });
118
- } else {
119
- if (pkg.scripts.prepack === "pinst --disable") {
120
- delete pkg.scripts.prepack;
121
- }
122
- if (pkg.scripts.postpack === "pinst --enable") {
123
- delete pkg.scripts.postpack;
124
- }
125
- }
126
128
 
127
129
  if (pkg.name !== "yarn-plugin-conventional-version") {
128
130
  removePluginIfInstalled(legacyVersionPluginName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "31.1.0",
3
+ "version": "31.2.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -73,7 +73,7 @@
73
73
  "yeoman-generator": "7.5.1"
74
74
  },
75
75
  "devDependencies": {
76
- "@pob/root": "20.1.0",
76
+ "@pob/root": "20.2.0",
77
77
  "@types/node": "22.19.1"
78
78
  }
79
79
  }