pob 40.7.0 → 40.7.2
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/core/bun/CoreBunGenerator.js +2 -1
- package/lib/generators/core/bun/templates/bunfig.toml.ejs +3 -15
- package/lib/generators/core/pnpm/CorePnpmGenerator.js +2 -12
- package/lib/generators/core/yarn/CoreYarnGenerator.js +2 -10
- package/lib/utils/minimumReleaseAgeExcludes.js +44 -0
- package/lib/utils/minimumReleaseAgeExcludes.test.js +42 -0
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Generator from "yeoman-generator";
|
|
2
|
+
import { minimumReleaseAgeExcludeNames } from "../../../utils/minimumReleaseAgeExcludes.js";
|
|
2
3
|
|
|
3
4
|
export default class CoreBunGenerator extends Generator {
|
|
4
5
|
constructor(args, opts) {
|
|
@@ -30,7 +31,7 @@ export default class CoreBunGenerator extends Generator {
|
|
|
30
31
|
this.fs.copyTpl(
|
|
31
32
|
this.templatePath("bunfig.toml.ejs"),
|
|
32
33
|
this.destinationPath("bunfig.toml"),
|
|
33
|
-
{},
|
|
34
|
+
{ minimumReleaseAgeExcludes: minimumReleaseAgeExcludeNames },
|
|
34
35
|
);
|
|
35
36
|
} else {
|
|
36
37
|
this.fs.delete("bun.lock");
|
|
@@ -3,19 +3,7 @@
|
|
|
3
3
|
# Only install package versions published at least 2.5 days ago
|
|
4
4
|
minimumReleaseAge = 216000 # seconds
|
|
5
5
|
minimumReleaseAgeExcludes = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"@pob/rollup-esbuild",
|
|
10
|
-
"@pob/rollup-typescript",
|
|
11
|
-
"@pob/sort-object",
|
|
12
|
-
"@pob/sort-pkg",
|
|
13
|
-
"@pob/version",
|
|
14
|
-
"pob-dependencies",
|
|
15
|
-
"alouette",
|
|
16
|
-
"alouette-icons",
|
|
17
|
-
"nightingale",
|
|
18
|
-
"nightingale-logger",
|
|
19
|
-
"nightingale-levels",
|
|
20
|
-
"nightingale-types",
|
|
6
|
+
<% for (const name of minimumReleaseAgeExcludes) { -%>
|
|
7
|
+
<%- JSON.stringify(name) %>,
|
|
8
|
+
<% } -%>
|
|
21
9
|
]
|
|
@@ -3,6 +3,7 @@ import sortObject from "@pob/sort-object";
|
|
|
3
3
|
import { FAILSAFE_SCHEMA, dump, load, loadAll } from "js-yaml";
|
|
4
4
|
import { satisfies } from "semver";
|
|
5
5
|
import Generator from "yeoman-generator";
|
|
6
|
+
import { minimumReleaseAgeExcludePatterns } from "../../../utils/minimumReleaseAgeExcludes.js";
|
|
6
7
|
import { writeAndFormat } from "../../../utils/writeAndFormat.js";
|
|
7
8
|
|
|
8
9
|
const pnpmVersionRange = "^12.0.0";
|
|
@@ -40,17 +41,6 @@ const getRunningPnpmVersion = (cwd) => {
|
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
|
|
43
|
-
const minimumReleaseAgeExcludePackages = [
|
|
44
|
-
"@pob/*",
|
|
45
|
-
"pob",
|
|
46
|
-
"pob-dependencies",
|
|
47
|
-
"check-package-dependencies",
|
|
48
|
-
"alouette",
|
|
49
|
-
"alouette-icons",
|
|
50
|
-
"nightingale",
|
|
51
|
-
"nightingale-logger",
|
|
52
|
-
];
|
|
53
|
-
|
|
54
44
|
const trustedBuilds = ["esbuild"];
|
|
55
45
|
|
|
56
46
|
export default class CorePnpmGenerator extends Generator {
|
|
@@ -134,7 +124,7 @@ export default class CorePnpmGenerator extends Generator {
|
|
|
134
124
|
// keep the entries added by renovate for security updates, or manually
|
|
135
125
|
config.minimumReleaseAgeExclude = [
|
|
136
126
|
...new Set([
|
|
137
|
-
...
|
|
127
|
+
...minimumReleaseAgeExcludePatterns,
|
|
138
128
|
...(config.minimumReleaseAgeExclude ?? []),
|
|
139
129
|
]),
|
|
140
130
|
];
|
|
@@ -6,6 +6,7 @@ import { lt } from "semver";
|
|
|
6
6
|
import Generator from "yeoman-generator";
|
|
7
7
|
import { ensureJsonFileFormatted } from "../../../utils/ensureJsonFileFormatted.js";
|
|
8
8
|
import inMonorepo from "../../../utils/inMonorepo.js";
|
|
9
|
+
import { minimumReleaseAgeExcludePatterns } from "../../../utils/minimumReleaseAgeExcludes.js";
|
|
9
10
|
import * as packageUtils from "../../../utils/package.js";
|
|
10
11
|
import { writeAndFormat } from "../../../utils/writeAndFormat.js";
|
|
11
12
|
|
|
@@ -188,16 +189,7 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
188
189
|
delete config.enableMessageNames; // was a config for yarn < 4
|
|
189
190
|
config.nodeLinker = this.options.yarnNodeLinker;
|
|
190
191
|
config.npmMinimalAgeGate = 1440 * 2.5; // 2.5 days
|
|
191
|
-
config.npmPreapprovedPackages = [
|
|
192
|
-
"@pob/*",
|
|
193
|
-
"pob-dependencies",
|
|
194
|
-
"alouette",
|
|
195
|
-
"alouette-icons",
|
|
196
|
-
"nightingale",
|
|
197
|
-
"nightingale-logger",
|
|
198
|
-
"nightingale-levels",
|
|
199
|
-
"nightingale-types",
|
|
200
|
-
];
|
|
192
|
+
config.npmPreapprovedPackages = [...minimumReleaseAgeExcludePatterns];
|
|
201
193
|
|
|
202
194
|
if (config.yarnPath) {
|
|
203
195
|
this.fs.delete(config.yarnPath);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Packages exempt from the minimum release age, so a repository can use a
|
|
2
|
+
// release of pob or of its own dependencies right away. Lockstep releases are
|
|
3
|
+
// listed together: nightingale-logger pins nightingale-levels and
|
|
4
|
+
// nightingale-types to the version published with it.
|
|
5
|
+
const otherPackages = [
|
|
6
|
+
"pob",
|
|
7
|
+
"pob-dependencies",
|
|
8
|
+
"check-package-dependencies",
|
|
9
|
+
"alouette",
|
|
10
|
+
"alouette-icons",
|
|
11
|
+
"nightingale",
|
|
12
|
+
"nightingale-logger",
|
|
13
|
+
"nightingale-levels",
|
|
14
|
+
"nightingale-types",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
// bun matches exact names only (no glob): every published @pob package,
|
|
18
|
+
// including @pob/eslint-config-typescript, no longer in this repository.
|
|
19
|
+
const pobScopePackages = [
|
|
20
|
+
"@pob/codemods",
|
|
21
|
+
"@pob/commitlint-config",
|
|
22
|
+
"@pob/esbuild",
|
|
23
|
+
"@pob/eslint-config",
|
|
24
|
+
"@pob/eslint-config-typescript",
|
|
25
|
+
"@pob/eslint-config-typescript-react",
|
|
26
|
+
"@pob/eslint-plugin",
|
|
27
|
+
"@pob/pretty-pkg",
|
|
28
|
+
"@pob/rollup",
|
|
29
|
+
"@pob/rollup-esbuild",
|
|
30
|
+
"@pob/rollup-typescript",
|
|
31
|
+
"@pob/root",
|
|
32
|
+
"@pob/sort-object",
|
|
33
|
+
"@pob/sort-pkg",
|
|
34
|
+
"@pob/version",
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
/** pnpm `minimumReleaseAgeExclude`, yarn `npmPreapprovedPackages` (globs) */
|
|
38
|
+
export const minimumReleaseAgeExcludePatterns = ["@pob/*", ...otherPackages];
|
|
39
|
+
|
|
40
|
+
/** bun `minimumReleaseAgeExcludes` (exact names) */
|
|
41
|
+
export const minimumReleaseAgeExcludeNames = [
|
|
42
|
+
...pobScopePackages,
|
|
43
|
+
...otherPackages,
|
|
44
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import {
|
|
6
|
+
minimumReleaseAgeExcludeNames,
|
|
7
|
+
minimumReleaseAgeExcludePatterns,
|
|
8
|
+
} from "./minimumReleaseAgeExcludes.js";
|
|
9
|
+
|
|
10
|
+
const rootPath = fileURLToPath(new URL("../../../../", import.meta.url));
|
|
11
|
+
|
|
12
|
+
const readPublishedPackageNames = (directory) =>
|
|
13
|
+
fs
|
|
14
|
+
.readdirSync(path.join(rootPath, directory), { withFileTypes: true })
|
|
15
|
+
.filter((entry) => entry.isDirectory())
|
|
16
|
+
.map((entry) => path.join(rootPath, directory, entry.name, "package.json"))
|
|
17
|
+
.filter((packageJsonPath) => fs.existsSync(packageJsonPath))
|
|
18
|
+
.map((packageJsonPath) => JSON.parse(fs.readFileSync(packageJsonPath)))
|
|
19
|
+
.filter((pkg) => !pkg.private)
|
|
20
|
+
.map((pkg) => pkg.name);
|
|
21
|
+
|
|
22
|
+
describe("minimumReleaseAgeExcludes", () => {
|
|
23
|
+
it("lists every published @pob package by name for bun", () => {
|
|
24
|
+
for (const name of readPublishedPackageNames("@pob")) {
|
|
25
|
+
expect(minimumReleaseAgeExcludeNames).toContain(name);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("excludes the same packages with globs and with exact names", () => {
|
|
30
|
+
expect(
|
|
31
|
+
minimumReleaseAgeExcludeNames.filter((name) => !name.startsWith("@pob/")),
|
|
32
|
+
).toStrictEqual(
|
|
33
|
+
minimumReleaseAgeExcludePatterns.filter((name) => name !== "@pob/*"),
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("uses no glob in exact names", () => {
|
|
38
|
+
for (const name of minimumReleaseAgeExcludeNames) {
|
|
39
|
+
expect(name).not.toContain("*");
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "40.7.
|
|
3
|
+
"version": "40.7.2",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/vitest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"yeoman-generator": "10.3.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@pob/root": "28.6.
|
|
61
|
+
"@pob/root": "28.6.1",
|
|
62
62
|
"@types/node": "24.19.1",
|
|
63
63
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
64
64
|
"@yeoman/types": "1.13.1",
|