pob 25.0.0 → 25.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,39 @@
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
+ ## [25.2.0](https://github.com/christophehurpeau/pob/compare/pob@25.1.0...pob@25.2.0) (2024-12-19)
7
+
8
+ ### Features
9
+
10
+ * **deps:** update dependency yeoman-generator to v7.4.0 ([#2366](https://github.com/christophehurpeau/pob/issues/2366)) ([1311555](https://github.com/christophehurpeau/pob/commit/1311555caecacf9a85f006ccf0e69680749070b4))
11
+
12
+ ### Bug Fixes
13
+
14
+ * fixes for bun packageManager ([0f3cd37](https://github.com/christophehurpeau/pob/commit/0f3cd37c1f72f04cb2e84093a4b6b04996038e01))
15
+ * if yarn is deleted remove yarn.lock ([e05b8f3](https://github.com/christophehurpeau/pob/commit/e05b8f3f8eb8840ecd282044e1a97efff59819cc))
16
+
17
+ Version bump for dependency: @pob/root
18
+
19
+
20
+ ## [25.1.0](https://github.com/christophehurpeau/pob/compare/pob@25.0.0...pob@25.1.0) (2024-12-19)
21
+
22
+ ### Features
23
+
24
+ * **deps:** update @pob/eslint-config to v59.2.0 ([#2376](https://github.com/christophehurpeau/pob/issues/2376)) ([02738e0](https://github.com/christophehurpeau/pob/commit/02738e07f6788010f5097e0e8f2005aa86199664))
25
+ * **deps:** update dependency eslint to v9.17.0 ([#2368](https://github.com/christophehurpeau/pob/issues/2368)) ([6976c32](https://github.com/christophehurpeau/pob/commit/6976c32b4812107b611f2ff5698db47202e857a1))
26
+ * improve bun support ([24accc2](https://github.com/christophehurpeau/pob/commit/24accc26c5fbf429befdecdc0da663fa10cd00a6))
27
+
28
+ ### Bug Fixes
29
+
30
+ * **deps:** update dependency mem-fs to v4.1.2 ([#2364](https://github.com/christophehurpeau/pob/issues/2364)) ([9e4251c](https://github.com/christophehurpeau/pob/commit/9e4251cfc5d7b73896767b54f92656a4ae4e0b01))
31
+ * **deps:** update dependency mem-fs-editor to v11.1.4 ([#2365](https://github.com/christophehurpeau/pob/issues/2365)) ([0efde48](https://github.com/christophehurpeau/pob/commit/0efde48c739dd4b9a6d06f1338bc45f652a6fd26))
32
+ * **pob:** delete package-lock.json for yarn ([fdadfbc](https://github.com/christophehurpeau/pob/commit/fdadfbc5bcdfc8957fde3a3d9d533a0b38e0fcb6))
33
+ * remove gh-pages for coverage only ([a2a875f](https://github.com/christophehurpeau/pob/commit/a2a875f6acf228edd9f009e0ef777d62fb892c9a))
34
+
35
+ Version bump for dependency: yarn-workspace-utils
36
+ Version bump for dependency: @pob/root
37
+
38
+
6
39
  ## [25.0.0](https://github.com/christophehurpeau/pob/compare/pob@24.5.0...pob@25.0.0) (2024-12-10)
7
40
 
8
41
  ### ⚠ BREAKING CHANGES
@@ -313,6 +313,7 @@ export default class PobAppGenerator extends Generator {
313
313
  ci: this.appConfig.ci,
314
314
  disableYarnGitCache: this.options.disableYarnGitCache,
315
315
  updateOnly: this.options.updateOnly,
316
+ packageManager: this.options.packageManager,
316
317
  });
317
318
  }
318
319
 
@@ -62,6 +62,12 @@ export default class CommonReleaseGenerator extends Generator {
62
62
  default: false,
63
63
  description: "Avoid asking questions",
64
64
  });
65
+
66
+ this.option("packageManager", {
67
+ type: String,
68
+ required: true,
69
+ description: "Package manager",
70
+ });
65
71
  }
66
72
 
67
73
  writing() {
@@ -79,6 +85,7 @@ export default class CommonReleaseGenerator extends Generator {
79
85
  this.templatePath("workflow-release.yml.ejs"),
80
86
  this.destinationPath(`.github/workflows/${name}`),
81
87
  {
88
+ packageManager: this.options.packageManager,
82
89
  enablePublish: this.options.enablePublish,
83
90
  enableYarnVersion: this.options.enableYarnVersion,
84
91
  disableYarnGitCache: this.options.disableYarnGitCache,
@@ -33,6 +33,7 @@ jobs:
33
33
  with:
34
34
  node-version: 22
35
35
 
36
+ <% if (packageManager === 'yarn') { -%>
36
37
  - name: Enable Corepack
37
38
  run: corepack enable
38
39
 
@@ -42,6 +43,13 @@ jobs:
42
43
  <% } else { -%>
43
44
  run: yarn install --immutable --immutable-cache
44
45
  <% } -%>
46
+ <% } else if (packageManager === 'bun') { -%>
47
+ - name: Install bun
48
+ uses: oven-sh/setup-bun@v1
49
+
50
+ - name: Install Dependencies
51
+ run: bun install --frozen-lockfile
52
+ <% } -%>
45
53
 
46
54
  - name: New version (dry run)
47
55
  if: github.ref == 'refs/heads/main' && inputs.dry-run
@@ -0,0 +1,54 @@
1
+ import Generator from "yeoman-generator";
2
+
3
+ export default class CoreBunGenerator extends Generator {
4
+ constructor(args, opts) {
5
+ super(args, opts);
6
+
7
+ this.option("type", {
8
+ type: String,
9
+ required: false,
10
+ default: "app",
11
+ description: "Project type",
12
+ });
13
+
14
+ this.option("enable", {
15
+ type: Boolean,
16
+ required: true,
17
+ description: "Enable bun",
18
+ });
19
+ }
20
+
21
+ initializing() {
22
+ if (this.options.enable) {
23
+ }
24
+ }
25
+
26
+ writing() {
27
+ const pkg = this.fs.readJSON(this.destinationPath("package.json"));
28
+
29
+ if (this.options.enable) {
30
+ } else {
31
+ this.fs.delete("bun.lock");
32
+ }
33
+
34
+ this.fs.writeJSON(this.destinationPath("package.json"), pkg);
35
+ }
36
+
37
+ end() {
38
+ if (this.options.enable) {
39
+ this.spawnSync("bun", ["install", "--save-text-lockfile"], {});
40
+
41
+ const pkg = this.fs.readJSON(this.destinationPath("package.json"));
42
+
43
+ if (pkg.scripts.preversion) {
44
+ try {
45
+ this.spawnSync("bun", ["run", "preversion"]);
46
+ } catch {}
47
+ } else if (pkg.scripts.build) {
48
+ try {
49
+ this.spawnSync("bun", ["run", "build"]);
50
+ } catch {}
51
+ }
52
+ }
53
+ }
54
+ }
@@ -195,8 +195,7 @@ export default class CoreCIGenerator extends Generator {
195
195
  if (
196
196
  this.options.enable &&
197
197
  !this.options.isApp &&
198
- (this.options.documentation ||
199
- (this.options.testing && this.options.testing.runner !== "node"))
198
+ this.options.documentation
200
199
  ) {
201
200
  copyAndFormatTpl(
202
201
  this.fs,
@@ -14,6 +14,7 @@ jobs:
14
14
  with:
15
15
  node-version: 22
16
16
 
17
+ <% if (packageManager === 'yarn') { -%>
17
18
  - name: Enable Corepack
18
19
  run: corepack enable
19
20
 
@@ -23,6 +24,13 @@ jobs:
23
24
  <% } else { -%>
24
25
  run: yarn install --immutable --immutable-cache
25
26
  <% } -%>
27
+ <% } else if (packageManager === 'bun') { -%>
28
+ - name: Install bun
29
+ uses: oven-sh/setup-bun@v1
30
+
31
+ - name: Install Dependencies
32
+ run: bun install --frozen-lockfile
33
+ <% } -%>
26
34
 
27
35
  <% if (typedoc) { -%>
28
36
  - name: Run tsc for tsc cache
@@ -18,11 +18,15 @@ jobs:
18
18
  run: corepack enable
19
19
 
20
20
  - name: Install Dependencies
21
+ <% if (packageManager === 'yarn') { -%>
21
22
  <% if (disableYarnGitCache) { -%>
22
23
  run: yarn install --immutable
23
24
  <% } else { -%>
24
25
  run: yarn install --immutable --immutable-cache
25
26
  <% } -%>
27
+ <% } else if (packageManager === 'bun') { -%>
28
+ run: bun install --frozen-lockfile
29
+ <% } -%>
26
30
 
27
31
  - name: Checks
28
32
  run: yarn run checks
@@ -43,11 +47,15 @@ jobs:
43
47
  run: corepack enable
44
48
 
45
49
  - name: Install Dependencies
50
+ <% if (packageManager === 'yarn') { -%>
46
51
  <% if (disableYarnGitCache) { -%>
47
52
  run: yarn install --immutable
48
53
  <% } else { -%>
49
54
  run: yarn install --immutable --immutable-cache
50
55
  <% } -%>
56
+ <% } else if (packageManager === 'bun') { -%>
57
+ run: bun install --frozen-lockfile
58
+ <% } -%>
51
59
 
52
60
  - name: Build
53
61
  run: yarn run build
@@ -102,6 +110,7 @@ jobs:
102
110
  with:
103
111
  node-version: ${{ matrix.node-version }}
104
112
 
113
+ <% if (packageManager === 'yarn') { -%>
105
114
  - name: Enable Corepack
106
115
  run: corepack enable
107
116
 
@@ -111,6 +120,13 @@ jobs:
111
120
  <% } else { -%>
112
121
  run: yarn install --immutable --immutable-cache
113
122
  <% } -%>
123
+ <% } else if (packageManager === 'bun') { -%>
124
+ - name: Install bun
125
+ uses: oven-sh/setup-bun@v1
126
+
127
+ - name: Install Dependencies
128
+ run: bun install --frozen-lockfile
129
+ <% } -%>
114
130
 
115
131
  <% if (codecov) { -%>
116
132
  - name: Test
@@ -19,10 +19,10 @@ jobs:
19
19
  node-version: ${{ matrix.node-version }}
20
20
  registry-url: 'https://registry.npmjs.org'
21
21
 
22
+ <% if (packageManager === 'yarn') { -%>
22
23
  - name: Enable Corepack
23
24
  run: corepack enable
24
25
 
25
- <% if (packageManager === 'yarn') { -%>
26
26
  - name: Install Dependencies
27
27
  <% if (disableYarnGitCache) { -%>
28
28
  run: yarn install --immutable
@@ -32,6 +32,12 @@ jobs:
32
32
  <% } else if (packageManager === 'npm') { -%>
33
33
  - name: Install Dependencies
34
34
  run: npm ci
35
+ <% } else if (packageManager === 'bun') { -%>
36
+ - name: Install bun
37
+ uses: oven-sh/setup-bun@v1
38
+
39
+ - name: Install Dependencies
40
+ run: bun install --frozen-lockfile
35
41
  <% } -%>
36
42
 
37
43
  <% if (checks) { -%>
@@ -42,6 +42,12 @@ export default class CorePackageGenerator extends Generator {
42
42
  required: false,
43
43
  description: "package type",
44
44
  });
45
+
46
+ this.option("packageManager", {
47
+ type: String,
48
+ required: false,
49
+ description: "package manager",
50
+ });
45
51
  }
46
52
 
47
53
  async initializing() {
@@ -361,9 +367,12 @@ export default class CorePackageGenerator extends Generator {
361
367
  } else {
362
368
  uninstallPostinstallScript("postinstall");
363
369
  }
364
- } else {
370
+ } else if (this.options.packageManager === "yarn") {
365
371
  uninstallPostinstallScript("postinstall");
366
372
  installPostinstallScript("postinstallDev");
373
+ } else {
374
+ uninstallPostinstallScript("postinstallDev");
375
+ installPostinstallScript("postinstall");
367
376
  }
368
377
 
369
378
  this.fs.writeJSON(this.destinationPath("package.json"), pkg);
@@ -17,7 +17,7 @@ export default class CoreVSCodeGenerator extends Generator {
17
17
  type: String,
18
18
  required: false,
19
19
  default: "yarn",
20
- description: "yarn|npm.",
20
+ description: "yarn|npm|bun",
21
21
  });
22
22
 
23
23
  this.option("monorepo", {
@@ -86,6 +86,7 @@ export default class CoreVSCodeGenerator extends Generator {
86
86
  yarn: this.options.packageManager === "yarn",
87
87
  pnp: this.options.yarnNodeLinker === "pnp",
88
88
  npm: this.options.packageManager === "npm",
89
+ bun: this.options.packageManager === "bun",
89
90
  typescript: this.options.typescript,
90
91
  testing: this.options.testing,
91
92
  testRunner: this.options.testRunner,
@@ -24,6 +24,9 @@
24
24
  <% if (yarn) { -%>
25
25
  // set yarn as package manager to run scripts and tasks
26
26
  "npm.packageManager": "yarn",
27
+ <% } else if (bun) { -%>
28
+ // set bun as package manager to run scripts and tasks
29
+ "npm.packageManager": "bun",
27
30
  <% } -%>
28
31
 
29
32
  // save config
@@ -184,9 +184,12 @@ export default class CoreYarnGenerator extends Generator {
184
184
  );
185
185
  }
186
186
  } else {
187
+ if (pkg.packageManager?.startsWith("yarn@")) {
188
+ delete pkg.packageManager;
189
+ }
187
190
  this.fs.delete(".yarn");
188
191
  this.fs.delete(".yarnrc.yml");
189
- this.fs.delete(".yarn.lock");
192
+ this.fs.delete("yarn.lock");
190
193
  }
191
194
 
192
195
  packageUtils.removeDevDependencies(pkg, ["@yarnpkg/pnpify"]);
@@ -211,6 +214,7 @@ export default class CoreYarnGenerator extends Generator {
211
214
  YARN_ENABLE_IMMUTABLE_INSTALLS: "false",
212
215
  },
213
216
  });
217
+ this.fs.delete("package-lock.json");
214
218
  this.spawnSync("yarn", ["dedupe"]);
215
219
 
216
220
  this.spawnSync("yarn", ["prettier", "--write", ".vscode", ".yarnrc.yml"]);
@@ -359,6 +359,7 @@ export default class PobLibGenerator extends Generator {
359
359
 
360
360
  this.composeWith("pob:common:release", {
361
361
  enable: !inMonorepo && this.pobjson.testing,
362
+ packageManager: this.options.packageManager,
362
363
  enablePublish: true,
363
364
  withBabel,
364
365
  withTypescript,
@@ -296,6 +296,7 @@ export default class PobMonorepoGenerator extends Generator {
296
296
 
297
297
  this.composeWith("pob:common:release", {
298
298
  enable: true,
299
+ packageManager: this.options.packageManager,
299
300
  enablePublish: !this.options.isAppProject,
300
301
  withBabel: this.pobLernaConfig.typescript,
301
302
  isMonorepo: true,
@@ -121,6 +121,11 @@ export default class PobBaseGenerator extends Generator {
121
121
  }
122
122
 
123
123
  default() {
124
+ this.composeWith("pob:core:bun", {
125
+ type: this.projectConfig.type,
126
+ enable: this.isRoot && this.projectConfig.packageManager === "bun",
127
+ });
128
+
124
129
  this.composeWith("pob:core:yarn", {
125
130
  type: this.projectConfig.type,
126
131
  enable: this.isRoot && this.projectConfig.packageManager === "yarn",
@@ -135,6 +140,7 @@ export default class PobBaseGenerator extends Generator {
135
140
  inMonorepo: !!inMonorepo,
136
141
  isRoot: this.isRoot,
137
142
  packageType: this.projectConfig.type === "app" ? "module" : undefined,
143
+ packageManager: this.projectConfig.packageManager,
138
144
  });
139
145
 
140
146
  if (this.isMonorepo) {
package/lib/pob.js CHANGED
@@ -23,6 +23,7 @@ import CommonReleaseGenerator from "./generators/common/release/CommonReleaseGen
23
23
  import CommonTestingGenerator from "./generators/common/testing/CommonTestingGenerator.js";
24
24
  import CommonTranspilerGenerator from "./generators/common/transpiler/CommonTranspilerGenerator.js";
25
25
  import CommonTypescriptGenerator from "./generators/common/typescript/CommonTypescriptGenerator.js";
26
+ import CoreBunGenerator from "./generators/core/bun/CoreBunGenerator.js";
26
27
  import CoreCIGenerator from "./generators/core/ci/CoreCIGenerator.js";
27
28
  import CoreCleanGenerator from "./generators/core/clean/CoreCleanGenerator.js";
28
29
  import CoreEditorConfigGenerator from "./generators/core/editorconfig/CoreEditorConfigGenerator.js";
@@ -205,6 +206,11 @@ env.registerStub(
205
206
  "pob:core:yarn",
206
207
  `${__dirname}/generators/core/yarn/CoreYarnGenerator.js`,
207
208
  );
209
+ env.registerStub(
210
+ CoreBunGenerator,
211
+ "pob:core:bun",
212
+ `${__dirname}/generators/core/bun/CoreBunGenerator.js`,
213
+ );
208
214
  env.registerStub(
209
215
  PobLibGenerator,
210
216
  "pob:lib",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "25.0.0",
3
+ "version": "25.2.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "prettier": "@pob/root/prettier-config",
43
43
  "dependencies": {
44
- "@pob/eslint-config": "59.0.0",
45
- "@pob/eslint-config-typescript": "59.1.2",
46
- "@pob/eslint-config-typescript-react": "59.1.2",
44
+ "@pob/eslint-config": "59.2.0",
45
+ "@pob/eslint-config-typescript": "59.2.0",
46
+ "@pob/eslint-config-typescript-react": "59.2.0",
47
47
  "@pob/sort-eslint-config": "7.0.0",
48
48
  "@pob/sort-object": "8.0.0",
49
49
  "@pob/sort-pkg": "10.0.0",
@@ -53,29 +53,29 @@
53
53
  "@yarnpkg/core": "4.1.6",
54
54
  "@yarnpkg/fslib": "3.1.1",
55
55
  "@yeoman/types": "1.5.0",
56
- "eslint": "9.16.0",
56
+ "eslint": "9.17.0",
57
57
  "findup-sync": "^5.0.0",
58
58
  "git-remote-url": "^1.0.1",
59
- "github-username": "^7.0.0",
59
+ "github-username": "^8.0.0",
60
60
  "js-yaml": "^4.1.0",
61
61
  "json5": "^2.2.3",
62
62
  "lodash.camelcase": "^4.3.0",
63
63
  "lodash.kebabcase": "^4.1.1",
64
- "mem-fs": "4.1.1",
65
- "mem-fs-editor": "11.1.3",
64
+ "mem-fs": "4.1.2",
65
+ "mem-fs-editor": "11.1.4",
66
66
  "minimist": "1.2.8",
67
67
  "parse-author": "2.0.0",
68
- "pob-dependencies": "16.0.0",
68
+ "pob-dependencies": "16.1.0",
69
69
  "prettier": "3.4.2",
70
70
  "semver": "7.6.3",
71
+ "typescript": "5.7.2",
71
72
  "validate-npm-package-name": "^6.0.0",
72
- "yarn-workspace-utils": "7.1.0",
73
+ "yarn-workspace-utils": "7.2.0",
73
74
  "yeoman-environment": "4.4.3",
74
- "yeoman-generator": "7.3.3"
75
+ "yeoman-generator": "7.4.0"
75
76
  },
76
77
  "devDependencies": {
77
- "@pob/root": "15.0.0",
78
- "@types/node": "22.10.1",
79
- "typescript": "5.7.2"
78
+ "@pob/root": "15.1.1",
79
+ "@types/node": "22.10.2"
80
80
  }
81
81
  }