@plaudit/pnpm-plugin-plaudit-config 1.0.4 → 1.1.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 CHANGED
@@ -5,6 +5,14 @@ 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.1.0] - 2026-04-17
9
+ ### Added
10
+ - Support for declaring patches
11
+
12
+ ### Fixed
13
+ - The mergeable config stuff not working properly
14
+ - Another pair of packages that an idiot with admin privileges at WordPress bricked even after I warned them about it
15
+
8
16
  ## [1.0.4] - 2026-04-16
9
17
  ### Fixed
10
18
  - My code assuming that pnpm wouldn't idiotically clobber the output of config functions
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@plaudit/pnpm-plugin-plaudit-config",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
+ "./patches",
6
7
  "./pnpmfile.cjs",
7
8
  "CHANGELOG.md",
8
9
  "LICENSE.md",
@@ -12,10 +13,10 @@
12
13
  "devDependencies": {
13
14
  "@pnpm/hooks.pnpmfile": "^1100.0.1",
14
15
  "@pnpm/types": "^1100.0.0",
15
- "typescript": "^6.0.2"
16
+ "typescript": "^6.0.3"
16
17
  },
17
18
  "scripts": {
18
- "build": "tsc",
19
+ "build": "tsc && cp -f dist/pnpmfile.cjs .",
19
20
  "clean": "rm -rf dist pnpmfile.cjs"
20
21
  }
21
22
  }
package/pnpmfile.cjs CHANGED
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const dependencyKeys = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
3
+ const { join } = require("node:path");
4
+ /**
5
+ * A map of "<package id>[@<version identifier>]" -> "file in the 'patches' folder" pairs
6
+ */
7
+ const activePatches = {
8
+ // "webpack@5.*": "webpack.patch"
9
+ };
4
10
  const globalForcePinDependenciesRegex = false; ///^@wordpress\//;
11
+ const dependencyKeys = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
5
12
  let rootPkg = undefined;
6
13
  module.exports = {
7
14
  hooks: {
@@ -24,22 +31,25 @@ module.exports = {
24
31
  return pkg;
25
32
  },
26
33
  updateConfig(config) {
34
+ const mergeableConfig = config.rootProjectManifest?.pnpm ?? {};
27
35
  return Object.assign(config, {
28
36
  allowBuilds: {
29
37
  "core-js": true,
30
38
  "core-js-pure": true,
31
39
  "@parcel/watcher": false,
32
40
  "unrs-resolver": false,
33
- ...Object.fromEntries((config.onlyBuiltDependencies ?? []).map(dep => [dep, true])),
34
- ...Object.fromEntries((config.ignoredBuiltDependencies ?? []).map(dep => [dep, false])),
41
+ ...Object.fromEntries((mergeableConfig.onlyBuiltDependencies ?? []).map(dep => [dep, true])),
42
+ ...Object.fromEntries((mergeableConfig.ignoredBuiltDependencies ?? []).map(dep => [dep, false])),
35
43
  ...config.allowBuilds,
36
- ...config.projectAllowBuilds,
44
+ ...mergeableConfig.projectAllowBuilds,
37
45
  },
38
46
  overrides: {
39
47
  "micromatch": "^4",
40
48
  "react-autosize-textarea>react": "*",
41
49
  "react-autosize-textarea>react-dom": "*",
42
50
  //Temporary pinnings because WordPress bricked their typedefs
51
+ "@types/wordpress__block-editor": "15.0.5",
52
+ "@types/wordpress__blocks": "15.10.2",
43
53
  "@wordpress/block-editor": "15.16.0",
44
54
  "@wordpress/blocks": "15.16.0",
45
55
  "@wordpress/components": "30.9.0",
@@ -53,8 +63,14 @@ module.exports = {
53
63
  "@wordpress/icons": "12.1.0",
54
64
  "date-fns": "^4.0.0",
55
65
  ...config.overrides,
56
- ...config.projectOverrides
57
- }
66
+ ...mergeableConfig.projectOverrides
67
+ },
68
+ patchedDependencies: {
69
+ ...Object.fromEntries(Object.entries(activePatches).map(([dependency, patchFilePath]) => [dependency, join(__dirname, 'patches', patchFilePath)])),
70
+ ...config.patchedDependencies,
71
+ ...mergeableConfig.projectPatchedDependencies
72
+ },
73
+ allowUnusedPatches: true
58
74
  });
59
75
  }
60
76
  },