pob 24.5.0 → 25.1.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 +49 -0
- package/lib/generators/app/PobAppGenerator.js +1 -0
- package/lib/generators/common/release/templates/workflow-release.yml.ejs +7 -0
- package/lib/generators/common/testing/CommonTestingGenerator.js +1 -1
- package/lib/generators/common/transpiler/CommonTranspilerGenerator.js +1 -1
- package/lib/generators/core/bun/CoreBunGenerator.js +54 -0
- package/lib/generators/core/ci/CoreCIGenerator.js +2 -3
- package/lib/generators/core/ci/templates/github-action-documentation-workflow.yml.ejs +8 -0
- package/lib/generators/core/ci/templates/github-action-push-workflow-split.yml.ejs +16 -0
- package/lib/generators/core/ci/templates/github-action-push-workflow.yml.ejs +8 -1
- package/lib/generators/core/gitignore/CoreGitignoreGenerator.js +20 -3
- package/lib/generators/core/npm/CoreNpmGenerator.js +34 -30
- package/lib/generators/core/package/CorePackageGenerator.js +10 -1
- package/lib/generators/core/vscode/CoreVSCodeGenerator.js +2 -1
- package/lib/generators/core/vscode/templates/settings.json.ejs +3 -0
- package/lib/generators/core/yarn/CoreYarnGenerator.js +4 -0
- package/lib/generators/lib/PobLibGenerator.js +4 -1
- package/lib/generators/lib/readme/LibReadmeGenerator.js +6 -4
- package/lib/generators/monorepo/PobMonorepoGenerator.js +3 -1
- package/lib/generators/monorepo/lerna/MonorepoLernaGenerator.js +1 -1
- package/lib/generators/monorepo/workspaces/MonorepoWorkspacesGenerator.js +3 -1
- package/lib/generators/pob/PobBaseGenerator.js +6 -0
- package/lib/pob.js +8 -2
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,55 @@
|
|
|
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.1.0](https://github.com/christophehurpeau/pob/compare/pob@25.0.0...pob@25.1.0) (2024-12-19)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **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))
|
|
11
|
+
* **deps:** update dependency eslint to v9.17.0 ([#2368](https://github.com/christophehurpeau/pob/issues/2368)) ([6976c32](https://github.com/christophehurpeau/pob/commit/6976c32b4812107b611f2ff5698db47202e857a1))
|
|
12
|
+
* improve bun support ([24accc2](https://github.com/christophehurpeau/pob/commit/24accc26c5fbf429befdecdc0da663fa10cd00a6))
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **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))
|
|
17
|
+
* **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))
|
|
18
|
+
* **pob:** delete package-lock.json for yarn ([fdadfbc](https://github.com/christophehurpeau/pob/commit/fdadfbc5bcdfc8957fde3a3d9d533a0b38e0fcb6))
|
|
19
|
+
* remove gh-pages for coverage only ([a2a875f](https://github.com/christophehurpeau/pob/commit/a2a875f6acf228edd9f009e0ef777d62fb892c9a))
|
|
20
|
+
|
|
21
|
+
Version bump for dependency: yarn-workspace-utils
|
|
22
|
+
Version bump for dependency: @pob/root
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [25.0.0](https://github.com/christophehurpeau/pob/compare/pob@24.5.0...pob@25.0.0) (2024-12-10)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
|
|
29
|
+
* drop legacy module/browser/react-native replaced by exports
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* add src/test-setup.ts support ([d469e23](https://github.com/christophehurpeau/pob/commit/d469e23a31b2ebd0477daf06a01e1c95b1809c9d))
|
|
34
|
+
* **deps:** update @pob/eslint-config to v59 (major) ([#2329](https://github.com/christophehurpeau/pob/issues/2329)) ([5019b13](https://github.com/christophehurpeau/pob/commit/5019b13dba092342eee72f0d6d766cf2de864555))
|
|
35
|
+
* **deps:** update dependency eslint to v9.16.0 ([#2308](https://github.com/christophehurpeau/pob/issues/2308)) ([78afd96](https://github.com/christophehurpeau/pob/commit/78afd962ab7d5ed1d735d6a90097f8b010c1621d))
|
|
36
|
+
* drop legacy module/browser/react-native replaced by exports ([b1363ca](https://github.com/christophehurpeau/pob/commit/b1363ca254fb08179a019d2b2f329936cb7dae2d))
|
|
37
|
+
* start preparing cursorignore ([6cec7ef](https://github.com/christophehurpeau/pob/commit/6cec7ef24ef29074b447eb33d3a27951f0a14237))
|
|
38
|
+
* support files lib/index.js rollup-plugin-svgr ([e7c3348](https://github.com/christophehurpeau/pob/commit/e7c3348daf1585ea467e29a6b460c97c280904c2))
|
|
39
|
+
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
* fix entryDistName ([1e3d4e4](https://github.com/christophehurpeau/pob/commit/1e3d4e46ceb7afa7bc4b3683b788cbbf5d0816ae))
|
|
43
|
+
* fix github ci required check for node 22.x ([4852f1b](https://github.com/christophehurpeau/pob/commit/4852f1b6ea097e156e27606b09e7bf17c6da44a8))
|
|
44
|
+
* only run checks on latest lts version ([1b5ff47](https://github.com/christophehurpeau/pob/commit/1b5ff47050eed0f6e200120a321167c647f70e03))
|
|
45
|
+
|
|
46
|
+
### Reverts
|
|
47
|
+
|
|
48
|
+
* Revert "feat!: drop legacy module/browser/react-native replaced by exports" ([5971c66](https://github.com/christophehurpeau/pob/commit/5971c669ffd534843a3ea9979a70a0cb1d3d51f8))
|
|
49
|
+
|
|
50
|
+
Version bump for dependency: @pob/sort-pkg
|
|
51
|
+
Version bump for dependency: yarn-workspace-utils
|
|
52
|
+
Version bump for dependency: @pob/root
|
|
53
|
+
|
|
54
|
+
|
|
6
55
|
## [24.5.0](https://github.com/christophehurpeau/pob/compare/pob@24.4.0...pob@24.5.0) (2024-12-05)
|
|
7
56
|
|
|
8
57
|
### Bug Fixes
|
|
@@ -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,12 @@ 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
|
+
run: bun install --frozen-lockfile
|
|
51
|
+
<% } -%>
|
|
45
52
|
|
|
46
53
|
- name: New version (dry run)
|
|
47
54
|
if: github.ref == 'refs/heads/main' && inputs.dry-run
|
|
@@ -327,7 +327,7 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
327
327
|
: ""
|
|
328
328
|
}node ${
|
|
329
329
|
this.options.typescript ? `${tsTestLoaderOption} ` : ""
|
|
330
|
-
}--test${experimentalTestCoverage && (coverage || coverageJson) ? " --experimental-test-coverage" : ""} ${this.options.monorepo ? `${workspacesPattern}/` : ""}${`${
|
|
330
|
+
}${this.fs.exists("src/test-setup.ts") ? "--import ./src/test-setup.ts " : ""}--test${experimentalTestCoverage && (coverage || coverageJson) ? " --experimental-test-coverage" : ""} ${this.options.monorepo ? `${workspacesPattern}/` : ""}${`${
|
|
331
331
|
hasTestFolder ? "test/*" : `${this.options.srcDirectory}/**/*.test`
|
|
332
332
|
}.${this.options.typescript ? "ts" : "js"}`}`;
|
|
333
333
|
}
|
|
@@ -433,7 +433,7 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
433
433
|
if (formats && formats.includes("cjs")) {
|
|
434
434
|
exportTarget.require = `./${
|
|
435
435
|
this.options.buildDirectory
|
|
436
|
-
}
|
|
436
|
+
}/${entryDistName}-${target}${version || ""}.cjs.js`;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
|
|
@@ -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
|
+
}
|
|
@@ -184,7 +184,7 @@ export default class CoreCIGenerator extends Generator {
|
|
|
184
184
|
testing && `test (${maintenanceLTS})`,
|
|
185
185
|
].filter(Boolean)
|
|
186
186
|
: [
|
|
187
|
-
!this.options.onlyLatestLTS && `build (${
|
|
187
|
+
!this.options.onlyLatestLTS && `build (${latestLTS}.x)`,
|
|
188
188
|
`build (${maintenanceLTS}.x)`,
|
|
189
189
|
].filter(Boolean)),
|
|
190
190
|
);
|
|
@@ -195,8 +195,7 @@ export default class CoreCIGenerator extends Generator {
|
|
|
195
195
|
if (
|
|
196
196
|
this.options.enable &&
|
|
197
197
|
!this.options.isApp &&
|
|
198
|
-
|
|
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,11 +32,18 @@ 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) { -%>
|
|
38
44
|
- name: Checks
|
|
39
45
|
run: <%= packageManager %> run checks
|
|
46
|
+
if: startsWith(matrix.node-version, '22.')
|
|
40
47
|
|
|
41
48
|
<% } -%>
|
|
42
49
|
<% if (build) { -%>
|
|
@@ -52,10 +52,18 @@ export default class CoreGitignoreGenerator extends Generator {
|
|
|
52
52
|
default: true,
|
|
53
53
|
description: "Build is saved in git.",
|
|
54
54
|
});
|
|
55
|
+
|
|
56
|
+
this.option("buildDirectory", {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false,
|
|
59
|
+
default: "",
|
|
60
|
+
description: "Build directory.",
|
|
61
|
+
});
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
writing() {
|
|
58
|
-
const
|
|
65
|
+
const gitignorePath = this.destinationPath(".gitignore");
|
|
66
|
+
const cursorignorePath = this.destinationPath(".cursorignore");
|
|
59
67
|
const withBabel = this.options.withBabel;
|
|
60
68
|
|
|
61
69
|
if (
|
|
@@ -64,9 +72,9 @@ export default class CoreGitignoreGenerator extends Generator {
|
|
|
64
72
|
!this.options.paths &&
|
|
65
73
|
!withBabel
|
|
66
74
|
) {
|
|
67
|
-
this.fs.delete(
|
|
75
|
+
this.fs.delete(gitignorePath);
|
|
68
76
|
} else {
|
|
69
|
-
this.fs.copyTpl(this.templatePath("gitignore.ejs"),
|
|
77
|
+
this.fs.copyTpl(this.templatePath("gitignore.ejs"), gitignorePath, {
|
|
70
78
|
root: this.options.root,
|
|
71
79
|
documentation: this.options.documentation,
|
|
72
80
|
testing: this.options.testing,
|
|
@@ -77,5 +85,14 @@ export default class CoreGitignoreGenerator extends Generator {
|
|
|
77
85
|
buildInGit: this.options.buildInGit,
|
|
78
86
|
});
|
|
79
87
|
}
|
|
88
|
+
|
|
89
|
+
// if (!this.options.root) {
|
|
90
|
+
this.fs.delete(cursorignorePath);
|
|
91
|
+
// } else {
|
|
92
|
+
// this.fs.write(
|
|
93
|
+
// cursorignorePath,
|
|
94
|
+
// `${["/.yarn", this.options.buildDirectory].join("\n")}\n`,
|
|
95
|
+
// );
|
|
96
|
+
// }
|
|
80
97
|
}
|
|
81
98
|
}
|
|
@@ -39,39 +39,43 @@ export default class CoreNpmGenerator extends Generator {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (!pkg.private && this.options.enable) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
if (pkg.files.length === 1 && pkg.files[0] === "lib/index.js") {
|
|
43
|
+
// see rollup-plugin-svgr
|
|
44
|
+
} else {
|
|
45
|
+
const files = new Set([
|
|
46
|
+
this.options.srcDirectory,
|
|
47
|
+
this.options.distDirectory,
|
|
48
|
+
]);
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
if (pkg.bin) {
|
|
51
|
+
files.add("bin");
|
|
52
|
+
}
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
if (pkg.exports) {
|
|
55
|
+
Object.values(pkg.exports).forEach((value) => {
|
|
56
|
+
if (typeof value === "string" && value.startsWith("./tsconfigs/")) {
|
|
57
|
+
files.add("tsconfigs");
|
|
58
|
+
}
|
|
59
|
+
if (
|
|
60
|
+
typeof value === "string" &&
|
|
61
|
+
value.startsWith("./") &&
|
|
62
|
+
value !== "./package.json" &&
|
|
63
|
+
![...files].some((file) => value.startsWith(`./${file}/`))
|
|
64
|
+
) {
|
|
65
|
+
files.add(value.slice("./".length));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (pkg.pob?.extraEntries) {
|
|
70
|
+
pkg.pob?.extraEntries.forEach((extraEntry) => {
|
|
71
|
+
if (extraEntry.directory) {
|
|
72
|
+
files.add(extraEntry.directory);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
73
76
|
|
|
74
|
-
|
|
77
|
+
pkg.files = [...files].filter(Boolean);
|
|
78
|
+
}
|
|
75
79
|
} else {
|
|
76
80
|
delete pkg.files;
|
|
77
81
|
}
|
|
@@ -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,6 +184,9 @@ 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
192
|
this.fs.delete(".yarn.lock");
|
|
@@ -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"]);
|
|
@@ -379,6 +379,8 @@ export default class PobLibGenerator extends Generator {
|
|
|
379
379
|
testRunner: this.pobjson.testRunner,
|
|
380
380
|
});
|
|
381
381
|
|
|
382
|
+
const buildDirectory = withBabel || withTypescript ? "dist" : "";
|
|
383
|
+
|
|
382
384
|
// must be after doc, testing
|
|
383
385
|
this.composeWith("pob:core:gitignore", {
|
|
384
386
|
root: !inMonorepo,
|
|
@@ -386,12 +388,13 @@ export default class PobLibGenerator extends Generator {
|
|
|
386
388
|
typescript: withTypescript,
|
|
387
389
|
documentation: this.pobjson.documentation,
|
|
388
390
|
testing: !!this.pobjson.testing,
|
|
391
|
+
buildDirectory,
|
|
389
392
|
});
|
|
390
393
|
|
|
391
394
|
this.composeWith("pob:core:npm", {
|
|
392
395
|
enable: !pkg.private,
|
|
393
396
|
srcDirectory: withBabel || withTypescript ? "src" : "lib",
|
|
394
|
-
distDirectory:
|
|
397
|
+
distDirectory: buildDirectory,
|
|
395
398
|
});
|
|
396
399
|
}
|
|
397
400
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable regexp/match-any */
|
|
2
|
+
/* eslint-disable regexp/no-super-linear-backtracking */
|
|
1
3
|
import camelCase from "lodash.camelcase";
|
|
2
4
|
import Generator from "yeoman-generator";
|
|
3
5
|
import inMonorepo from "../../../utils/inMonorepo.js";
|
|
@@ -47,16 +49,16 @@ export default class LibReadmeGenerator extends Generator {
|
|
|
47
49
|
|
|
48
50
|
if (this.fs.exists(readmePath)) {
|
|
49
51
|
const readmeFullContent = this.fs.read(readmePath);
|
|
50
|
-
content = readmeFullContent.match(/^<h3[^#*]+([^]+)\[npm-image]:/);
|
|
52
|
+
content = readmeFullContent.match(/^<h3[^#*]+([^]+)\[npm-image\]:/);
|
|
51
53
|
if (!content) {
|
|
52
|
-
content = readmeFullContent.match(/^<h3[^#*]+([^]+)\[daviddm-image]:/);
|
|
54
|
+
content = readmeFullContent.match(/^<h3[^#*]+([^]+)\[daviddm-image\]:/);
|
|
53
55
|
}
|
|
54
56
|
if (!content) content = readmeFullContent.match(/^<h3[^#*]+([^]+)$/);
|
|
55
57
|
if (!content) {
|
|
56
|
-
content = readmeFullContent.match(/^#[^#*]+([^]+)\[npm-image]:/);
|
|
58
|
+
content = readmeFullContent.match(/^#[^#*]+([^]+)\[npm-image\]:/);
|
|
57
59
|
}
|
|
58
60
|
if (!content) {
|
|
59
|
-
content = readmeFullContent.match(/^#[^#*]+([^]+)\[daviddm-image]:/);
|
|
61
|
+
content = readmeFullContent.match(/^#[^#*]+([^]+)\[daviddm-image\]:/);
|
|
60
62
|
}
|
|
61
63
|
if (!content) content = readmeFullContent.match(/^#[^#*]+([^]+)$/);
|
|
62
64
|
content = content ? content[1].trim() : readmeFullContent;
|
|
@@ -5,8 +5,8 @@ import { getPluginConfiguration } from "@yarnpkg/cli";
|
|
|
5
5
|
import { Configuration, Project } from "@yarnpkg/core";
|
|
6
6
|
import { ppath } from "@yarnpkg/fslib";
|
|
7
7
|
import {
|
|
8
|
-
buildTopologicalOrderBatches,
|
|
9
8
|
buildDependenciesMaps,
|
|
9
|
+
buildTopologicalOrderBatches,
|
|
10
10
|
getWorkspaceName,
|
|
11
11
|
} from "yarn-workspace-utils";
|
|
12
12
|
import Generator from "yeoman-generator";
|
|
@@ -288,6 +288,8 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
288
288
|
typescript: this.pobLernaConfig.typescript,
|
|
289
289
|
documentation: this.pobLernaConfig.documentation,
|
|
290
290
|
testing: this.pobLernaConfig.testing,
|
|
291
|
+
// todo: fix this using workspaces
|
|
292
|
+
// buildDirectory: this.pobLernaConfig.typescript ? `/*/build` : "",
|
|
291
293
|
});
|
|
292
294
|
|
|
293
295
|
this.composeWith("pob:common:remove-old-dependencies");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
2
2
|
import Generator from "yeoman-generator";
|
|
3
3
|
import * as packageUtils from "../../../utils/package.js";
|
|
4
4
|
import { writeAndFormatJson } from "../../../utils/writeAndFormat.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import {
|
|
2
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
3
3
|
import Generator from "yeoman-generator";
|
|
4
4
|
import * as packageUtils from "../../../utils/package.js";
|
|
5
5
|
import { copyAndFormatTpl } from "../../../utils/writeAndFormat.js";
|
|
@@ -159,7 +159,9 @@ export default class MonorepoWorkspacesGenerator extends Generator {
|
|
|
159
159
|
|
|
160
160
|
if (this.fs.exists(readmePath)) {
|
|
161
161
|
const readmeFullContent = this.fs.read(readmePath);
|
|
162
|
+
// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/match-any
|
|
162
163
|
content = readmeFullContent.match(/^<h3[^#*]+([^]+)$/);
|
|
164
|
+
// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/match-any
|
|
163
165
|
if (!content) content = readmeFullContent.match(/^#[^#*]+([^]+)$/);
|
|
164
166
|
content = content ? content[1].trim() : readmeFullContent;
|
|
165
167
|
}
|
|
@@ -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
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { execSync, spawnSync } from "node:child_process";
|
|
4
4
|
import fs, {
|
|
5
5
|
existsSync,
|
|
6
|
-
writeFileSync,
|
|
7
|
-
readFileSync,
|
|
8
6
|
mkdirSync,
|
|
7
|
+
readFileSync,
|
|
9
8
|
readdirSync,
|
|
9
|
+
writeFileSync,
|
|
10
10
|
} from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import minimist from "minimist";
|
|
@@ -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": "
|
|
3
|
+
"version": "25.1.0",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
},
|
|
42
42
|
"prettier": "@pob/root/prettier-config",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@pob/eslint-config": "
|
|
45
|
-
"@pob/eslint-config-typescript": "
|
|
46
|
-
"@pob/eslint-config-typescript-react": "
|
|
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
|
-
"@pob/sort-pkg": "
|
|
49
|
+
"@pob/sort-pkg": "10.0.0",
|
|
50
50
|
"@prettier/sync": "0.5.2",
|
|
51
51
|
"@types/inquirer": "9.0.7",
|
|
52
52
|
"@yarnpkg/cli": "4.5.3",
|
|
53
53
|
"@yarnpkg/core": "4.1.6",
|
|
54
54
|
"@yarnpkg/fslib": "3.1.1",
|
|
55
55
|
"@yeoman/types": "1.5.0",
|
|
56
|
-
"eslint": "9.
|
|
56
|
+
"eslint": "9.17.0",
|
|
57
57
|
"findup-sync": "^5.0.0",
|
|
58
58
|
"git-remote-url": "^1.0.1",
|
|
59
59
|
"github-username": "^7.0.0",
|
|
@@ -61,21 +61,21 @@
|
|
|
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.
|
|
65
|
-
"mem-fs-editor": "11.1.
|
|
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": "
|
|
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.0
|
|
73
|
+
"yarn-workspace-utils": "7.2.0",
|
|
73
74
|
"yeoman-environment": "4.4.3",
|
|
74
75
|
"yeoman-generator": "7.3.3"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
|
-
"@pob/root": "
|
|
78
|
-
"@types/node": "22.10.
|
|
79
|
-
"typescript": "5.7.2"
|
|
78
|
+
"@pob/root": "15.1.0",
|
|
79
|
+
"@types/node": "22.10.2"
|
|
80
80
|
}
|
|
81
81
|
}
|