pob 29.8.0 → 30.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.
- package/CHANGELOG.md +37 -0
- package/lib/generators/app/PobAppGenerator.js +10 -6
- package/lib/generators/app/ignorePaths.js +2 -1
- package/lib/generators/common/format-lint/CommonLintGenerator.js +18 -14
- package/lib/generators/common/format-lint/templates/prettierignore.ejs +1 -4
- package/lib/generators/common/husky/CommonHuskyGenerator.js +8 -11
- package/lib/generators/common/old-dependencies/CommonRemoveOldDependenciesGenerator.js +1 -0
- package/lib/generators/common/release/CommonReleaseGenerator.js +0 -7
- package/lib/generators/common/release/templates/workflow-release.yml.ejs +8 -12
- package/lib/generators/common/testing/CommonTestingGenerator.js +17 -85
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +1 -1
- package/lib/generators/core/ci/CoreCIGenerator.js +0 -36
- package/lib/generators/core/ci/templates/github-action-documentation-workflow.yml.ejs +6 -3
- package/lib/generators/core/ci/templates/github-action-push-workflow-split.yml.ejs +9 -5
- package/lib/generators/core/ci/templates/github-action-push-workflow.yml.ejs +8 -4
- package/lib/generators/core/yarn/CoreYarnGenerator.js +2 -2
- package/lib/generators/lib/PobLibGenerator.js +1 -4
- package/lib/generators/monorepo/PobMonorepoGenerator.js +41 -30
- package/lib/generators/monorepo/lerna/MonorepoLernaGenerator.js +12 -25
- package/lib/generators/monorepo/workspaces/MonorepoWorkspacesGenerator.js +6 -10
- package/lib/generators/pob/PobBaseGenerator.js +1 -1
- package/lib/utils/packageDependencyDescriptorUtils.js +52 -0
- package/lib/utils/packageDependencyDescriptorUtils.ts.backup +79 -0
- package/lib/utils/workspaceUtils.js +131 -0
- package/lib/utils/workspaceUtils.test.js +134 -0
- package/lib/utils/workspaceUtils.ts.backup +167 -0
- package/package.json +5 -9
- package/lib/generators/common/husky/templates/lint-staged.config.cjs.txt +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
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
|
+
## [30.0.0](https://github.com/christophehurpeau/pob/compare/pob@29.9.0...pob@30.0.0) (2025-11-24)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* migrate createLintStagedConfig to ES module and remove CommonJS version
|
|
11
|
+
* drop swc with jest support
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add ci permissions
|
|
16
|
+
* drop swc with jest support
|
|
17
|
+
* implement package dependency descriptor utilities and workspace management to replace yarn packages and better support bun
|
|
18
|
+
* migrate createLintStagedConfig to ES module and remove CommonJS version
|
|
19
|
+
* update templates for bun v2
|
|
20
|
+
* update yarn to 4.12.0
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* add rollup-plugin-copy to the list of removed dependencies
|
|
25
|
+
* **deps:** update js-yaml to version 4.1.1
|
|
26
|
+
* move /.yarnrc.yml to yarn section
|
|
27
|
+
* update E2E testing paths to handle boolean and string values correctly
|
|
28
|
+
|
|
29
|
+
Version bump for dependency: @pob/root
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## [29.9.0](https://github.com/christophehurpeau/pob/compare/pob@29.8.0...pob@29.9.0) (2025-11-18)
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* **deps:** update yarn monorepo ([#2631](https://github.com/christophehurpeau/pob/issues/2631))
|
|
37
|
+
* improve config for expo/storybook/e2e
|
|
38
|
+
|
|
39
|
+
Version bump for dependency: yarn-workspace-utils
|
|
40
|
+
Version bump for dependency: @pob/root
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
## [29.8.0](https://github.com/christophehurpeau/pob/compare/pob@29.7.0...pob@29.8.0) (2025-11-04)
|
|
7
44
|
|
|
8
45
|
### Features
|
|
@@ -128,6 +128,13 @@ export default class PobAppGenerator extends Generator {
|
|
|
128
128
|
default: !config || false,
|
|
129
129
|
when: (values) => values.testing,
|
|
130
130
|
},
|
|
131
|
+
{
|
|
132
|
+
type: "confirm",
|
|
133
|
+
name: "storybook",
|
|
134
|
+
message: "Do you want storybook ?",
|
|
135
|
+
default: (config && config.storybook) || false,
|
|
136
|
+
when: (values) => values.type === "expo",
|
|
137
|
+
},
|
|
131
138
|
]);
|
|
132
139
|
|
|
133
140
|
this.config.set("app", this.appConfig);
|
|
@@ -235,7 +242,8 @@ export default class PobAppGenerator extends Generator {
|
|
|
235
242
|
this.appConfig.type === "alp" ||
|
|
236
243
|
this.appConfig.type === "vite" ||
|
|
237
244
|
this.appConfig.type === "alp-node" ||
|
|
238
|
-
this.appConfig.type === "next.js"
|
|
245
|
+
this.appConfig.type === "next.js" ||
|
|
246
|
+
this.appConfig.type === "expo"
|
|
239
247
|
) {
|
|
240
248
|
return `./${srcDirectory}`;
|
|
241
249
|
}
|
|
@@ -260,14 +268,10 @@ export default class PobAppGenerator extends Generator {
|
|
|
260
268
|
|
|
261
269
|
this.composeWith("pob:common:remove-old-dependencies");
|
|
262
270
|
|
|
263
|
-
const enableReleasePlease =
|
|
264
|
-
!inMonorepo && this.appConfig.testing && this.options.ci;
|
|
265
|
-
|
|
266
271
|
if (this.appConfig.type !== "remix") {
|
|
267
272
|
this.composeWith("pob:common:testing", {
|
|
268
273
|
enable: this.appConfig.testing,
|
|
269
274
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
270
|
-
enableReleasePlease,
|
|
271
275
|
testing: this.appConfig.testing,
|
|
272
276
|
runner: this.appConfig.testing
|
|
273
277
|
? (inMonorepo
|
|
@@ -294,6 +298,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
294
298
|
this.composeWith("pob:common:format-lint", {
|
|
295
299
|
isApp: true,
|
|
296
300
|
documentation: false,
|
|
301
|
+
storybook: pkg?.devDependencies?.storybook,
|
|
297
302
|
testing: this.appConfig.testing,
|
|
298
303
|
testRunner: this.appConfig.testRunner,
|
|
299
304
|
babel,
|
|
@@ -318,7 +323,6 @@ export default class PobAppGenerator extends Generator {
|
|
|
318
323
|
enablePublish: false,
|
|
319
324
|
withBabel: babel,
|
|
320
325
|
isMonorepo: false,
|
|
321
|
-
enableYarnVersion: true,
|
|
322
326
|
ci: this.options.ci,
|
|
323
327
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
324
328
|
updateOnly: this.options.updateOnly,
|
|
@@ -17,7 +17,7 @@ export const appIgnorePaths = {
|
|
|
17
17
|
"untranspiled-library": (config) => [],
|
|
18
18
|
"alp-node": (config) => ["/build"],
|
|
19
19
|
other: (config) => [],
|
|
20
|
-
storybook: (config) => [],
|
|
20
|
+
storybook: (config) => ["/.storybook/storybook.requires.ts"],
|
|
21
21
|
expo: (config) => [
|
|
22
22
|
"/.expo/",
|
|
23
23
|
"/src/tamagui-web.css",
|
|
@@ -30,6 +30,7 @@ export const appIgnorePaths = {
|
|
|
30
30
|
"*.key",
|
|
31
31
|
"*.mobileprovision",
|
|
32
32
|
"*.orig.*",
|
|
33
|
+
"*.icon/",
|
|
33
34
|
|
|
34
35
|
// only if option is enabled which is not by default
|
|
35
36
|
// '# Temporary files created by Metro to check the health of the file watcher',
|
|
@@ -5,7 +5,7 @@ import * as packageUtils from "../../../utils/package.js";
|
|
|
5
5
|
import { copyAndFormatTpl } from "../../../utils/writeAndFormat.js";
|
|
6
6
|
import { appIgnorePaths } from "../../app/ignorePaths.js";
|
|
7
7
|
|
|
8
|
-
export default class
|
|
8
|
+
export default class CommonFormatLintGenerator extends Generator {
|
|
9
9
|
constructor(args, opts) {
|
|
10
10
|
super(args, opts);
|
|
11
11
|
|
|
@@ -69,6 +69,13 @@ export default class CommonLintGenerator extends Generator {
|
|
|
69
69
|
description: "Enable resolving from src directory",
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
this.option("storybook", {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
required: false,
|
|
75
|
+
default: false,
|
|
76
|
+
description: "Enable storybook",
|
|
77
|
+
});
|
|
78
|
+
|
|
72
79
|
this.option("rootAsSrc", {
|
|
73
80
|
type: Boolean,
|
|
74
81
|
required: false,
|
|
@@ -203,7 +210,7 @@ export default class CommonLintGenerator extends Generator {
|
|
|
203
210
|
hasApp: this.options.hasApp,
|
|
204
211
|
rootIgnorePatterns: [...rootIgnorePatterns],
|
|
205
212
|
ignorePatterns: [...ignorePatterns],
|
|
206
|
-
storybook:
|
|
213
|
+
storybook: this.options.storybook,
|
|
207
214
|
},
|
|
208
215
|
);
|
|
209
216
|
} else if (this.fs.exists(this.destinationPath(".prettierignore"))) {
|
|
@@ -438,6 +445,9 @@ export default class CommonLintGenerator extends Generator {
|
|
|
438
445
|
this.fs.delete(invalidEslintConfigPath);
|
|
439
446
|
|
|
440
447
|
if (!inMonorepo || inMonorepo.root) {
|
|
448
|
+
const rootIgnorePaths = this.options.rootIgnorePaths
|
|
449
|
+
.split("\n")
|
|
450
|
+
.filter(Boolean);
|
|
441
451
|
const getRootIgnorePatterns = () => {
|
|
442
452
|
const ignorePatterns = new Set();
|
|
443
453
|
|
|
@@ -451,10 +461,7 @@ export default class CommonLintGenerator extends Generator {
|
|
|
451
461
|
|
|
452
462
|
if ((!inMonorepo || !inMonorepo.root) && useTypescript) {
|
|
453
463
|
const buildPath = `/${this.options.buildDirectory}`;
|
|
454
|
-
if (
|
|
455
|
-
!this.options.rootIgnorePaths ||
|
|
456
|
-
!this.options.rootIgnorePaths.includes(buildPath)
|
|
457
|
-
) {
|
|
464
|
+
if (!rootIgnorePaths.includes(buildPath)) {
|
|
458
465
|
ignorePatterns.add(buildPath);
|
|
459
466
|
}
|
|
460
467
|
}
|
|
@@ -462,14 +469,11 @@ export default class CommonLintGenerator extends Generator {
|
|
|
462
469
|
ignorePatterns.add("/rollup.config.mjs");
|
|
463
470
|
}
|
|
464
471
|
|
|
465
|
-
if (
|
|
466
|
-
|
|
467
|
-
.
|
|
468
|
-
.
|
|
469
|
-
|
|
470
|
-
if (ignorePath.startsWith("#")) return;
|
|
471
|
-
ignorePatterns.add(ignorePath);
|
|
472
|
-
});
|
|
472
|
+
if (rootIgnorePaths) {
|
|
473
|
+
rootIgnorePaths.forEach((ignorePath) => {
|
|
474
|
+
if (ignorePath.startsWith("#")) return;
|
|
475
|
+
ignorePatterns.add(ignorePath);
|
|
476
|
+
});
|
|
473
477
|
}
|
|
474
478
|
|
|
475
479
|
return ignorePatterns;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
CHANGELOG.md
|
|
2
|
-
/.yarnrc.yml
|
|
3
2
|
<% if (documentation) { -%>
|
|
4
3
|
/docs
|
|
5
4
|
<% } -%>
|
|
6
|
-
<% if (storybook) { -%>
|
|
7
|
-
storybook.requires.ts
|
|
8
|
-
<% } -%>
|
|
9
5
|
<% if (packageManager === 'yarn' && inRoot) { -%>
|
|
6
|
+
/.yarnrc.yml
|
|
10
7
|
/.yarn/**/*
|
|
11
8
|
<% if (yarnNodeLinker === 'pnp') { -%>
|
|
12
9
|
/.pnp.*
|
|
@@ -69,17 +69,14 @@ export default class CommonHuskyGenerator extends Generator {
|
|
|
69
69
|
// '@commitlint/config-lerna-scopes': '6.1.3',
|
|
70
70
|
// });
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.destinationPath("lint-staged.config.js"),
|
|
81
|
-
);
|
|
82
|
-
}
|
|
72
|
+
this.fs.copy(
|
|
73
|
+
this.templatePath("lint-staged.config.js.txt"),
|
|
74
|
+
this.destinationPath(
|
|
75
|
+
pkg.type !== "module"
|
|
76
|
+
? "lint-staged.config.mjs"
|
|
77
|
+
: "lint-staged.config.js",
|
|
78
|
+
),
|
|
79
|
+
);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
pkg.commitlint = {
|
|
@@ -37,12 +37,6 @@ export default class CommonReleaseGenerator extends Generator {
|
|
|
37
37
|
description: "is monorepo",
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
this.option("enableYarnVersion", {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: true,
|
|
43
|
-
description: "enable yarn version conventional commits",
|
|
44
|
-
});
|
|
45
|
-
|
|
46
40
|
this.option("ci", {
|
|
47
41
|
type: Boolean,
|
|
48
42
|
required: true,
|
|
@@ -88,7 +82,6 @@ export default class CommonReleaseGenerator extends Generator {
|
|
|
88
82
|
{
|
|
89
83
|
packageManager: this.options.packageManager,
|
|
90
84
|
enablePublish: this.options.enablePublish,
|
|
91
|
-
enableYarnVersion: this.options.enableYarnVersion,
|
|
92
85
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
93
86
|
isMonorepo: this.options.isMonorepo,
|
|
94
87
|
isMonorepoIndependent:
|
|
@@ -12,7 +12,7 @@ on:
|
|
|
12
12
|
required: false
|
|
13
13
|
type: boolean
|
|
14
14
|
default: false
|
|
15
|
-
<% if (
|
|
15
|
+
<% if (isMonorepo && isMonorepoIndependent) { -%>
|
|
16
16
|
bump-dependents-highest-as:
|
|
17
17
|
description: "Bump dependents highest as"
|
|
18
18
|
required: false
|
|
@@ -37,6 +37,12 @@ jobs:
|
|
|
37
37
|
|
|
38
38
|
- name: Enable Corepack
|
|
39
39
|
run: corepack enable
|
|
40
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
41
|
+
|
|
42
|
+
- name: Install bun
|
|
43
|
+
uses: oven-sh/setup-bun@v2
|
|
44
|
+
with:
|
|
45
|
+
bun-version: latest
|
|
40
46
|
<% } -%>
|
|
41
47
|
|
|
42
48
|
- uses: actions/setup-node@v6
|
|
@@ -61,20 +67,14 @@ jobs:
|
|
|
61
67
|
run: yarn install --immutable --immutable-cache
|
|
62
68
|
<% } -%>
|
|
63
69
|
<% } else if (packageManager === 'bun') { -%>
|
|
64
|
-
- name: Install bun
|
|
65
|
-
uses: oven-sh/setup-bun@v1
|
|
66
|
-
|
|
67
70
|
- name: Install Dependencies
|
|
68
71
|
run: bun install --frozen-lockfile
|
|
69
72
|
<% } -%>
|
|
70
73
|
|
|
71
74
|
- name: New version (dry run)
|
|
72
75
|
if: github.ref == 'refs/heads/main' && inputs.dry-run
|
|
73
|
-
<% if (enableYarnVersion) { -%>
|
|
74
76
|
run: yarn yarn-version version --dry-run<% if (isMonorepo && isMonorepoIndependent) { %> --bump-dependents-highest-as=${{ inputs.bump-dependents-highest-as }}<% } %>
|
|
75
|
-
|
|
76
|
-
run: yarn lerna version --yes --no-push --exact --conventional-commits --conventional-graduate --changelog-preset conventional-changelog-conventionalcommits --no-git-tag-version --loglevel=verbose
|
|
77
|
-
<% } -%>
|
|
77
|
+
|
|
78
78
|
- name: Configure Git user
|
|
79
79
|
if: github.ref == 'refs/heads/main' && !inputs.dry-run
|
|
80
80
|
run: |
|
|
@@ -84,11 +84,7 @@ jobs:
|
|
|
84
84
|
- name: New version
|
|
85
85
|
if: github.ref == 'refs/heads/main' && !inputs.dry-run
|
|
86
86
|
run: |
|
|
87
|
-
<% if (enableYarnVersion) { -%>
|
|
88
87
|
yarn yarn-version version --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' : '' %>'
|
|
89
|
-
<% } else { -%>
|
|
90
|
-
yarn lerna version --yes --push --exact --conventional-commits --conventional-graduate --changelog-preset conventional-changelog-conventionalcommits --create-release=github -m 'chore: release [skip ci]'
|
|
91
|
-
<% } -%>
|
|
92
88
|
env:
|
|
93
89
|
HUSKY: 0
|
|
94
90
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
@@ -30,18 +30,6 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
30
30
|
description: "test runner (jest or node)",
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
this.option("enableReleasePlease", {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: true,
|
|
36
|
-
description: "enable release-please",
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
this.option("enableYarnVersion", {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: true,
|
|
42
|
-
description: "enable yarn version conventional commits",
|
|
43
|
-
});
|
|
44
|
-
|
|
45
33
|
this.option("ci", {
|
|
46
34
|
type: Boolean,
|
|
47
35
|
required: true,
|
|
@@ -115,21 +103,12 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
115
103
|
description:
|
|
116
104
|
"Disable git cache. See https://yarnpkg.com/features/caching#offline-mirror.",
|
|
117
105
|
});
|
|
118
|
-
|
|
119
|
-
this.option("swc", {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
required: false,
|
|
122
|
-
default: false,
|
|
123
|
-
description: "Use swc to transpile code.",
|
|
124
|
-
});
|
|
125
106
|
}
|
|
126
107
|
|
|
127
108
|
default() {
|
|
128
109
|
if (!inMonorepo || inMonorepo.root) {
|
|
129
110
|
this.composeWith("pob:core:ci", {
|
|
130
111
|
enable: this.options.ci,
|
|
131
|
-
enableReleasePlease: this.options.enableReleasePlease,
|
|
132
|
-
enableYarnVersion: this.options.enableYarnVersion,
|
|
133
112
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
134
113
|
testing: this.options.enable,
|
|
135
114
|
testRunner: this.options.runner,
|
|
@@ -193,17 +172,13 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
193
172
|
const tsTestUtil = (() => {
|
|
194
173
|
if (testRunner === "vitest") return undefined;
|
|
195
174
|
if (!withTypescript) return undefined;
|
|
196
|
-
if (
|
|
175
|
+
if (isJestRunner && !transpileWithBabel && withTypescript) {
|
|
176
|
+
throw new Error("SWC is no longer supported. Migrate to vitest.");
|
|
177
|
+
}
|
|
197
178
|
return "node";
|
|
198
179
|
})();
|
|
199
180
|
|
|
200
|
-
const dependenciesForTestUtil = {
|
|
201
|
-
swc: {
|
|
202
|
-
devDependenciesShared: ["@swc/core"],
|
|
203
|
-
devDependenciesWithJest: ["@swc/jest"],
|
|
204
|
-
devDependenciesWithNode: ["@swc-node/register"],
|
|
205
|
-
},
|
|
206
|
-
};
|
|
181
|
+
const dependenciesForTestUtil = {};
|
|
207
182
|
|
|
208
183
|
Object.entries(dependenciesForTestUtil).forEach(
|
|
209
184
|
([
|
|
@@ -271,9 +246,6 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
271
246
|
switch (tsTestUtil) {
|
|
272
247
|
case "node":
|
|
273
248
|
return "";
|
|
274
|
-
case "swc":
|
|
275
|
-
return "--import=@swc-node/register/esm";
|
|
276
|
-
|
|
277
249
|
// no default
|
|
278
250
|
}
|
|
279
251
|
})();
|
|
@@ -461,23 +433,6 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
461
433
|
delete jestConfig.extensionsToTreatAsEsm;
|
|
462
434
|
}
|
|
463
435
|
|
|
464
|
-
if (tsTestUtil === "swc" && !transpileWithBabel && withTypescript) {
|
|
465
|
-
jestConfig.transform = {
|
|
466
|
-
[hasReact ? "^.+\\.tsx?$" : "^.+\\.ts$"]: ["@swc/jest"],
|
|
467
|
-
};
|
|
468
|
-
} else if (jestConfig.transform) {
|
|
469
|
-
jestConfig.transform = Object.fromEntries(
|
|
470
|
-
Object.entries(jestConfig.transform).filter(
|
|
471
|
-
([key, value]) =>
|
|
472
|
-
value !== "@swc/jest" &&
|
|
473
|
-
!(Array.isArray(value) && value[0] === "@swc/jest"),
|
|
474
|
-
),
|
|
475
|
-
);
|
|
476
|
-
if (Object.keys(jestConfig.transform).length === 0) {
|
|
477
|
-
delete jestConfig.transform;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
436
|
writeAndFormatJson(this.fs, jestConfigPath, jestConfig);
|
|
482
437
|
}
|
|
483
438
|
} else {
|
|
@@ -568,42 +523,19 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
568
523
|
};
|
|
569
524
|
} else if (!transpileWithBabel && !withTypescript) {
|
|
570
525
|
delete jestConfig.transform;
|
|
571
|
-
} else {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
value !== "@swc/jest" &&
|
|
585
|
-
!(Array.isArray(value) && value[0] === "@swc/jest"),
|
|
586
|
-
),
|
|
587
|
-
);
|
|
588
|
-
if (Object.keys(jestConfig.transform).length === 0) {
|
|
589
|
-
delete jestConfig.transform;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
if (jestConfig.transform) {
|
|
594
|
-
jestConfig.transform = Object.fromEntries(
|
|
595
|
-
Object.entries(jestConfig.transform).filter(
|
|
596
|
-
([key, value]) =>
|
|
597
|
-
!(
|
|
598
|
-
value &&
|
|
599
|
-
Array.isArray(value) &&
|
|
600
|
-
value[0] === "jest-esbuild"
|
|
601
|
-
),
|
|
602
|
-
),
|
|
603
|
-
);
|
|
604
|
-
if (Object.keys(jestConfig.transform).length === 0) {
|
|
605
|
-
delete jestConfig.transform;
|
|
606
|
-
}
|
|
526
|
+
} else if (jestConfig.transform) {
|
|
527
|
+
jestConfig.transform = Object.fromEntries(
|
|
528
|
+
Object.entries(jestConfig.transform).filter(
|
|
529
|
+
([key, value]) =>
|
|
530
|
+
!(
|
|
531
|
+
value &&
|
|
532
|
+
Array.isArray(value) &&
|
|
533
|
+
value[0] === "jest-esbuild"
|
|
534
|
+
),
|
|
535
|
+
),
|
|
536
|
+
);
|
|
537
|
+
if (Object.keys(jestConfig.transform).length === 0) {
|
|
538
|
+
delete jestConfig.transform;
|
|
607
539
|
}
|
|
608
540
|
}
|
|
609
541
|
|
|
@@ -171,7 +171,7 @@ export default class CommonTypescriptGenerator extends Generator {
|
|
|
171
171
|
return ["@pob/root/tsconfigs/targets/rollup-es2015.json"];
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
if (this.options.isApp && pkg.
|
|
174
|
+
if (this.options.isApp && pkg.dependencies?.expo) {
|
|
175
175
|
return ["@pob/root/tsconfigs/targets/expo.json"];
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -17,18 +17,6 @@ export default class CoreCIGenerator extends Generator {
|
|
|
17
17
|
description: "enable ci",
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
this.option("enableReleasePlease", {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: true,
|
|
23
|
-
description: "enable release-please",
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
this.option("enableYarnVersion", {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: true,
|
|
29
|
-
description: "enable yarn version conventional commits",
|
|
30
|
-
});
|
|
31
|
-
|
|
32
20
|
this.option("build", {
|
|
33
21
|
type: Boolean,
|
|
34
22
|
default: true,
|
|
@@ -104,30 +92,6 @@ export default class CoreCIGenerator extends Generator {
|
|
|
104
92
|
});
|
|
105
93
|
}
|
|
106
94
|
|
|
107
|
-
async prompting() {
|
|
108
|
-
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
109
|
-
|
|
110
|
-
this.isReleasePleaseEnabled =
|
|
111
|
-
this.options.enableReleasePlease &&
|
|
112
|
-
!this.options.enableYarnVersion &&
|
|
113
|
-
!pkg.devDependencies?.["standard-version"];
|
|
114
|
-
|
|
115
|
-
if (
|
|
116
|
-
this.options.enableReleasePlease &&
|
|
117
|
-
!process.env.CI &&
|
|
118
|
-
!this.isReleasePleaseEnabled &&
|
|
119
|
-
!this.options.enableYarnVersion
|
|
120
|
-
) {
|
|
121
|
-
const { enableReleasePlease } = await this.prompt({
|
|
122
|
-
type: "confirm",
|
|
123
|
-
name: "enableReleasePlease",
|
|
124
|
-
message: "Would you like to enable release please ?",
|
|
125
|
-
default: true,
|
|
126
|
-
});
|
|
127
|
-
this.isReleasePleaseEnabled = enableReleasePlease;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
95
|
default() {
|
|
132
96
|
if (fs.existsSync(this.destinationPath(".circleci"))) {
|
|
133
97
|
fs.rmdirSync(this.destinationPath(".circleci"), { recursive: true });
|
|
@@ -14,6 +14,12 @@ jobs:
|
|
|
14
14
|
- name: Enable Corepack
|
|
15
15
|
run: corepack enable
|
|
16
16
|
|
|
17
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
18
|
+
- name: Install bun
|
|
19
|
+
uses: oven-sh/setup-bun@v2
|
|
20
|
+
with:
|
|
21
|
+
bun-version: latest
|
|
22
|
+
|
|
17
23
|
<% } -%>
|
|
18
24
|
- uses: actions/setup-node@v6
|
|
19
25
|
with:
|
|
@@ -28,9 +34,6 @@ jobs:
|
|
|
28
34
|
run: yarn install --immutable --immutable-cache
|
|
29
35
|
<% } -%>
|
|
30
36
|
<% } else if (packageManager === 'bun') { -%>
|
|
31
|
-
- name: Install bun
|
|
32
|
-
uses: oven-sh/setup-bun@v1
|
|
33
|
-
|
|
34
37
|
- name: Install Dependencies
|
|
35
38
|
run: bun install --frozen-lockfile
|
|
36
39
|
<% } -%>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
name: Push CI
|
|
2
|
-
|
|
2
|
+
permissions:
|
|
3
|
+
contents: read
|
|
3
4
|
on: [push]
|
|
4
5
|
|
|
5
6
|
jobs:
|
|
@@ -113,6 +114,12 @@ jobs:
|
|
|
113
114
|
- name: Enable Corepack
|
|
114
115
|
run: corepack enable
|
|
115
116
|
|
|
117
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
118
|
+
- name: Install bun
|
|
119
|
+
uses: oven-sh/setup-bun@v2
|
|
120
|
+
with:
|
|
121
|
+
bun-version: latest
|
|
122
|
+
|
|
116
123
|
<% } -%>
|
|
117
124
|
- uses: actions/setup-node@v6
|
|
118
125
|
with:
|
|
@@ -127,9 +134,6 @@ jobs:
|
|
|
127
134
|
run: yarn install --immutable --immutable-cache
|
|
128
135
|
<% } -%>
|
|
129
136
|
<% } else if (packageManager === 'bun') { -%>
|
|
130
|
-
- name: Install bun
|
|
131
|
-
uses: oven-sh/setup-bun@v1
|
|
132
|
-
|
|
133
137
|
- name: Install Dependencies
|
|
134
138
|
run: bun install --frozen-lockfile
|
|
135
139
|
<% } -%>
|
|
@@ -185,7 +189,7 @@ jobs:
|
|
|
185
189
|
<% } -%>
|
|
186
190
|
|
|
187
191
|
- name: E2E testing
|
|
188
|
-
run: <%= packageManager %> <%= e2eTesting === '.' ? '.' : `./${e2eTesting}` %> run test:e2e
|
|
192
|
+
run: <%= packageManager %> <%= e2eTesting === '.' || e2eTesting === true ? '.' : `./${e2eTesting}` %> run test:e2e
|
|
189
193
|
<% } -%>
|
|
190
194
|
<% if (isReleasePleaseEnabled) { -%>
|
|
191
195
|
release:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
name: Push CI
|
|
2
|
-
|
|
2
|
+
permissions:
|
|
3
|
+
contents: read
|
|
3
4
|
on: [push]
|
|
4
5
|
|
|
5
6
|
jobs:
|
|
@@ -17,6 +18,12 @@ jobs:
|
|
|
17
18
|
- name: Enable Corepack
|
|
18
19
|
run: corepack enable
|
|
19
20
|
|
|
21
|
+
<% } else if (packageManager === 'bun') { -%>
|
|
22
|
+
- name: Install bun
|
|
23
|
+
uses: oven-sh/setup-bun@v2
|
|
24
|
+
with:
|
|
25
|
+
bun-version: latest
|
|
26
|
+
|
|
20
27
|
<% } -%>
|
|
21
28
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
22
29
|
uses: actions/setup-node@v6
|
|
@@ -36,9 +43,6 @@ jobs:
|
|
|
36
43
|
- name: Install Dependencies
|
|
37
44
|
run: npm ci
|
|
38
45
|
<% } else if (packageManager === 'bun') { -%>
|
|
39
|
-
- name: Install bun
|
|
40
|
-
uses: oven-sh/setup-bun@v1
|
|
41
|
-
|
|
42
46
|
- name: Install Dependencies
|
|
43
47
|
run: bun install --frozen-lockfile
|
|
44
48
|
<% } -%>
|
|
@@ -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.
|
|
145
|
+
lt(pkg.packageManager.slice("yarn@".length), "4.12.0")
|
|
146
146
|
) {
|
|
147
|
-
pkg.packageManager = "yarn@4.
|
|
147
|
+
pkg.packageManager = "yarn@4.12.0";
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
// must be done after plugins installed
|
|
@@ -304,12 +304,9 @@ export default class PobLibGenerator extends Generator {
|
|
|
304
304
|
|
|
305
305
|
this.composeWith("pob:common:remove-old-dependencies");
|
|
306
306
|
|
|
307
|
-
const enableReleasePlease = !inMonorepo && this.options.ci;
|
|
308
|
-
|
|
309
307
|
this.composeWith("pob:common:testing", {
|
|
310
308
|
enable: this.pobjson.testing,
|
|
311
309
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
312
|
-
enableReleasePlease,
|
|
313
310
|
testing: this.pobjson.testing,
|
|
314
311
|
e2eTesting: false,
|
|
315
312
|
runner: this.pobjson.testing
|
|
@@ -336,6 +333,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
336
333
|
documentation:
|
|
337
334
|
!!this.pobjson.documentation ||
|
|
338
335
|
!!(this.pobjson.testing && this.pobjson.testing.codecov),
|
|
336
|
+
storybook: pkg?.devDependencies?.storybook,
|
|
339
337
|
testing: !!this.pobjson.testing,
|
|
340
338
|
testRunner: inMonorepo
|
|
341
339
|
? inMonorepo.pobMonorepoConfig.testRunner
|
|
@@ -365,7 +363,6 @@ export default class PobLibGenerator extends Generator {
|
|
|
365
363
|
withBabel,
|
|
366
364
|
withTypescript,
|
|
367
365
|
isMonorepo: false,
|
|
368
|
-
enableYarnVersion: true,
|
|
369
366
|
ci: this.options.ci,
|
|
370
367
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
371
368
|
updateOnly: this.options.updateOnly,
|