@plaudit/webpack-extensions 2.96.1 → 2.96.3

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
@@ -60,9 +60,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
60
60
  - Legacy PostCSS features that have been integrated into modern CSS
61
61
  - `@extends` support
62
62
 
63
+ ## [2.96.3] - 2026-08-11
64
+ ### Added
65
+ - A few more validation checks
66
+
67
+ ## [2.96.2] - 2026-08-11
68
+ ### Removed
69
+ - `processTranslationConfigs` because it should not be used and didn't actually do anything
70
+
71
+ ### Internals
72
+ - Added more integration tests
73
+
63
74
  ## [2.96.1] - 2026-08-10
64
75
  ### Fixed
65
- - An error in how externalized dependencies were resolved that caused jquery to never be emitted as a depenedency
76
+ - An error in how externalized dependencies were resolved that caused jquery to never be emitted as a dependency
66
77
 
67
78
  ## [2.96.0] - 2026-08-07
68
79
  ### Added
package/dist/shared.d.ts CHANGED
@@ -124,13 +124,13 @@ export type AdvancedOutputConfig = {
124
124
  bundleAnalyzer?: boolean | 'no-auto-open';
125
125
  locations?: UsageLocations | UsageLocations['handle'];
126
126
  lazyLoader?: string;
127
- pathQueryParameters?: PathQueryParameters;
128
127
  enqueuingFlags?: NormalizedEnqueuingControlFlags;
129
128
  };
130
- type OptionalCfgFields = 'directoryLayout' | 'externalize' | 'lazyLoader' | 'pathQueryParameters';
129
+ type OptionalCfgFields = 'directoryLayout' | 'externalize' | 'lazyLoader';
131
130
  export type VerifiedAdvancedOutputConfig = Required<Omit<AdvancedOutputConfig, 'locations' | 'enqueuingFlags' | OptionalCfgFields>> & Pick<AdvancedOutputConfig, OptionalCfgFields> & {
132
131
  enqueuingFlags: NormalizedEnqueuingControlFlags | undefined;
133
132
  locations: NormalizedUsageLocations;
133
+ pathQueryParameters?: PathQueryParameters;
134
134
  };
135
135
  export type SourcesObject = Record<string, string | AdvancedOutputConfig | boolean>;
136
136
  export type PlauditWordpressWebpackConfig = {
@@ -145,7 +145,6 @@ export type PlauditWordpressWebpackConfig = {
145
145
  };
146
146
  externals?: Externals;
147
147
  assumeGlobalizedPlauditLibraries?: boolean;
148
- processTranslationConfigs?: boolean;
149
148
  useWebpackResourceFiltering?: boolean;
150
149
  outputDir?: string;
151
150
  extensionsVersion?: 1 | 2 | 3;
@@ -171,7 +170,6 @@ export declare function applyStandards(config: PlauditWordpressWebpackConfig): {
171
170
  };
172
171
  readonly externals?: Externals;
173
172
  readonly assumeGlobalizedPlauditLibraries?: boolean;
174
- readonly processTranslationConfigs?: boolean;
175
173
  useWebpackResourceFiltering?: boolean;
176
174
  outputDir?: string;
177
175
  extensionsVersion?: 1 | 2 | 3;
@@ -1,10 +1,13 @@
1
- import { type AdvancedOutputConfig, type PlauditWordpressWebpackConfig } from "../shared";
1
+ import { type AdvancedOutputConfig, type PathQueryParameters, type PlauditWordpressWebpackConfig } from "../shared";
2
2
  export declare const enum SourceType {
3
3
  blocks = "blocks",
4
4
  extensions = "extensions",
5
5
  plain = "plain"
6
6
  }
7
7
  export declare function isSourceType(str: string): str is SourceType;
8
- type Entrypoints = [string, AdvancedOutputConfig][];
8
+ type ResolvedSourceConfig = AdvancedOutputConfig & {
9
+ pathQueryParameters?: PathQueryParameters;
10
+ };
11
+ type Entrypoints = [string, ResolvedSourceConfig][];
9
12
  export declare function resolveAllConfigLevelEntrypoints(config: PlauditWordpressWebpackConfig, projectRoot?: string): Record<'staticEntrypoints' | 'dynamicEntrypoints', Entrypoints>;
10
13
  export {};
@@ -147,7 +147,7 @@ function injectSupportForInliningSVGsAsStrings(rules) {
147
147
  }
148
148
  function buildVerifiedConfig(config) {
149
149
  config = (0, shared_1.applyStandards)(config);
150
- const { standaloneBlocks = false, stats = 'errors-warnings', variables: rawVariables, verbose = process.argv.includes('--verbose') || process.env['VERBOSE'] === 'true', postcss = {}, externals, assumeGlobalizedPlauditLibraries = true, processTranslationConfigs = true, useWebpackResourceFiltering = true, plainEntrypointsVersion = 1, srcDir = "", useUnifiedLoader = false, includePostInitFallback = false, omitDistDev = false, onlyRunPostCSSOnPCSS = false, useBlockSupportsAsThemeJsonDefaults = true, } = config;
150
+ const { standaloneBlocks = false, stats = 'errors-warnings', variables: rawVariables, verbose = process.argv.includes('--verbose') || process.env['VERBOSE'] === 'true', postcss = {}, externals, assumeGlobalizedPlauditLibraries = true, useWebpackResourceFiltering = true, plainEntrypointsVersion = 1, srcDir = "", useUnifiedLoader = false, includePostInitFallback = false, omitDistDev = false, onlyRunPostCSSOnPCSS = false, useBlockSupportsAsThemeJsonDefaults = true, } = config;
151
151
  let outputDir = config.outputDir ?? "";
152
152
  if (outputDir && useUnifiedLoader && !omitDistDev && (process.env['SERVER_MODE'] ?? 'development') === 'development') {
153
153
  outputDir += "-dev";
@@ -184,14 +184,18 @@ function buildVerifiedConfig(config) {
184
184
  extensionsVersion = 3; // Version 3 is a backwards-compatible upgrade of version 2, so we can automatically upgrade everything
185
185
  }
186
186
  const cfg = {
187
- currentVariables, postcss, standaloneBlocks, stats, variablesFilePath, verbose, externals, assumeGlobalizedPlauditLibraries, processTranslationConfigs,
188
- useWebpackResourceFiltering, outputDir, extensionsVersion, plainEntrypointsVersion, srcDir, srcPrefixes, targetHandlePrefix, useUnifiedLoader, includePostInitFallback, omitDistDev,
189
- onlyRunPostCSSOnPCSS, useBlockSupportsAsThemeJsonDefaults
187
+ currentVariables, postcss, standaloneBlocks, stats, variablesFilePath, verbose, externals, assumeGlobalizedPlauditLibraries,
188
+ useWebpackResourceFiltering, outputDir, extensionsVersion, plainEntrypointsVersion, srcDir, srcPrefixes, targetHandlePrefix,
189
+ useUnifiedLoader, includePostInitFallback, omitDistDev, onlyRunPostCSSOnPCSS, useBlockSupportsAsThemeJsonDefaults
190
190
  };
191
191
  // Destination -> source map
192
192
  const allocatedDestinations = {};
193
193
  const partiallyVerifiedSources = rawSources.map(([src, config]) => {
194
194
  const { destination, additionalDependencies = [], assumeGlobalizedPlauditLibraries = cfg.assumeGlobalizedPlauditLibraries, bundleAnalyzer = false, directoryLayout, externalize, withLegacyBlocksIn = false, lazyLoader, pathQueryParameters: rawPathQueryParameters, enqueuingFlags: rawEnqueuingFlags, locations: rawSourceLocations, } = config;
195
+ // This guards against a crash later on down the line due to trying to run a spread on a boolean
196
+ if (externalize && typeof externalize !== 'string' && typeof externalize !== 'object') {
197
+ throw new TypeError(`externalize must be a string, an array or an object, but "${src}" set externalize to a ${typeof externalize}`);
198
+ }
195
199
  const { flags: queryEnqueuingFlags, remainder: pathQueryParameters, handle: pathQueryHandle } = (0, path_query_and_related_helpers_1.unpackEnqueuingControlFlagsFromPathQueryParameters)(rawPathQueryParameters, src, 'path query parameters');
196
200
  const enqueuingFlags = (0, path_query_and_related_helpers_1.mergeTwoEnqueuingControlFlagSets)(src, rawEnqueuingFlags, queryEnqueuingFlags);
197
201
  const normalizedParts = { additionalDependencies, assumeGlobalizedPlauditLibraries, bundleAnalyzer, directoryLayout, externalize, withLegacyBlocksIn, lazyLoader };
@@ -433,16 +437,14 @@ function commonConfigProcessingPrep(config, webpackConfig) {
433
437
  },
434
438
  injectSupportForInliningSVGsAsStrings
435
439
  ].reduce((r, a) => a(r), webpackConfig.module?.rules ?? []);
436
- if (config.processTranslationConfigs) {
437
- fixedRules.push({
438
- test: /wpml-config\.xml$/i,
439
- type: 'asset/resource',
440
- generator: {
441
- filename: '[name][ext]',
442
- emit: false
443
- }
444
- });
445
- }
440
+ fixedRules.push({
441
+ test: /wpml-config\.xml$/i,
442
+ type: 'asset/resource',
443
+ generator: {
444
+ filename: '[name][ext]',
445
+ emit: false
446
+ }
447
+ });
446
448
  return {
447
449
  entrypointFields, fixedRules, processingModules, scriptExtension,
448
450
  updateCurrentVariables: (value) => currentVariables = value
@@ -502,7 +504,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
502
504
  }
503
505
  plugin = new EnhancedBlockJSONPlugin_1.EnhancedBlockJSONPlugin(config, dest, removeEmptyScriptsPlugin, contextPath, (0, common_config_helpers_1.resolveEntryFromDirectory)(commonConfig, srcRoot, dest));
504
506
  plugins.push(plugin);
505
- if (config.processTranslationConfigs && !processingModules) {
507
+ if (!processingModules) {
506
508
  plugins.push(new WPMLConfigBuilder_1.WPMLConfigBuilderPlugin(dest.destination, plugin));
507
509
  }
508
510
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.96.1",
3
+ "version": "2.96.3",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "repository": {
6
6
  "type": "git",
@@ -96,7 +96,8 @@
96
96
  "watch": "tsc -w",
97
97
  "test": "pnpm run build && pnpm run test:no-build",
98
98
  "test:no-build": "rm -rf tests/.tmp/coverage/jest && NODE_V8_COVERAGE=tests/.tmp/coverage/jest jest",
99
- "test:paths": "pnpm run build && jest tests/integration-2x/paths",
99
+ "test:update": "pnpm run build && rm -rf tests/.tmp/coverage/jest && NODE_V8_COVERAGE=tests/.tmp/coverage/jest jest -u",
100
+ "test:paths": "pnpm run build && jest \"tests/integration-[0-9]+x/paths\"",
100
101
  "test:gaps": "node tests/tools/coverage-gaps.js",
101
102
  "update": "pnpm add --config '@plaudit/pnpm-plugin-plaudit-config@*' && pnpm up"
102
103
  }