@w5s/pnpm-plugin-config 1.12.0 → 1.13.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/dist/index.d.ts +11 -11
- package/dist/index.js +24 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/defaultConfig.ts +5 -10
- package/src/internal/betterDefaultConfig.ts +19 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cafs, ResolvedFrom } from "@pnpm/cafs-types";
|
|
2
2
|
//#region src/defaultConfig.d.ts
|
|
3
|
-
declare const defaultConfig: Readonly<{
|
|
3
|
+
export declare const defaultConfig: Readonly<{
|
|
4
4
|
allowBuilds: {
|
|
5
5
|
'@parcel/watcher': true;
|
|
6
6
|
'@swc/core': true;
|
|
@@ -15,17 +15,18 @@ declare const defaultConfig: Readonly<{
|
|
|
15
15
|
re2: true;
|
|
16
16
|
sharp: true;
|
|
17
17
|
};
|
|
18
|
+
enableGlobalVirtualStore: false;
|
|
19
|
+
minimumReleaseAgeExclude: string[];
|
|
20
|
+
overrides: {};
|
|
21
|
+
verifyDepsBeforeRun: false;
|
|
18
22
|
blockExoticSubdeps: true;
|
|
19
23
|
enablePrePostScripts: false;
|
|
20
24
|
ignorePatchFailures: false;
|
|
21
25
|
minimumReleaseAge: number;
|
|
22
|
-
minimumReleaseAgeExclude: string[];
|
|
23
26
|
optimisticRepeatInstall: true;
|
|
24
|
-
overrides: {};
|
|
25
27
|
resolutionMode: "lowest-direct";
|
|
26
28
|
trustPolicy: "no-downgrade";
|
|
27
29
|
trustPolicyIgnoreAfter: number;
|
|
28
|
-
verifyDepsBeforeRun: "install";
|
|
29
30
|
}>;
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region ../../node_modules/.pnpm/@pnpm+catalogs.types@1000.0.0/node_modules/@pnpm/catalogs.types/lib/index.d.ts
|
|
@@ -1235,26 +1236,26 @@ interface Config extends OptionsFromRootManifest {
|
|
|
1235
1236
|
}
|
|
1236
1237
|
//#endregion
|
|
1237
1238
|
//#region src/hooks.d.ts
|
|
1238
|
-
declare const hooks: {
|
|
1239
|
+
export declare const hooks: {
|
|
1239
1240
|
updateConfig(config: Partial<Config>): Partial<Config>;
|
|
1240
1241
|
};
|
|
1241
1242
|
//#endregion
|
|
1242
1243
|
//#region src/meta.d.ts
|
|
1243
|
-
declare const meta: Readonly<{
|
|
1244
|
+
export declare const meta: Readonly<{
|
|
1244
1245
|
buildNumber: number;
|
|
1245
1246
|
name: string;
|
|
1246
1247
|
version: string;
|
|
1247
1248
|
}>;
|
|
1248
1249
|
//#endregion
|
|
1249
1250
|
//#region src/PnpmConfig.d.ts
|
|
1250
|
-
type PnpmConfig = Config;
|
|
1251
|
+
export type PnpmConfig = Config;
|
|
1251
1252
|
//#endregion
|
|
1252
1253
|
//#region src/PnpmUserConfig.d.ts
|
|
1253
|
-
type PnpmUserConfig = Partial<PnpmConfig>;
|
|
1254
|
+
export type PnpmUserConfig = Partial<PnpmConfig>;
|
|
1254
1255
|
/**
|
|
1255
1256
|
* @namespace
|
|
1256
1257
|
*/
|
|
1257
|
-
declare const PnpmUserConfig: Readonly<{
|
|
1258
|
+
export declare const PnpmUserConfig: Readonly<{
|
|
1258
1259
|
/**
|
|
1259
1260
|
* Merge two configs immutably. `extension` values win; `base` fills in
|
|
1260
1261
|
* undefined slots. `allowBuilds` and `overrides` are deep-merged (extension
|
|
@@ -1271,9 +1272,8 @@ declare const PnpmUserConfig: Readonly<{
|
|
|
1271
1272
|
//#endregion
|
|
1272
1273
|
//#region src/PnpmHooks.d.ts
|
|
1273
1274
|
/** Hooks exported by this plugin's pnpmfile. */
|
|
1274
|
-
interface PnpmHooks extends Omit<Hooks, 'updateConfig'> {
|
|
1275
|
+
export interface PnpmHooks extends Omit<Hooks, 'updateConfig'> {
|
|
1275
1276
|
updateConfig?: (config: PnpmUserConfig) => PnpmUserConfig | Promise<PnpmUserConfig>;
|
|
1276
1277
|
}
|
|
1277
1278
|
//#endregion
|
|
1278
|
-
export { PnpmConfig, PnpmHooks, PnpmUserConfig, defaultConfig, hooks, meta };
|
|
1279
1279
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
//#region src/internal/betterDefaultConfig.ts
|
|
2
|
+
/**
|
|
3
|
+
* Curated defaults from [@pnpm/plugin-better-defaults](https://github.com/pnpm/plugin-better-defaults).
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/pnpm/plugin-better-defaults
|
|
6
|
+
*/
|
|
7
|
+
const betterDefaultConfig = Object.freeze({
|
|
8
|
+
blockExoticSubdeps: true,
|
|
9
|
+
enableGlobalVirtualStore: true,
|
|
10
|
+
enablePrePostScripts: false,
|
|
11
|
+
ignorePatchFailures: false,
|
|
12
|
+
minimumReleaseAge: 1440,
|
|
13
|
+
optimisticRepeatInstall: true,
|
|
14
|
+
resolutionMode: "lowest-direct",
|
|
15
|
+
trustPolicy: "no-downgrade",
|
|
16
|
+
trustPolicyIgnoreAfter: 10080,
|
|
17
|
+
verifyDepsBeforeRun: "install"
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
1
20
|
//#region src/defaultConfig.ts
|
|
2
21
|
const defaultConfig = Object.freeze({
|
|
22
|
+
...betterDefaultConfig,
|
|
3
23
|
allowBuilds: {
|
|
4
24
|
"@parcel/watcher": true,
|
|
5
25
|
"@swc/core": true,
|
|
@@ -14,17 +34,10 @@ const defaultConfig = Object.freeze({
|
|
|
14
34
|
"re2": true,
|
|
15
35
|
"sharp": true
|
|
16
36
|
},
|
|
17
|
-
|
|
18
|
-
enablePrePostScripts: false,
|
|
19
|
-
ignorePatchFailures: false,
|
|
20
|
-
minimumReleaseAge: 1440,
|
|
37
|
+
enableGlobalVirtualStore: false,
|
|
21
38
|
minimumReleaseAgeExclude: ["@w5s/*"],
|
|
22
|
-
optimisticRepeatInstall: true,
|
|
23
39
|
overrides: {},
|
|
24
|
-
|
|
25
|
-
trustPolicy: "no-downgrade",
|
|
26
|
-
trustPolicyIgnoreAfter: 10080,
|
|
27
|
-
verifyDepsBeforeRun: "install"
|
|
40
|
+
verifyDepsBeforeRun: false
|
|
28
41
|
});
|
|
29
42
|
//#endregion
|
|
30
43
|
//#region src/PnpmUserConfig.ts
|
|
@@ -89,9 +102,9 @@ const hooks = { updateConfig(config) {
|
|
|
89
102
|
//#endregion
|
|
90
103
|
//#region src/meta.ts
|
|
91
104
|
const meta = Object.freeze({
|
|
92
|
-
buildNumber:
|
|
105
|
+
buildNumber: 1788793943,
|
|
93
106
|
name: "@w5s/pnpm-plugin-config",
|
|
94
|
-
version: "1.
|
|
107
|
+
version: "1.13.0"
|
|
95
108
|
});
|
|
96
109
|
//#endregion
|
|
97
110
|
export { PnpmUserConfig, defaultConfig, hooks, meta };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/defaultConfig.ts","../src/PnpmUserConfig.ts","../src/hooks.ts","../src/meta.ts"],"sourcesContent":["import type { PnpmUserConfig } from './PnpmUserConfig.js';\n\n// Opinionated defaults inspired by @pnpm/plugin-better-defaults, extended with org-specific settings.\nexport const defaultConfig = Object.freeze({\n allowBuilds: {\n '@parcel/watcher': true,\n '@swc/core': true,\n 'core-js': true,\n 'core-js-pure': true,\n 'electron': true,\n 'es5-ext': true,\n 'esbuild': true,\n 'lefthook': true,\n 'nx': true,\n 'protobufjs': true,\n 're2': true,\n 'sharp': true,\n },\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/internal/betterDefaultConfig.ts","../src/defaultConfig.ts","../src/PnpmUserConfig.ts","../src/hooks.ts","../src/meta.ts"],"sourcesContent":["import type { PnpmUserConfig } from '../PnpmUserConfig.js';\n\n/**\n * Curated defaults from [@pnpm/plugin-better-defaults](https://github.com/pnpm/plugin-better-defaults).\n *\n * @see https://github.com/pnpm/plugin-better-defaults\n */\nexport const betterDefaultConfig = Object.freeze({\n blockExoticSubdeps: true,\n enableGlobalVirtualStore: true,\n enablePrePostScripts: false,\n ignorePatchFailures: false,\n minimumReleaseAge: 1 * 24 * 60, // 1 day in minutes\n optimisticRepeatInstall: true,\n resolutionMode: 'lowest-direct',\n trustPolicy: 'no-downgrade',\n trustPolicyIgnoreAfter: 7 * 24 * 60, // 7 days in minutes\n verifyDepsBeforeRun: 'install',\n} satisfies PnpmUserConfig);\n","import type { PnpmUserConfig } from './PnpmUserConfig.js';\n\nimport { betterDefaultConfig } from './internal/betterDefaultConfig.js';\n\n// Opinionated defaults inspired by @pnpm/plugin-better-defaults, extended with org-specific settings.\nexport const defaultConfig = Object.freeze({\n ...betterDefaultConfig,\n allowBuilds: {\n '@parcel/watcher': true,\n '@swc/core': true,\n 'core-js': true,\n 'core-js-pure': true,\n 'electron': true,\n 'es5-ext': true,\n 'esbuild': true,\n 'lefthook': true,\n 'nx': true,\n 'protobufjs': true,\n 're2': true,\n 'sharp': true,\n },\n enableGlobalVirtualStore: false, // FIXME: this does not work\n minimumReleaseAgeExclude: ['@w5s/*'],\n overrides: {},\n verifyDepsBeforeRun: false, // FIXME: Causes infinite loop with prepare and pnpm run inside prepare/postinstall\n} satisfies PnpmUserConfig);\n","import type { PnpmConfig } from './PnpmConfig.js';\n\nexport type PnpmUserConfig = Partial<PnpmConfig>;\n\nfunction arrayMerge<T>(\n base: ReadonlyArray<T> | T | undefined,\n extension: ReadonlyArray<T> | T | undefined,\n): Array<T> | undefined {\n const baseArray = base == null ? [] : Array.isArray(base) ? base : [base];\n const extensionArray = extension == null ? [] : Array.isArray(extension) ? extension : [extension];\n if (baseArray.length === 0 && extensionArray.length === 0) return undefined;\n return [...new Set([...baseArray, ...extensionArray])];\n}\n\nfunction objectMergeDefault<P extends string, V extends object>(\n base: Partial<Record<P, V>>,\n extension: Partial<Record<P, V>>,\n property: P,\n): undefined | V {\n return {\n ...base[property],\n ...extension[property],\n };\n}\n\nfunction objectMergeForce<P extends string, V extends object>(\n base: Partial<Record<P, V>>,\n extension: Partial<Record<P, V>>,\n property: P,\n): undefined | V {\n return {\n ...extension[property],\n ...base[property],\n };\n}\n\n/**\n * @namespace\n */\nexport const PnpmUserConfig = Object.freeze({\n /**\n * Merge two configs immutably. `extension` values win; `base` fills in\n * undefined slots. `allowBuilds` and `overrides` are deep-merged (extension\n * entries win). `minimumReleaseAgeExclude`, `hoistPattern`, and\n * `publicHoistPattern` are merged as deduplicated unions of both arrays\n * (base first, extension second — so pnpm `!`-negation entries in extension\n * can exclude org defaults).\n *\n * @param base\n * @param extension\n */\n merge(base: PnpmUserConfig, extension: PnpmUserConfig): PnpmUserConfig {\n return {\n ...extension,\n allowBuilds: objectMergeForce(base, extension, 'allowBuilds'),\n blockExoticSubdeps: extension.blockExoticSubdeps ?? base.blockExoticSubdeps,\n enableGlobalVirtualStore: extension.enableGlobalVirtualStore ?? base.enableGlobalVirtualStore,\n enablePrePostScripts: extension.enablePrePostScripts ?? base.enablePrePostScripts,\n hoistPattern: arrayMerge(base.hoistPattern, extension.hoistPattern),\n ignorePatchFailures: extension.ignorePatchFailures ?? base.ignorePatchFailures,\n minimumReleaseAge: extension.minimumReleaseAge ?? base.minimumReleaseAge,\n minimumReleaseAgeExclude: arrayMerge(\n base.minimumReleaseAgeExclude,\n extension.minimumReleaseAgeExclude,\n ),\n optimisticRepeatInstall: extension.optimisticRepeatInstall ?? base.optimisticRepeatInstall,\n overrides: objectMergeDefault(base, extension, 'overrides'),\n publicHoistPattern: arrayMerge(\n base.publicHoistPattern,\n extension.publicHoistPattern,\n ),\n resolutionMode: extension.resolutionMode ?? base.resolutionMode,\n trustPolicy: extension.trustPolicy ?? base.trustPolicy,\n trustPolicyIgnoreAfter: extension.trustPolicyIgnoreAfter ?? base.trustPolicyIgnoreAfter,\n verifyDepsBeforeRun: extension.verifyDepsBeforeRun ?? base.verifyDepsBeforeRun,\n } as PnpmUserConfig;\n },\n});\n","import type { PnpmHooks } from './PnpmHooks.js';\n\nimport { defaultConfig } from './defaultConfig.js';\nimport { PnpmUserConfig } from './PnpmUserConfig.js';\n\nexport const hooks = {\n updateConfig(config) {\n return PnpmUserConfig.merge(defaultConfig, config);\n },\n} satisfies PnpmHooks;\n","export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n buildNumber: (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,\n // @ts-ignore - these variables are injected at build time\n name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,\n // @ts-ignore - these variables are injected at build time\n version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,\n});\n"],"mappings":";;;;;;AAOA,MAAa,sBAAsB,OAAO,OAAO;CAC/C,oBAAoB;CACpB,0BAA0B;CAC1B,sBAAsB;CACtB,qBAAqB;CACrB,mBAAmB;CACnB,yBAAyB;CACzB,gBAAgB;CAChB,aAAa;CACb,wBAAwB;CACxB,qBAAqB;AACvB,CAA0B;;;ACb1B,MAAa,gBAAgB,OAAO,OAAO;CACzC,GAAG;CACH,aAAa;EACX,mBAAmB;EACnB,aAAa;EACb,WAAW;EACX,gBAAgB;EAChB,YAAY;EACZ,WAAW;EACX,WAAW;EACX,YAAY;EACZ,MAAM;EACN,cAAc;EACd,OAAO;EACP,SAAS;CACX;CACA,0BAA0B;CAC1B,0BAA0B,CAAC,QAAQ;CACnC,WAAW,CAAC;CACZ,qBAAqB;AACvB,CAA0B;;;ACrB1B,SAAS,WACP,MACA,WACsB;CACtB,MAAM,YAAY,QAAQ,OAAO,CAAC,IAAI,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;CACxE,MAAM,iBAAiB,aAAa,OAAO,CAAC,IAAI,MAAM,QAAQ,SAAS,IAAI,YAAY,CAAC,SAAS;CACjG,IAAI,UAAU,WAAW,KAAK,eAAe,WAAW,GAAG,OAAO,KAAA;CAClE,OAAO,CAAC,mB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4
4
|
"description": "Shared pnpm configuration plugin with org defaults",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "f01e374782fdf338f411115d7e82a0353540282b"
|
|
45
45
|
}
|
package/src/defaultConfig.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { PnpmUserConfig } from './PnpmUserConfig.js';
|
|
2
2
|
|
|
3
|
+
import { betterDefaultConfig } from './internal/betterDefaultConfig.js';
|
|
4
|
+
|
|
3
5
|
// Opinionated defaults inspired by @pnpm/plugin-better-defaults, extended with org-specific settings.
|
|
4
6
|
export const defaultConfig = Object.freeze({
|
|
7
|
+
...betterDefaultConfig,
|
|
5
8
|
allowBuilds: {
|
|
6
9
|
'@parcel/watcher': true,
|
|
7
10
|
'@swc/core': true,
|
|
@@ -16,16 +19,8 @@ export const defaultConfig = Object.freeze({
|
|
|
16
19
|
're2': true,
|
|
17
20
|
'sharp': true,
|
|
18
21
|
},
|
|
19
|
-
|
|
20
|
-
// enableGlobalVirtualStore: true, FIXME: this does not work
|
|
21
|
-
enablePrePostScripts: false,
|
|
22
|
-
ignorePatchFailures: false,
|
|
23
|
-
minimumReleaseAge: 1 * 24 * 60,
|
|
22
|
+
enableGlobalVirtualStore: false, // FIXME: this does not work
|
|
24
23
|
minimumReleaseAgeExclude: ['@w5s/*'],
|
|
25
|
-
optimisticRepeatInstall: true,
|
|
26
24
|
overrides: {},
|
|
27
|
-
|
|
28
|
-
trustPolicy: 'no-downgrade',
|
|
29
|
-
trustPolicyIgnoreAfter: 7 * 24 * 60,
|
|
30
|
-
verifyDepsBeforeRun: 'install',
|
|
25
|
+
verifyDepsBeforeRun: false, // FIXME: Causes infinite loop with prepare and pnpm run inside prepare/postinstall
|
|
31
26
|
} satisfies PnpmUserConfig);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PnpmUserConfig } from '../PnpmUserConfig.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Curated defaults from [@pnpm/plugin-better-defaults](https://github.com/pnpm/plugin-better-defaults).
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/pnpm/plugin-better-defaults
|
|
7
|
+
*/
|
|
8
|
+
export const betterDefaultConfig = Object.freeze({
|
|
9
|
+
blockExoticSubdeps: true,
|
|
10
|
+
enableGlobalVirtualStore: true,
|
|
11
|
+
enablePrePostScripts: false,
|
|
12
|
+
ignorePatchFailures: false,
|
|
13
|
+
minimumReleaseAge: 1 * 24 * 60, // 1 day in minutes
|
|
14
|
+
optimisticRepeatInstall: true,
|
|
15
|
+
resolutionMode: 'lowest-direct',
|
|
16
|
+
trustPolicy: 'no-downgrade',
|
|
17
|
+
trustPolicyIgnoreAfter: 7 * 24 * 60, // 7 days in minutes
|
|
18
|
+
verifyDepsBeforeRun: 'install',
|
|
19
|
+
} satisfies PnpmUserConfig);
|