@plaudit/webpack-extensions 3.4.0 → 3.4.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.
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ 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
|
+
## [3.4.1] - 2026-03-17
|
|
9
|
+
### Changed
|
|
10
|
+
- The `blockdir-loader.php` generation logic to use static wp_register_* calls like `plain-entrypoints-loader.php`
|
|
11
|
+
- This comes from version `2.87.1`
|
|
12
|
+
|
|
8
13
|
## [3.4.0] - 2026-03-16
|
|
9
14
|
### Added
|
|
10
15
|
- Support for a directory-based `extensions` layout
|
|
@@ -66,6 +71,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
66
71
|
- Legacy PostCSS features that have been integrated into modern CSS
|
|
67
72
|
- `@extends` support
|
|
68
73
|
|
|
74
|
+
## [2.87.1] - 2026-03-17
|
|
75
|
+
### Changed
|
|
76
|
+
- The `blockdir-loader.php` generation logic to use static wp_register_* calls like `plain-entrypoints-loader.php`
|
|
77
|
+
|
|
69
78
|
## [2.87.0] - 2026-03-16
|
|
70
79
|
### Added
|
|
71
80
|
- Support for a directory-based `extensions` layout
|
|
@@ -22,6 +22,7 @@ export declare class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEnt
|
|
|
22
22
|
constructor(config: VerifiedPlauditWordpressWebpackConfig, dest: VerifiedAdvancedOutputConfig, webpackRemoveEmptyScriptsPlugin: WebpackRemoveEmptyScriptsPlugin, context: string, entry: EntryProvider<BlockEntrypointInfo>);
|
|
23
23
|
protected processAssets(compilation: Compilation, parsedAssetJsonProvider: ParsedAssetJsonProvider): Promise<void>;
|
|
24
24
|
private emitBlockLoaderFile;
|
|
25
|
+
private callRegisterFunction;
|
|
25
26
|
private transformBlocks;
|
|
26
27
|
private static extractAssetSource;
|
|
27
28
|
private static convertToScriptHandles;
|
|
@@ -136,15 +136,23 @@ class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.Abst
|
|
|
136
136
|
const finalizedMetadata = Object.fromEntries(Object.entries(metadata)
|
|
137
137
|
.map(([key, value]) => {
|
|
138
138
|
if (key === 'scriptHandles') {
|
|
139
|
-
return [key,
|
|
139
|
+
return [key, []];
|
|
140
140
|
}
|
|
141
141
|
if (key === 'styleHandles') {
|
|
142
|
-
return [key,
|
|
142
|
+
return [key, []];
|
|
143
|
+
}
|
|
144
|
+
if (key === 'scriptModuleHandles') {
|
|
145
|
+
return [key, []];
|
|
143
146
|
}
|
|
144
147
|
return [key, value];
|
|
145
148
|
}));
|
|
146
149
|
const writer = new php_writer_1.PHPWriter()
|
|
147
150
|
.action("init", writer => {
|
|
151
|
+
const baseUriVar = new expressions_1.Var("base_uri");
|
|
152
|
+
writer.call("plaudit_webpack_extensions__resolve_base_uri", [expressions_1.Constants.__DIR__], { assignTo: baseUriVar });
|
|
153
|
+
this.callRegisterFunction('script', writer, baseUriVar, Object.entries(finalizedScriptHandles));
|
|
154
|
+
this.callRegisterFunction('style', writer, baseUriVar, Object.entries(finalizedStyleHandles));
|
|
155
|
+
this.callRegisterFunction('script_module', writer, baseUriVar, Object.entries(metadata.scriptModuleHandles));
|
|
148
156
|
writer.call("\\Plaudit\\Common\\ACF\\BlockManager::autoloadSubfoldersV3", [
|
|
149
157
|
expressions_1.Constants.__DIR__, // string $dir
|
|
150
158
|
new expressions_1.EnclosedLiteral((0, shared_1.makeEmittableConfigPHP)(blockData, false, "\t")), // array $blockdirConfig
|
|
@@ -165,6 +173,11 @@ class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.Abst
|
|
|
165
173
|
compilation.emitAsset(node_path_1.default.join(this.dest.destination, "blockdir.config.php"), new webpack_1.sources.RawSource((0, shared_1.makeEmittableConfigPHP)(blockDirConfig, true)));
|
|
166
174
|
}
|
|
167
175
|
}
|
|
176
|
+
callRegisterFunction(type, writer, baseUriVar, handles) {
|
|
177
|
+
for (const [name, { src, rest }] of handles) {
|
|
178
|
+
writer.call(`wp_register_${type}`, [name, src === false ? false : expressions_1.Op.concat(baseUriVar, src), ...rest]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
168
181
|
transformBlocks(compilation, collatedWorkableBlockInfo, emittingWpmlXml) {
|
|
169
182
|
const handleData = Object.values(collatedWorkableBlockInfo)
|
|
170
183
|
.flatMap(bi => bi.workableBlockEntrypointsInfo)
|