@plaudit/webpack-extensions 3.9.0 → 3.9.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,13 @@ 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.9.1] - 2026-05-21
9
+ ### Fixed
10
+ - Compatibility issues with module-mode building
11
+ - This comes from version `2.92.1`
12
+ - `module_dependencies` being set to `null` instead of being omitted
13
+ - This comes from version `2.92.1`
14
+
8
15
  ## [3.9.0] - 2026-05-20
9
16
  ### Added
10
17
  - Support for marking `block.json` attributes with `"supports-bindings": true` to enable block binding support in the editor
@@ -127,6 +134,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
127
134
  - Legacy PostCSS features that have been integrated into modern CSS
128
135
  - `@extends` support
129
136
 
137
+ ## [2.92.1] - 2026-05-21
138
+ ### Fixed
139
+ - Compatibility issues with module-mode building
140
+ - `module_dependencies` being set to `null` instead of being omitted
141
+
130
142
  ## [2.92.0] - 2026-05-20
131
143
  ### Added
132
144
  - Support for marking `block.json` attributes with `"supports-bindings": true` to enable block binding support in the editor
@@ -283,7 +283,8 @@ class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.Abst
283
283
  const { dependencies = [], module_dependencies = undefined } = originalValue !== undefined ? assetData : {};
284
284
  let scriptArgsObject;
285
285
  if (rawScriptArgsObject !== undefined) {
286
- scriptArgsObject = { ...rawScriptArgsObject, module_dependencies: (0, shared_1.mergeModuleDependencyArrays)(rawScriptArgsObject.module_dependencies, module_dependencies) };
286
+ const merged_module_dependencies = (0, shared_1.mergeModuleDependencyArrays)(rawScriptArgsObject.module_dependencies, module_dependencies);
287
+ scriptArgsObject = merged_module_dependencies?.length ? { ...rawScriptArgsObject, module_dependencies: merged_module_dependencies } : { ...rawScriptArgsObject };
287
288
  }
288
289
  else {
289
290
  if (inlinedAsset !== undefined) {
@@ -101,7 +101,7 @@ class ExtensionsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAndEntryP
101
101
  src: isCss ? assetPath.replace(/\.js$/, ".css") : assetPath,
102
102
  rest: isCss || key.startsWith("editor")
103
103
  ? (module_dependencies?.length ? [dependencies, assetData.version, { in_footer: true, module_dependencies }] : [dependencies, assetData.version])
104
- : [dependencies, assetData.version, { strategy: 'defer', module_dependencies: module_dependencies?.length ? module_dependencies : undefined }]
104
+ : [dependencies, assetData.version, module_dependencies?.length ? { strategy: 'defer', module_dependencies } : { strategy: 'defer' }]
105
105
  };
106
106
  (blockExtensionsConfig.blocks[blockSlug] ?? (blockExtensionsConfig.blocks[blockSlug] = {}))[key] = handle;
107
107
  }
@@ -139,7 +139,7 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
139
139
  const blockJsonChunkName = (0, node_path_1.join)(dest.destination, (0, node_path_1.relative)(srcRoot, dir), "block");
140
140
  const filesRegisteredByJson = [];
141
141
  const presentEntrypoints = (await Promise.all(entrypointFields
142
- .filter(entrypointField => entrypointField in blockJson)
142
+ .filter(entrypointField => (0, shared_1.isScriptModuleField)(entrypointField) === processingModules && entrypointField in blockJson)
143
143
  .flatMap(entrypointField => {
144
144
  return (Array.isArray(blockJson[entrypointField]) ? blockJson[entrypointField] : [blockJson[entrypointField]])
145
145
  .filter(originalValue => typeof originalValue === 'string')
@@ -181,6 +181,9 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
181
181
  continue;
182
182
  }
183
183
  const { type, locations, flags } = parsedFilename;
184
+ if (((type === 'script-module') !== processingModules)) {
185
+ continue;
186
+ }
184
187
  let entrypointField;
185
188
  if (Object.keys(locations).length === 2) {
186
189
  if (type === 'script-module') {
@@ -486,6 +486,9 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
486
486
  const { bundleAnalyzer, assumeGlobalizedPlauditLibraries, externalize } = currentBatch[0].dest;
487
487
  const { plugins, removeEmptyScriptsPlugin, makeAdditionalDependencyInjectorPlugin } = buildCommonPluginConfig(webpackConfig, config, bundleAnalyzer, assumeGlobalizedPlauditLibraries, externalize);
488
488
  handleDisablingTSCheckerIfNecessary(currentBatch.flatMap(a => a.srcRoots), scriptExtension, plugins);
489
+ const applicableExtensionTest = (name) => {
490
+ return commonConfig.scriptExtension.test(name) || (!processingModules && shared_1.styleExtension.test(name));
491
+ };
489
492
  const contextPath = webpackConfig.context ?? process.cwd();
490
493
  for (const { dest, src, srcIsDirectory, srcRoot } of currentBatch) {
491
494
  let plugin;
@@ -511,7 +514,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
511
514
  continue;
512
515
  }
513
516
  if (dirent.isFile()) {
514
- if ((commonConfig.scriptExtension.test(dirent.name) || shared_1.styleExtension.test(dirent.name))) {
517
+ if (applicableExtensionTest(dirent.name)) {
515
518
  const absoluteSrc = (0, common_config_helpers_1.joinPossiblyAbsolutePaths)(srcRoot, dirent.name);
516
519
  const extensionId = (0, node_path_1.parse)(dirent.name).name;
517
520
  rawEntrypoints.push([(0, node_path_1.join)(dest.destination, (0, node_path_1.basename)(absoluteSrc, (0, node_path_1.extname)(absoluteSrc))), {
@@ -521,7 +524,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
521
524
  }
522
525
  }
523
526
  else if (dirent.isDirectory()) {
524
- rawEntrypoints.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, [dirent.name]));
527
+ rawEntrypoints.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, applicableExtensionTest, [dirent.name]));
525
528
  }
526
529
  }
527
530
  return Object.fromEntries(rawEntrypoints);
@@ -533,10 +536,8 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
533
536
  }
534
537
  else if (sourceType === "plain" /* SourceType.plain */) {
535
538
  const absoluteSrc = typeof srcRoot === 'string' ? srcRoot : srcRoot[0];
536
- if (!srcIsDirectory) {
537
- if (!scriptExtension.test(absoluteSrc) && !shared_1.styleExtension.test(absoluteSrc)) {
538
- continue;
539
- }
539
+ if (!srcIsDirectory && !applicableExtensionTest(absoluteSrc)) {
540
+ continue;
540
541
  }
541
542
  const baseDest = stripExtension(dest.destination);
542
543
  if (config.plainEntrypointsVersion > 1) {
@@ -574,13 +575,16 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
574
575
  return (0, common_config_helpers_1.commonMakeWebpackConfig)(config, commonConfig, webpackConfig, externalize, plugins, canClean && batches.length < 2);
575
576
  }).filter(cfg => cfg !== undefined);
576
577
  }
577
- async function walkExtensionsTree(srcRoot, dest, parents) {
578
+ async function walkExtensionsTree(srcRoot, dest, applicableExtensionTest, parents) {
578
579
  const res = [];
579
580
  for await (const dirent of await (0, promises_1.opendir)(srcRoot)) {
580
581
  if (dirent.name.startsWith("~")) {
581
582
  continue;
582
583
  }
583
584
  if (dirent.isFile()) {
585
+ if (!applicableExtensionTest(dirent.name)) {
586
+ continue;
587
+ }
584
588
  const parsedFilename = (0, location_encoding_filename_parser_1.parseLocationEncodingFilename)(dirent.name);
585
589
  if (parsedFilename === undefined) {
586
590
  continue;
@@ -608,7 +612,7 @@ async function walkExtensionsTree(srcRoot, dest, parents) {
608
612
  }]);
609
613
  }
610
614
  else if (dirent.isDirectory()) {
611
- res.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, [...parents, dirent.name]));
615
+ res.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, applicableExtensionTest, [...parents, dirent.name]));
612
616
  }
613
617
  }
614
618
  return res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/dist",
@@ -62,8 +62,8 @@
62
62
  "postcss-nested": "^7.0.2",
63
63
  "postcss-property-lookup": "^3.0.0",
64
64
  "postcss-reporter": "^7.1.0",
65
- "postcss-url": "^10.1.3",
66
- "webpack": "^5.107.0",
65
+ "postcss-url": "^10.1.4",
66
+ "webpack": "^5.107.1",
67
67
  "webpack-remove-empty-scripts": "^1.1.1",
68
68
  "xml-formatter": "^3.7.0"
69
69
  },