@plaudit/webpack-extensions 2.43.2 → 2.44.1
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.
|
@@ -389,7 +389,7 @@ class BlockJSONManagingPlugin {
|
|
|
389
389
|
if (cfg) {
|
|
390
390
|
if (Array.isArray(cfg)) {
|
|
391
391
|
for (let i = 0; i < cfg.length; i++) {
|
|
392
|
-
const assetDetails = getAssetDetails(blockFolder, cfg[i], rawAssetData);
|
|
392
|
+
const assetDetails = getAssetDetails(blockFolder, cfg[i], rawAssetData, mappableKey);
|
|
393
393
|
if (assetDetails) {
|
|
394
394
|
(assetDetails[0] ? styleHandles : scriptHandles)[assetDetails[1]] = assetDetails[2];
|
|
395
395
|
cfg[i] = assetDetails[1];
|
|
@@ -397,7 +397,7 @@ class BlockJSONManagingPlugin {
|
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
else {
|
|
400
|
-
const assetDetails = getAssetDetails(blockFolder, cfg, rawAssetData);
|
|
400
|
+
const assetDetails = getAssetDetails(blockFolder, cfg, rawAssetData, mappableKey);
|
|
401
401
|
if (assetDetails) {
|
|
402
402
|
(assetDetails[0] ? styleHandles : scriptHandles)[assetDetails[1]] = assetDetails[2];
|
|
403
403
|
config[mappableKey] = assetDetails[1];
|
|
@@ -407,7 +407,7 @@ class BlockJSONManagingPlugin {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
sortedBlockDirConfigData = Object.fromEntries([
|
|
410
|
-
["__metadata", { version:
|
|
410
|
+
["__metadata", { version: 3, ...Object.fromEntries(this.additionalMetadata.entries()), scriptHandles, styleHandles }],
|
|
411
411
|
...blockDirConfigs.map(entry => [entry[0], Object.fromEntries(Object.entries(entry[1]).filter(e => e[0] !== '$schema'))])
|
|
412
412
|
]);
|
|
413
413
|
compilation.deleteAsset("assets.json");
|
|
@@ -421,7 +421,9 @@ class BlockJSONManagingPlugin {
|
|
|
421
421
|
compilation.emitAsset("blockdir.config.php", new webpack_1.sources.RawSource("<?php return "
|
|
422
422
|
+ json_to_php_but_with____injection_1.default.make({ indent: "\t", linebreak: "\n", shortArraySyntax: true })(sortedBlockDirConfigData, "")
|
|
423
423
|
.replaceAll(/(\n\t*)\[\s+],/gs, "$1[],")
|
|
424
|
-
.replaceAll(
|
|
424
|
+
.replaceAll(/\[\n\t+([^\n]+)\n\t+]/gs, "[$1]")
|
|
425
|
+
.replaceAll(/'rest' => \[\n\t+(\[(?:'[^']+')?]),\n\t+('[^']+')(?:,\n\t+(\[[^\n]+]))?\n\t+]/gs, (_, deps, hash, args) => `'rest' => [${[deps, hash, args].filter(value => !!value).join(", ")}]`)
|
|
426
|
+
.replaceAll(/\[\t+]/gs, "[]")
|
|
425
427
|
+ ";"));
|
|
426
428
|
});
|
|
427
429
|
}
|
|
@@ -494,7 +496,7 @@ function makeSync() {
|
|
|
494
496
|
});
|
|
495
497
|
return res;
|
|
496
498
|
}
|
|
497
|
-
function getAssetDetails(blockFolder, asset, rawAssetData) {
|
|
499
|
+
function getAssetDetails(blockFolder, asset, rawAssetData, mappableKey) {
|
|
498
500
|
if (!asset.startsWith("file:./")) {
|
|
499
501
|
return undefined;
|
|
500
502
|
}
|
|
@@ -506,5 +508,8 @@ function getAssetDetails(blockFolder, asset, rawAssetData) {
|
|
|
506
508
|
if (!assetData) {
|
|
507
509
|
return undefined;
|
|
508
510
|
}
|
|
509
|
-
return [
|
|
511
|
+
return [
|
|
512
|
+
isCss, src.substring(0, src.length - (isCss ? 4 : 3)),
|
|
513
|
+
{ src, rest: isCss || mappableKey.startsWith("editor") ? [assetData.dependencies, assetData.version] : [assetData.dependencies, assetData.version, { strategy: 'defer' }] }
|
|
514
|
+
];
|
|
510
515
|
}
|
package/package.json
CHANGED
|
@@ -1,79 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
2
|
+
"name": "@plaudit/webpack-extensions",
|
|
3
|
+
"version": "2.44.1",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"prepublishOnly": "rm -rf build && mkdir build && tsc",
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"watch": "tsc -w"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"/build"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
"./wordpress-scripts-wrapper": "./build/wordpress-scripts-wrapper.js"
|
|
15
|
+
},
|
|
16
|
+
"typesVersions": {
|
|
17
|
+
"*": {
|
|
18
|
+
"wordpress-scripts-wrapper": [
|
|
19
|
+
"build/wordpress-scripts-wrapper.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@plaudit/gutenberg-api-extensions": "^2.66.1",
|
|
25
|
+
"@types/browser-sync-webpack-plugin": "^2.2.5",
|
|
26
|
+
"@types/node": "^22.14.1",
|
|
27
|
+
"@types/postcss-functions": "^4.0.4",
|
|
28
|
+
"@types/tapable": "^2.2.7",
|
|
29
|
+
"@types/webpack": "^5.28.5",
|
|
30
|
+
"@types/webpack-sources": "^3.2.3",
|
|
31
|
+
"postcss-load-config": "^4.0.2",
|
|
32
|
+
"postcss-loader": "^7.3.4",
|
|
33
|
+
"ts-node": "^10.9.2",
|
|
34
|
+
"typescript": "^5.8.3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@plaudit/postcss-color-function": "^5.0.0",
|
|
38
|
+
"@plaudit/postcss-silent-extend": "^3.0.0",
|
|
39
|
+
"@plaudit/postcss-strip-units": "^3.0.0",
|
|
40
|
+
"@plaudit/postcss-variables": "^1.1.0",
|
|
41
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.22.0",
|
|
42
|
+
"@wordpress/scripts": "^30.15.0",
|
|
43
|
+
"autoprefixer": "^10.4.21",
|
|
44
|
+
"browser-sync": "^3.0.4",
|
|
45
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
46
|
+
"copy-webpack-plugin": "^10.2.4",
|
|
47
|
+
"cssnano": "^6.1.2",
|
|
48
|
+
"eslint": "^8.57.1",
|
|
49
|
+
"eslint-plugin-jsdoc": "^48.11.0",
|
|
50
|
+
"fork-ts-checker-webpack-plugin": "^9.1.0",
|
|
51
|
+
"http-proxy-middleware": "^3.0.5",
|
|
52
|
+
"json2php": "^0.0.12",
|
|
53
|
+
"postcss": "^8.5.3",
|
|
54
|
+
"postcss-calc": "^9.0.1",
|
|
55
|
+
"postcss-discard-comments": "^6.0.2",
|
|
56
|
+
"postcss-fallback": "^0.1.0",
|
|
57
|
+
"postcss-functions": "^4.0.2",
|
|
58
|
+
"postcss-import": "^16.1.0",
|
|
59
|
+
"postcss-inline-svg": "^6.0.0",
|
|
60
|
+
"postcss-media-minmax": "^5.0.0",
|
|
61
|
+
"postcss-mixins": "6.2.3",
|
|
62
|
+
"postcss-nested": "^6.2.0",
|
|
63
|
+
"postcss-property-lookup": "^3.0.0",
|
|
64
|
+
"postcss-quantity-queries": "^0.5.0",
|
|
65
|
+
"postcss-reporter": "^7.1.0",
|
|
66
|
+
"postcss-short-position": "^4.0.1",
|
|
67
|
+
"postcss-short-size": "^4.0.0",
|
|
68
|
+
"postcss-short-spacing": "^4.0.0",
|
|
69
|
+
"postcss-simple-vars": "^7.0.1",
|
|
70
|
+
"postcss-url": "^10.1.3",
|
|
71
|
+
"react": "^18.3.1",
|
|
72
|
+
"react-dom": "^18.3.1",
|
|
73
|
+
"webpack": "^5.99.6",
|
|
74
|
+
"webpack-remove-empty-scripts": "^1.0.4",
|
|
75
|
+
"xml-formatter": "^3.6.5"
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=20"
|
|
79
|
+
},
|
|
80
|
+
"pnpm": {
|
|
81
|
+
"onlyBuiltDependencies": [
|
|
82
|
+
"core-js",
|
|
83
|
+
"core-js-pure"
|
|
84
|
+
],
|
|
85
|
+
"ignoredBuiltDependencies": [
|
|
86
|
+
"@parcel/watcher"
|
|
87
|
+
],
|
|
88
|
+
"overrides": {
|
|
89
|
+
"micromatch": "^4",
|
|
90
|
+
"react-autosize-textarea>react": "*",
|
|
91
|
+
"react-autosize-textarea>react-dom": "*"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|