@plaudit/pnpm-plugin-plaudit-config 1.0.2 → 1.0.4

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/package.json +11 -2
  3. package/pnpmfile.cjs +64 -66
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.4] - 2026-04-16
9
+ ### Fixed
10
+ - My code assuming that pnpm wouldn't idiotically clobber the output of config functions
11
+
12
+ ## [1.0.3] - 2026-04-16
13
+ ### Fixed
14
+ - The allowBuilds property being inconsistent at best (I hope)
15
+
16
+ ### Internals
17
+ - Switched to using TypeScript
18
+
8
19
  ## [1.0.2] - 2026-04-15
9
20
  ### Added
10
21
  - A pin to eliminate another dependency conflict message caused by WordPress
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/pnpm-plugin-plaudit-config",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "./pnpmfile.cjs",
@@ -8,5 +8,14 @@
8
8
  "LICENSE.md",
9
9
  "README.md"
10
10
  ],
11
- "sideEffects": false
11
+ "sideEffects": false,
12
+ "devDependencies": {
13
+ "@pnpm/hooks.pnpmfile": "^1100.0.1",
14
+ "@pnpm/types": "^1100.0.0",
15
+ "typescript": "^6.0.2"
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "clean": "rm -rf dist pnpmfile.cjs"
20
+ }
12
21
  }
package/pnpmfile.cjs CHANGED
@@ -1,71 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  const dependencyKeys = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
2
- const globalForcePinDependenciesRegex = false;///^@wordpress\//;
3
-
4
+ const globalForcePinDependenciesRegex = false; ///^@wordpress\//;
4
5
  let rootPkg = undefined;
5
6
  module.exports = {
6
- hooks: {
7
- readPackage(pkg) {
8
- if (globalForcePinDependenciesRegex) {
9
- for (const dependencyKey of dependencyKeys) {
10
- if (pkg[dependencyKey]) {
11
- pkg[dependencyKey] = forcePinDependencies(globalForcePinDependenciesRegex, pkg[dependencyKey]);
12
- }
13
- }
14
- }
15
- if (rootPkg === undefined || pkg === rootPkg) {
16
- rootPkg = pkg;
17
- } else {
18
- if (pkg.peerDependencies?.['@types/node']) {
19
- pkg.peerDependencies['@types/node'] += " || >24";
20
- }
21
- }
22
- return pkg;
23
- },
24
- updateConfig(config) {
25
- config.allowBuilds = {
26
- "core-js": true,
27
- "core-js-pure": true,
28
- "@parcel/watcher": false,
29
- "unrs-resolver": false,
30
- ...Object.fromEntries((config.onlyBuiltDependencies ?? []).map(dep => [dep, true])),
31
- ...Object.fromEntries((config.ignoredBuiltDependencies ?? []).map(dep => [dep, false])),
32
- ...config.allowBuilds,
33
- };
34
- config.overrides = {
35
- ...(config.overrides ?? {}),
36
- "micromatch": "^4",
37
- "react-autosize-textarea>react": "*",
38
- "react-autosize-textarea>react-dom": "*",
39
-
40
- //Temporary pinnings because WordPress bricked their typedefs
41
- "@wordpress/block-editor": "15.16.0",
42
- "@wordpress/blocks": "15.16.0",
43
- "@wordpress/components": "30.9.0",
44
- "@wordpress/compose": "7.43.0",
45
- "@wordpress/core-data": "7.43.0",
46
- "@wordpress/data": "10.43.0",
47
- "@wordpress/editor": "14.43.0",
48
- "@wordpress/element": "6.43.0",
49
- "@wordpress/hooks": "4.43.0",
50
- "@wordpress/i18n": "6.16.0",
51
- "@wordpress/icons": "12.1.0",
52
- "date-fns": "^4.0.0"
53
- };
54
- return config;
55
- }
56
- }
57
- }
58
-
59
- /**
60
- * @param {RegExp} pattern
61
- * @param {{[p: string]: string}|undefined} dependenciesObject
62
- */
7
+ hooks: {
8
+ readPackage(pkg) {
9
+ if (globalForcePinDependenciesRegex) {
10
+ for (const dependencyKey of dependencyKeys) {
11
+ if (pkg[dependencyKey]) {
12
+ pkg[dependencyKey] = forcePinDependencies(globalForcePinDependenciesRegex, pkg[dependencyKey]);
13
+ }
14
+ }
15
+ }
16
+ if (rootPkg === undefined || pkg === rootPkg) {
17
+ rootPkg = pkg;
18
+ }
19
+ else {
20
+ if (pkg.peerDependencies?.['@types/node']) {
21
+ pkg.peerDependencies['@types/node'] += " || >24";
22
+ }
23
+ }
24
+ return pkg;
25
+ },
26
+ updateConfig(config) {
27
+ return Object.assign(config, {
28
+ allowBuilds: {
29
+ "core-js": true,
30
+ "core-js-pure": true,
31
+ "@parcel/watcher": false,
32
+ "unrs-resolver": false,
33
+ ...Object.fromEntries((config.onlyBuiltDependencies ?? []).map(dep => [dep, true])),
34
+ ...Object.fromEntries((config.ignoredBuiltDependencies ?? []).map(dep => [dep, false])),
35
+ ...config.allowBuilds,
36
+ ...config.projectAllowBuilds,
37
+ },
38
+ overrides: {
39
+ "micromatch": "^4",
40
+ "react-autosize-textarea>react": "*",
41
+ "react-autosize-textarea>react-dom": "*",
42
+ //Temporary pinnings because WordPress bricked their typedefs
43
+ "@wordpress/block-editor": "15.16.0",
44
+ "@wordpress/blocks": "15.16.0",
45
+ "@wordpress/components": "30.9.0",
46
+ "@wordpress/compose": "7.43.0",
47
+ "@wordpress/core-data": "7.43.0",
48
+ "@wordpress/data": "10.43.0",
49
+ "@wordpress/editor": "14.43.0",
50
+ "@wordpress/element": "6.43.0",
51
+ "@wordpress/hooks": "4.43.0",
52
+ "@wordpress/i18n": "6.16.0",
53
+ "@wordpress/icons": "12.1.0",
54
+ "date-fns": "^4.0.0",
55
+ ...config.overrides,
56
+ ...config.projectOverrides
57
+ }
58
+ });
59
+ }
60
+ },
61
+ };
63
62
  function forcePinDependencies(pattern, dependenciesObject) {
64
- if (!dependenciesObject) {
65
- return dependenciesObject;
66
- }
67
- return Object.fromEntries(
68
- Object.entries(dependenciesObject)
69
- .map(([key, value]) => pattern.test(key) ? [key, value.startsWith("^") ? value.substring(1) : value] : [key, value])
70
- );
63
+ if (!dependenciesObject) {
64
+ return dependenciesObject;
65
+ }
66
+ return Object.fromEntries(Object.entries(dependenciesObject)
67
+ .map(([key, value]) => pattern.test(key) ? [key, value.startsWith("^") ? value.substring(1) : value] : [key, value]));
71
68
  }
69
+ //# sourceMappingURL=pnpmfile.cjs.map