pob 35.0.0 → 35.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/lib/generators/app/PobAppGenerator.js +6 -9
- package/lib/generators/common/format-lint/CommonLintGenerator.js +4 -1
- package/lib/generators/common/format-lint/templates/oxfmtrc.jsonc.ejs +2 -2
- package/lib/generators/common/release/CommonReleaseGenerator.js +8 -2
- package/lib/generators/common/release/templates/workflow-release.yml.ejs +20 -3
- package/lib/generators/common/testing/CommonTestingGenerator.js +13 -8
- package/lib/generators/common/transpiler/CommonTranspilerGenerator.js +23 -8
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +2 -6
- package/lib/generators/common/typescript/templates/tsconfig.json.ejs +1 -0
- package/lib/generators/core/ci/CoreCIGenerator.js +6 -0
- package/lib/generators/core/ci/templates/github-action-documentation-workflow.yml.ejs +9 -0
- package/lib/generators/core/ci/templates/github-action-push-workflow-split.yml.ejs +87 -2
- package/lib/generators/core/ci/templates/github-action-push-workflow.yml.ejs +11 -2
- package/lib/generators/core/git/CoreGitGenerator.js +3 -3
- package/lib/generators/core/package/CorePackageGenerator.js +3 -0
- package/lib/generators/core/pnpm/CorePnpmGenerator.js +103 -0
- package/lib/generators/core/vscode/CoreVSCodeGenerator.js +1 -0
- package/lib/generators/core/vscode/templates/settings.json.ejs +3 -0
- package/lib/generators/core/yarn/CoreYarnGenerator.js +6 -3
- package/lib/generators/lib/PobLibGenerator.js +8 -6
- package/lib/generators/monorepo/PobMonorepoGenerator.js +9 -4
- package/lib/generators/monorepo/lerna/MonorepoLernaGenerator.js +1 -1
- package/lib/generators/monorepo/workspaces/MonorepoWorkspacesGenerator.js +19 -17
- package/lib/generators/pob/PobBaseGenerator.js +25 -11
- package/lib/pob.js +7 -0
- package/lib/utils/packageManagerUtils.js +20 -0
- package/lib/utils/packageManagerWorkspacesUtils.js +75 -0
- package/package.json +22 -21
- package/CHANGELOG.md +0 -5892
|
@@ -37,7 +37,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
37
37
|
|
|
38
38
|
this.option("packageManager", {
|
|
39
39
|
type: String,
|
|
40
|
-
|
|
40
|
+
required: true,
|
|
41
41
|
description: "yarn or npm",
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -151,10 +151,6 @@ export default class PobAppGenerator extends Generator {
|
|
|
151
151
|
}
|
|
152
152
|
const srcDirectory =
|
|
153
153
|
srcDirectoriesFromAppType[this.appConfig.type] || "src";
|
|
154
|
-
const packageManager =
|
|
155
|
-
inMonorepo && !inMonorepo.root
|
|
156
|
-
? inMonorepo.pobMonorepoConfig.packageManager
|
|
157
|
-
: this.options.packageManager;
|
|
158
154
|
|
|
159
155
|
if (this.appConfig.type === "pobpack") {
|
|
160
156
|
throw new Error("pobpack is no longer supported.");
|
|
@@ -192,6 +188,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
192
188
|
fromPob: this.options.fromPob,
|
|
193
189
|
srcDirectory,
|
|
194
190
|
buildDirectory,
|
|
191
|
+
packageManager: this.options.packageManager,
|
|
195
192
|
});
|
|
196
193
|
}
|
|
197
194
|
|
|
@@ -282,7 +279,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
282
279
|
documentation: false,
|
|
283
280
|
codecov: this.appConfig.codecov,
|
|
284
281
|
ci: this.options.ci,
|
|
285
|
-
packageManager,
|
|
282
|
+
packageManager: this.options.packageManager,
|
|
286
283
|
isApp: true,
|
|
287
284
|
splitCIJobs: false,
|
|
288
285
|
onlyLatestLTS: true,
|
|
@@ -306,7 +303,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
306
303
|
browser,
|
|
307
304
|
// nextjs now supports src rootAsSrc: this.appConfig.type === 'next.js',
|
|
308
305
|
enableSrcResolver: true,
|
|
309
|
-
packageManager,
|
|
306
|
+
packageManager: this.options.packageManager,
|
|
310
307
|
yarnNodeLinker: this.options.yarnNodeLinker,
|
|
311
308
|
rootIgnorePaths: ignorePaths.join("\n"),
|
|
312
309
|
srcDirectory,
|
|
@@ -324,13 +321,13 @@ export default class PobAppGenerator extends Generator {
|
|
|
324
321
|
ci: this.options.ci,
|
|
325
322
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
326
323
|
updateOnly: this.options.updateOnly,
|
|
327
|
-
packageManager,
|
|
324
|
+
packageManager: this.options.packageManager,
|
|
328
325
|
});
|
|
329
326
|
|
|
330
327
|
this.composeWith("pob:core:vscode", {
|
|
331
328
|
root: !inMonorepo,
|
|
332
329
|
monorepo: false,
|
|
333
|
-
packageManager,
|
|
330
|
+
packageManager: this.options.packageManager,
|
|
334
331
|
yarnNodeLinker: this.options.yarnNodeLinker,
|
|
335
332
|
typescript,
|
|
336
333
|
testing: this.appConfig.testing,
|
|
@@ -527,9 +527,12 @@ export default class CommonFormatLintGenerator extends Generator {
|
|
|
527
527
|
"format:check": "oxfmt --check .",
|
|
528
528
|
});
|
|
529
529
|
} else {
|
|
530
|
-
delete pkg.scripts
|
|
530
|
+
delete pkg.scripts.format;
|
|
531
|
+
delete pkg.scripts["format:check"];
|
|
531
532
|
}
|
|
532
533
|
|
|
534
|
+
delete pkg.scripts["lint:prettier"];
|
|
535
|
+
delete pkg.scripts["lint:prettier:fix"];
|
|
533
536
|
delete pkg.scripts["typescript-check"];
|
|
534
537
|
}
|
|
535
538
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import Generator from "yeoman-generator";
|
|
2
2
|
// import { latestLTS } from "../../../utils/nodeVersions.js";
|
|
3
3
|
import * as packageUtils from "../../../utils/package.js";
|
|
4
|
+
import {
|
|
5
|
+
packageManagerExec,
|
|
6
|
+
packageManagerRun,
|
|
7
|
+
} from "../../../utils/packageManagerUtils.js";
|
|
4
8
|
|
|
5
9
|
export default class CommonReleaseGenerator extends Generator {
|
|
6
10
|
constructor(args, opts) {
|
|
@@ -83,6 +87,7 @@ export default class CommonReleaseGenerator extends Generator {
|
|
|
83
87
|
this.options.isMonorepo &&
|
|
84
88
|
(!pkg.version || pkg.version === "0.0.0"),
|
|
85
89
|
nodeLatestMajorVersion: 24, // TODO use latestLTS, when latest is updated to 24
|
|
90
|
+
packageManagerExec,
|
|
86
91
|
},
|
|
87
92
|
);
|
|
88
93
|
} else {
|
|
@@ -103,9 +108,10 @@ export default class CommonReleaseGenerator extends Generator {
|
|
|
103
108
|
if (this.options.enable && !this.options.ci) {
|
|
104
109
|
packageUtils.addScripts(pkg, {
|
|
105
110
|
preversion: [
|
|
106
|
-
"
|
|
111
|
+
packageManagerRun(this.options.packageManager, "lint"),
|
|
107
112
|
this.options.withBabel ||
|
|
108
|
-
(this.options.withTypescript &&
|
|
113
|
+
(this.options.withTypescript &&
|
|
114
|
+
packageManagerRun(this.options.packageManager, "build")),
|
|
109
115
|
"repository-check-dirty",
|
|
110
116
|
]
|
|
111
117
|
.filter(Boolean)
|
|
@@ -47,6 +47,12 @@ jobs:
|
|
|
47
47
|
uses: oven-sh/setup-bun@v2
|
|
48
48
|
with:
|
|
49
49
|
bun-version: latest
|
|
50
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
51
|
+
|
|
52
|
+
- name: Install pnpm
|
|
53
|
+
uses: pnpm/action-setup@v6
|
|
54
|
+
with:
|
|
55
|
+
version: 11
|
|
50
56
|
<% } -%>
|
|
51
57
|
|
|
52
58
|
- uses: actions/setup-node@v6
|
|
@@ -73,11 +79,14 @@ jobs:
|
|
|
73
79
|
<% } else if (packageManager === 'bun') { -%>
|
|
74
80
|
- name: Install Dependencies
|
|
75
81
|
run: bun install --frozen-lockfile
|
|
82
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
83
|
+
- name: Install Dependencies
|
|
84
|
+
run: pnpm install --frozen-lockfile
|
|
76
85
|
<% } -%>
|
|
77
86
|
|
|
78
87
|
- name: New version (dry run)
|
|
79
88
|
if: github.ref == 'refs/heads/main' && inputs.dry-run
|
|
80
|
-
run: <%= packageManager
|
|
89
|
+
run: <%= packageManagerExec(packageManager, 'pob-version') %> --dry-run<% if (isMonorepo && isMonorepoIndependent) { %> --bump-dependents-highest-as=${{ inputs.bump-dependents-highest-as }}<% } %>
|
|
81
90
|
|
|
82
91
|
- name: Configure Git user
|
|
83
92
|
if: github.ref == 'refs/heads/main' && !inputs.dry-run
|
|
@@ -88,19 +97,27 @@ jobs:
|
|
|
88
97
|
- name: New version
|
|
89
98
|
if: github.ref == 'refs/heads/main' && !inputs.dry-run
|
|
90
99
|
run: |
|
|
91
|
-
<%= packageManager
|
|
100
|
+
<%= packageManagerExec(packageManager, 'pob-version') %> <% if (enablePublish && packageManager === "bun") { %>--publish <% } %>--create-release=github <% if (isMonorepo && isMonorepoIndependent) { %> --bump-dependents-highest-as=${{ inputs.bump-dependents-highest-as }}<% } %> -m 'chore: release <%- isMonorepoIndependent ? '' : '%v ' %>[skip ci]<%- isMonorepoIndependent ? '\\n\\n%t' : '' %>'
|
|
92
101
|
env:
|
|
93
102
|
POB_GIT_HOOKS: 0
|
|
94
103
|
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
|
95
104
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
96
|
-
<% if (enablePublish && packageManager === "yarn") { -%>
|
|
105
|
+
<% if (enablePublish && (packageManager === "yarn" || packageManager === "pnpm")) { -%>
|
|
97
106
|
|
|
98
107
|
- name: Publish to npm
|
|
99
108
|
if: github.ref == 'refs/heads/main' && !inputs.dry-run
|
|
100
109
|
run: |
|
|
110
|
+
<% if (packageManager === 'yarn') { -%>
|
|
101
111
|
<% if (isMonorepo) { -%>
|
|
102
112
|
yarn workspaces foreach --all --parallel --no-private npm publish --tolerate-republish
|
|
103
113
|
<% } else { -%>
|
|
104
114
|
yarn npm publish
|
|
105
115
|
<% } -%>
|
|
116
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
117
|
+
<% if (isMonorepo) { -%>
|
|
118
|
+
pnpm -r publish --no-git-checks
|
|
119
|
+
<% } else { -%>
|
|
120
|
+
pnpm publish --no-git-checks
|
|
121
|
+
<% } -%>
|
|
122
|
+
<% } -%>
|
|
106
123
|
<% } -%>
|
|
@@ -5,6 +5,7 @@ import { quoteArg } from "../../../utils/execUtils.js";
|
|
|
5
5
|
import inMonorepo from "../../../utils/inMonorepo.js";
|
|
6
6
|
import * as packageUtils from "../../../utils/package.js";
|
|
7
7
|
import { packageManagerRunWithCwd } from "../../../utils/packageManagerUtils.js";
|
|
8
|
+
import { workspacesRun } from "../../../utils/packageManagerWorkspacesUtils.js";
|
|
8
9
|
import {
|
|
9
10
|
copyAndFormatTpl,
|
|
10
11
|
writeAndFormatJson,
|
|
@@ -65,7 +66,7 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
65
66
|
this.option("packageManager", {
|
|
66
67
|
type: String,
|
|
67
68
|
default: "yarn",
|
|
68
|
-
description: "yarn, bun or
|
|
69
|
+
description: "yarn, npm, bun, or pnpm",
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
this.option("isApp", {
|
|
@@ -304,13 +305,17 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
304
305
|
const jestConfigPath = this.destinationPath("jest.config.json");
|
|
305
306
|
const vitestConfigPath = this.destinationPath("vite.config.js");
|
|
306
307
|
|
|
307
|
-
|
|
308
|
-
pkg,
|
|
308
|
+
const isVitestUsed =
|
|
309
309
|
this.options.enable &&
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
(enableForMonorepo || !globalTesting) &&
|
|
311
|
+
testRunner === "vitest";
|
|
312
|
+
packageUtils.addOrRemoveDevDependencies(pkg, isVitestUsed, [
|
|
313
|
+
"vitest",
|
|
314
|
+
"@vitest/coverage-v8",
|
|
315
|
+
]);
|
|
316
|
+
if (isVitestUsed) {
|
|
317
|
+
packageUtils.addDevDependencies(pkg, ["vite"]);
|
|
318
|
+
}
|
|
314
319
|
|
|
315
320
|
if (!this.options.enable) {
|
|
316
321
|
// if (inMonorepo) {
|
|
@@ -351,7 +356,7 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
351
356
|
|
|
352
357
|
if (this.options.monorepo && !globalTesting) {
|
|
353
358
|
packageUtils.addScripts(pkg, {
|
|
354
|
-
test: "
|
|
359
|
+
test: workspacesRun(this.options.packageManager, "test"),
|
|
355
360
|
});
|
|
356
361
|
} else {
|
|
357
362
|
if (this.testRunner === "vitest") {
|
|
@@ -3,6 +3,7 @@ import semver from "semver";
|
|
|
3
3
|
import Generator from "yeoman-generator";
|
|
4
4
|
import { latestLTS, maintenanceLTS } from "../../../utils/nodeVersions.js";
|
|
5
5
|
import * as packageUtils from "../../../utils/package.js";
|
|
6
|
+
import { packageManagerRun } from "../../../utils/packageManagerUtils.js";
|
|
6
7
|
import { copyAndFormatTpl } from "../../../utils/writeAndFormat.js";
|
|
7
8
|
|
|
8
9
|
export default class CommonTranspilerGenerator extends Generator {
|
|
@@ -65,6 +66,12 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
65
66
|
default: false,
|
|
66
67
|
description: "only latest lts",
|
|
67
68
|
});
|
|
69
|
+
|
|
70
|
+
this.option("packageManager", {
|
|
71
|
+
type: String,
|
|
72
|
+
required: true,
|
|
73
|
+
description: "Package manager",
|
|
74
|
+
});
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
async prompting() {
|
|
@@ -165,13 +172,13 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
165
172
|
packageUtils.removeScripts(["watch"]);
|
|
166
173
|
packageUtils.addOrRemoveScripts(pkg, bundler && bundler !== "tsc", {
|
|
167
174
|
"clean:build": `${cleanCommand} ${this.options.buildDirectory}`,
|
|
168
|
-
clean: "
|
|
175
|
+
clean: packageManagerRun(this.options.packageManager, "clean:build"),
|
|
169
176
|
});
|
|
170
177
|
|
|
171
178
|
packageUtils.addOrRemoveScripts(pkg, bundler, {
|
|
172
179
|
start: (() => {
|
|
173
180
|
if (bundler && bundler.startsWith("rollup")) {
|
|
174
|
-
return "
|
|
181
|
+
return `${packageManagerRun(this.options.packageManager, "clean:build")} && rollup --config rollup.config.mjs --watch`;
|
|
175
182
|
}
|
|
176
183
|
if (bundler === "tsc") return "tsc --watch";
|
|
177
184
|
if (bundler === "esbuild") return "pob-esbuild-watch";
|
|
@@ -187,7 +194,7 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
187
194
|
packageUtils.addOrRemoveScripts(pkg, bundler, {
|
|
188
195
|
build: (() => {
|
|
189
196
|
if (bundler && bundler.startsWith("rollup")) {
|
|
190
|
-
return "
|
|
197
|
+
return `${packageManagerRun(this.options.packageManager, "clean:build")} && rollup --config rollup.config.mjs`;
|
|
191
198
|
}
|
|
192
199
|
if (bundler === "tsc") return "tsc";
|
|
193
200
|
if (bundler === "esbuild") return "pob-esbuild-build";
|
|
@@ -203,9 +210,9 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
203
210
|
|
|
204
211
|
if (shouldBuildDefinitions) {
|
|
205
212
|
if (pkg.scripts.build) {
|
|
206
|
-
pkg.scripts.build +=
|
|
213
|
+
pkg.scripts.build += ` && ${packageManagerRun(this.options.packageManager, "build:definitions")}`;
|
|
207
214
|
} else {
|
|
208
|
-
pkg.scripts.build = "
|
|
215
|
+
pkg.scripts.build = `${packageManagerRun(this.options.packageManager, "build:definitions")}`;
|
|
209
216
|
}
|
|
210
217
|
} else if (!this.options.isApp && !bundler && !withTypescript) {
|
|
211
218
|
// check definitions, but also force lerna to execute build:definitions in right order
|
|
@@ -214,7 +221,10 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
214
221
|
packageUtils.addScripts(pkg, {
|
|
215
222
|
"build:definitions":
|
|
216
223
|
"tsc --lib esnext --noEmit --skipLibCheck ./lib/index.d.ts",
|
|
217
|
-
build:
|
|
224
|
+
build: packageManagerRun(
|
|
225
|
+
this.options.packageManager,
|
|
226
|
+
"build:definitions",
|
|
227
|
+
),
|
|
218
228
|
});
|
|
219
229
|
}
|
|
220
230
|
|
|
@@ -222,7 +232,10 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
222
232
|
packageUtils.addScripts(pkg, {
|
|
223
233
|
"build:definitions":
|
|
224
234
|
"tsc --lib esnext --noEmit --skipLibCheck ./lib/index.ts",
|
|
225
|
-
build:
|
|
235
|
+
build: packageManagerRun(
|
|
236
|
+
this.options.packageManager,
|
|
237
|
+
"build:definitions",
|
|
238
|
+
),
|
|
226
239
|
});
|
|
227
240
|
}
|
|
228
241
|
}
|
|
@@ -786,7 +799,9 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
786
799
|
|
|
787
800
|
end() {
|
|
788
801
|
if (this.bundler) {
|
|
789
|
-
this.
|
|
802
|
+
this.spawnCommandSync(
|
|
803
|
+
packageManagerRun(this.options.packageManager, "build"),
|
|
804
|
+
);
|
|
790
805
|
}
|
|
791
806
|
}
|
|
792
807
|
}
|
|
@@ -208,6 +208,8 @@ export default class CommonTypescriptGenerator extends Generator {
|
|
|
208
208
|
delete pkg.scripts.flow;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
console.log({ enableTypescript: this.options.enable });
|
|
212
|
+
|
|
211
213
|
packageUtils.addOrRemoveDevDependencies(
|
|
212
214
|
pkg,
|
|
213
215
|
this.options.enable ||
|
|
@@ -236,12 +238,6 @@ export default class CommonTypescriptGenerator extends Generator {
|
|
|
236
238
|
yoConfig.pob.monorepo.typescript;
|
|
237
239
|
|
|
238
240
|
if (monorepoComposite) {
|
|
239
|
-
packageUtils.addOrRemoveDevDependencies(
|
|
240
|
-
pkg,
|
|
241
|
-
inMonorepo.rootPackageManager === "yarn",
|
|
242
|
-
["typescript"],
|
|
243
|
-
);
|
|
244
|
-
|
|
245
241
|
const packageLocations = new Map(
|
|
246
242
|
yoConfig.pob.monorepo.packageNames
|
|
247
243
|
.filter(
|
|
@@ -2,6 +2,10 @@ import fs from "node:fs";
|
|
|
2
2
|
import Generator from "yeoman-generator";
|
|
3
3
|
import inMonorepo from "../../../utils/inMonorepo.js";
|
|
4
4
|
import { latestLTS, maintenanceLTS } from "../../../utils/nodeVersions.js";
|
|
5
|
+
import {
|
|
6
|
+
packageManagerExec,
|
|
7
|
+
packageManagerRun,
|
|
8
|
+
} from "../../../utils/packageManagerUtils.js";
|
|
5
9
|
import { copyAndFormatTpl } from "../../../utils/writeAndFormat.js";
|
|
6
10
|
|
|
7
11
|
export const ciContexts = [];
|
|
@@ -140,6 +144,8 @@ export default class CoreCIGenerator extends Generator {
|
|
|
140
144
|
inMonorepo.pobConfig?.project?.type === "lib",
|
|
141
145
|
nodeLatestMajorVersion: latestLTS,
|
|
142
146
|
nodeMaintenanceMajorVersion: maintenanceLTS,
|
|
147
|
+
packageManagerRun,
|
|
148
|
+
packageManagerExec,
|
|
143
149
|
},
|
|
144
150
|
);
|
|
145
151
|
|
|
@@ -20,6 +20,12 @@ jobs:
|
|
|
20
20
|
with:
|
|
21
21
|
bun-version: latest
|
|
22
22
|
|
|
23
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
24
|
+
- name: Install pnpm
|
|
25
|
+
uses: pnpm/action-setup@v6
|
|
26
|
+
with:
|
|
27
|
+
version: 11
|
|
28
|
+
|
|
23
29
|
<% } -%>
|
|
24
30
|
- uses: actions/setup-node@v6
|
|
25
31
|
with:
|
|
@@ -35,6 +41,9 @@ jobs:
|
|
|
35
41
|
<% } else if (packageManager === 'bun') { -%>
|
|
36
42
|
- name: Install Dependencies
|
|
37
43
|
run: bun install --frozen-lockfile
|
|
44
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
45
|
+
- name: Install Dependencies
|
|
46
|
+
run: pnpm install --frozen-lockfile
|
|
38
47
|
<% } -%>
|
|
39
48
|
|
|
40
49
|
<% if (typedoc) { -%>
|
|
@@ -11,9 +11,23 @@ jobs:
|
|
|
11
11
|
steps:
|
|
12
12
|
- uses: actions/checkout@v6
|
|
13
13
|
|
|
14
|
+
<% if (packageManager === 'yarn') { -%>
|
|
14
15
|
- name: Enable Corepack
|
|
15
16
|
run: corepack enable
|
|
16
17
|
|
|
18
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
19
|
+
- name: Install bun
|
|
20
|
+
uses: oven-sh/setup-bun@v2
|
|
21
|
+
with:
|
|
22
|
+
bun-version: latest
|
|
23
|
+
|
|
24
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
25
|
+
- name: Install pnpm
|
|
26
|
+
uses: pnpm/action-setup@v6
|
|
27
|
+
with:
|
|
28
|
+
version: 11
|
|
29
|
+
|
|
30
|
+
<% } -%>
|
|
17
31
|
- uses: actions/setup-node@v6
|
|
18
32
|
with:
|
|
19
33
|
node-version: <%= nodeLatestMajorVersion %>
|
|
@@ -27,6 +41,8 @@ jobs:
|
|
|
27
41
|
<% } -%>
|
|
28
42
|
<% } else if (packageManager === 'bun') { -%>
|
|
29
43
|
run: bun install --frozen-lockfile
|
|
44
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
45
|
+
run: pnpm install --frozen-lockfile
|
|
30
46
|
<% } -%>
|
|
31
47
|
|
|
32
48
|
- name: Checks
|
|
@@ -40,9 +56,23 @@ jobs:
|
|
|
40
56
|
steps:
|
|
41
57
|
- uses: actions/checkout@v6
|
|
42
58
|
|
|
59
|
+
<% if (packageManager === 'yarn') { -%>
|
|
43
60
|
- name: Enable Corepack
|
|
44
61
|
run: corepack enable
|
|
45
62
|
|
|
63
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
64
|
+
- name: Install bun
|
|
65
|
+
uses: oven-sh/setup-bun@v2
|
|
66
|
+
with:
|
|
67
|
+
bun-version: latest
|
|
68
|
+
|
|
69
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
70
|
+
- name: Install pnpm
|
|
71
|
+
uses: pnpm/action-setup@v6
|
|
72
|
+
with:
|
|
73
|
+
version: 11
|
|
74
|
+
|
|
75
|
+
<% } -%>
|
|
46
76
|
- uses: actions/setup-node@v6
|
|
47
77
|
with:
|
|
48
78
|
node-version: <%= nodeLatestMajorVersion %>
|
|
@@ -56,13 +86,15 @@ jobs:
|
|
|
56
86
|
<% } -%>
|
|
57
87
|
<% } else if (packageManager === 'bun') { -%>
|
|
58
88
|
run: bun install --frozen-lockfile
|
|
89
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
90
|
+
run: pnpm install --frozen-lockfile
|
|
59
91
|
<% } -%>
|
|
60
92
|
|
|
61
93
|
- name: Build
|
|
62
94
|
run: <%= packageManager %> run build
|
|
63
95
|
|
|
64
96
|
- name: Check nothing was forgotten before commit
|
|
65
|
-
run: <%= packageManager
|
|
97
|
+
run: <%= packageManagerExec(packageManager, 'repository-check-dirty') %>
|
|
66
98
|
|
|
67
99
|
<% } -%>
|
|
68
100
|
lint:
|
|
@@ -71,19 +103,41 @@ jobs:
|
|
|
71
103
|
steps:
|
|
72
104
|
- uses: actions/checkout@v6
|
|
73
105
|
|
|
106
|
+
<% if (packageManager === 'yarn') { -%>
|
|
74
107
|
- name: Enable Corepack
|
|
75
108
|
run: corepack enable
|
|
76
109
|
|
|
110
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
111
|
+
- name: Install bun
|
|
112
|
+
uses: oven-sh/setup-bun@v2
|
|
113
|
+
with:
|
|
114
|
+
bun-version: latest
|
|
115
|
+
|
|
116
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
117
|
+
- name: Install pnpm
|
|
118
|
+
uses: pnpm/action-setup@v6
|
|
119
|
+
with:
|
|
120
|
+
version: 11
|
|
121
|
+
|
|
122
|
+
<% } -%>
|
|
77
123
|
- uses: actions/setup-node@v6
|
|
78
124
|
with:
|
|
79
125
|
node-version: <%= nodeLatestMajorVersion %>
|
|
80
126
|
|
|
81
127
|
- name: Install Dependencies
|
|
128
|
+
<% if (packageManager === 'yarn') { -%>
|
|
82
129
|
<% if (disableYarnGitCache) { -%>
|
|
83
130
|
run: yarn install --immutable
|
|
84
131
|
<% } else { -%>
|
|
85
132
|
run: yarn install --immutable --immutable-cache
|
|
86
133
|
<% } -%>
|
|
134
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
135
|
+
run: bun install --frozen-lockfile
|
|
136
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
137
|
+
run: pnpm install --frozen-lockfile
|
|
138
|
+
<% } else { -%>
|
|
139
|
+
run: npm ci
|
|
140
|
+
<% } -%>
|
|
87
141
|
|
|
88
142
|
- name: Format
|
|
89
143
|
run: <%= packageManager %> run format:check
|
|
@@ -117,6 +171,12 @@ jobs:
|
|
|
117
171
|
with:
|
|
118
172
|
bun-version: latest
|
|
119
173
|
|
|
174
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
175
|
+
- name: Install pnpm
|
|
176
|
+
uses: pnpm/action-setup@v6
|
|
177
|
+
with:
|
|
178
|
+
version: 11
|
|
179
|
+
|
|
120
180
|
<% } -%>
|
|
121
181
|
- uses: actions/setup-node@v6
|
|
122
182
|
with:
|
|
@@ -132,6 +192,9 @@ jobs:
|
|
|
132
192
|
<% } else if (packageManager === 'bun') { -%>
|
|
133
193
|
- name: Install Dependencies
|
|
134
194
|
run: bun install --frozen-lockfile
|
|
195
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
196
|
+
- name: Install Dependencies
|
|
197
|
+
run: pnpm install --frozen-lockfile
|
|
135
198
|
<% } -%>
|
|
136
199
|
|
|
137
200
|
<% if (codecov) { -%>
|
|
@@ -146,7 +209,7 @@ jobs:
|
|
|
146
209
|
CI: true
|
|
147
210
|
|
|
148
211
|
- name: Send results to codecov
|
|
149
|
-
uses: codecov/codecov-action@
|
|
212
|
+
uses: codecov/codecov-action@v6
|
|
150
213
|
if: matrix.node-version == <%= nodeLatestMajorVersion %> && github.actor != 'dependabot[bot]'
|
|
151
214
|
with:
|
|
152
215
|
fail_ci_if_error: true
|
|
@@ -169,19 +232,41 @@ jobs:
|
|
|
169
232
|
steps:
|
|
170
233
|
- uses: actions/checkout@v6
|
|
171
234
|
|
|
235
|
+
<% if (packageManager === 'yarn') { -%>
|
|
172
236
|
- name: Enable Corepack
|
|
173
237
|
run: corepack enable
|
|
174
238
|
|
|
239
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
240
|
+
- name: Install bun
|
|
241
|
+
uses: oven-sh/setup-bun@v2
|
|
242
|
+
with:
|
|
243
|
+
bun-version: latest
|
|
244
|
+
|
|
245
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
246
|
+
- name: Install pnpm
|
|
247
|
+
uses: pnpm/action-setup@v6
|
|
248
|
+
with:
|
|
249
|
+
version: 11
|
|
250
|
+
|
|
251
|
+
<% } -%>
|
|
175
252
|
- uses: actions/setup-node@v6
|
|
176
253
|
with:
|
|
177
254
|
node-version: ${{ matrix.node-version }}
|
|
178
255
|
|
|
179
256
|
- name: Install Dependencies
|
|
257
|
+
<% if (packageManager === 'yarn') { -%>
|
|
180
258
|
<% if (disableYarnGitCache) { -%>
|
|
181
259
|
run: yarn install --immutable
|
|
182
260
|
<% } else { -%>
|
|
183
261
|
run: yarn install --immutable --immutable-cache
|
|
184
262
|
<% } -%>
|
|
263
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
264
|
+
run: bun install --frozen-lockfile
|
|
265
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
266
|
+
run: pnpm install --frozen-lockfile
|
|
267
|
+
<% } else { -%>
|
|
268
|
+
run: npm ci
|
|
269
|
+
<% } -%>
|
|
185
270
|
|
|
186
271
|
- name: E2E testing
|
|
187
272
|
run: <%= packageManager %> <%= e2eTesting === '.' || e2eTesting === true ? '.' : `./${e2eTesting}` %> run test:e2e
|
|
@@ -24,6 +24,12 @@ jobs:
|
|
|
24
24
|
with:
|
|
25
25
|
bun-version: latest
|
|
26
26
|
|
|
27
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
28
|
+
- name: Install pnpm
|
|
29
|
+
uses: pnpm/action-setup@v6
|
|
30
|
+
with:
|
|
31
|
+
version: 11
|
|
32
|
+
|
|
27
33
|
<% } -%>
|
|
28
34
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
29
35
|
uses: actions/setup-node@v6
|
|
@@ -44,6 +50,9 @@ jobs:
|
|
|
44
50
|
<% } else if (packageManager === 'bun') { -%>
|
|
45
51
|
- name: Install Dependencies
|
|
46
52
|
run: bun install --frozen-lockfile
|
|
53
|
+
<% } else if (packageManager === 'pnpm') { -%>
|
|
54
|
+
- name: Install Dependencies
|
|
55
|
+
run: pnpm install --frozen-lockfile
|
|
47
56
|
<% } -%>
|
|
48
57
|
|
|
49
58
|
<% if (checks) { -%>
|
|
@@ -75,7 +84,7 @@ jobs:
|
|
|
75
84
|
|
|
76
85
|
- name: Check nothing was forgotten before commit
|
|
77
86
|
if: startsWith(matrix.node-version, '<%= nodeLatestMajorVersion %>.')
|
|
78
|
-
run: <%= packageManager
|
|
87
|
+
run: <%= packageManagerExec(packageManager, 'repository-check-dirty') %>
|
|
79
88
|
<% } -%>
|
|
80
89
|
<% if (codecov) { -%>
|
|
81
90
|
|
|
@@ -86,7 +95,7 @@ jobs:
|
|
|
86
95
|
CI: true
|
|
87
96
|
|
|
88
97
|
- name: Send results to codecov
|
|
89
|
-
uses: codecov/codecov-action@
|
|
98
|
+
uses: codecov/codecov-action@v6
|
|
90
99
|
with:
|
|
91
100
|
fail_ci_if_error: true
|
|
92
101
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -143,13 +143,13 @@ export default class CoreGitGenerator extends Generator {
|
|
|
143
143
|
const cwd = this.destinationPath();
|
|
144
144
|
|
|
145
145
|
this.initGitRepository =
|
|
146
|
-
this.spawnCommandSync("git
|
|
146
|
+
this.spawnCommandSync("git status", {
|
|
147
147
|
cwd,
|
|
148
148
|
stdio: "ignore",
|
|
149
149
|
reject: false,
|
|
150
150
|
}).status === 128;
|
|
151
151
|
if (this.initGitRepository) {
|
|
152
|
-
this.spawnCommandSync("git
|
|
152
|
+
this.spawnCommandSync("git init", { cwd });
|
|
153
153
|
|
|
154
154
|
if (!this.originUrl) {
|
|
155
155
|
let repoSSH = pkg.repository;
|
|
@@ -170,7 +170,7 @@ export default class CoreGitGenerator extends Generator {
|
|
|
170
170
|
repoSSH = pkg.repository;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
this.spawnCommandSync(
|
|
173
|
+
this.spawnCommandSync(`git remote add origin ${repoSSH}`, {
|
|
174
174
|
cwd,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
@@ -210,6 +210,9 @@ export default class CorePackageGenerator extends Generator {
|
|
|
210
210
|
if (this.fs.exists(this.destinationPath("yarn.lock"))) {
|
|
211
211
|
fs.unlinkSync(this.destinationPath("yarn.lock"));
|
|
212
212
|
}
|
|
213
|
+
if (this.fs.exists(this.destinationPath("pnpm-lock.yaml"))) {
|
|
214
|
+
fs.unlinkSync(this.destinationPath("pnpm-lock.yaml"));
|
|
215
|
+
}
|
|
213
216
|
}
|
|
214
217
|
if (this.fs.exists(this.destinationPath("yarn-error.log"))) {
|
|
215
218
|
fs.unlinkSync(this.destinationPath("yarn-error.log"));
|