@plaudit/webpack-extensions 3.19.0 → 3.20.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 +31 -0
- package/dist/plugins/AbstractBiPhasicGroupAndEntryPlugin.d.ts +3 -3
- package/dist/plugins/AbstractBiPhasicGroupAndEntryPlugin.js +2 -2
- package/dist/plugins/AbstractBiPhasicGroupPlugin.d.ts +2 -4
- package/dist/plugins/AbstractBiPhasicGroupPlugin.js +1 -3
- package/dist/plugins/AdditionalDependencyInjectorPlugin.d.ts +1 -2
- package/dist/plugins/AdditionalDependencyInjectorPlugin.js +2 -2
- package/dist/plugins/EnhancedBlockJSONPlugin.d.ts +2 -2
- package/dist/plugins/EnhancedBlockJSONPlugin.js +5 -3
- package/dist/plugins/EnhancedDynamicEntryPlugin.d.ts +2 -3
- package/dist/plugins/EnhancedDynamicEntryPlugin.js +2 -2
- package/dist/plugins/ExtensionsConfigFileGeneratorPlugin.d.ts +2 -2
- package/dist/plugins/ExtensionsConfigFileGeneratorPlugin.js +5 -3
- package/dist/plugins/ExtensionsConfigFileGeneratorPluginV1.d.ts +1 -2
- package/dist/plugins/ExtensionsConfigFileGeneratorPluginV1.js +2 -2
- package/dist/plugins/MixableBiPhasicGroupAndEntryPlugin.d.ts +6 -0
- package/dist/plugins/MixableBiPhasicGroupAndEntryPlugin.js +13 -0
- package/dist/plugins/MixableBiPhasicGroupPlugin.d.ts +6 -0
- package/dist/plugins/MixableBiPhasicGroupPlugin.js +13 -0
- package/dist/plugins/PlainEntrypointsConfigFileGeneratorPlugin.d.ts +2 -2
- package/dist/plugins/PlainEntrypointsConfigFileGeneratorPlugin.js +5 -3
- package/dist/plugins/SpecialAssetHandlingPlugin.d.ts +2 -1
- package/dist/plugins/SpecialAssetHandlingPlugin.js +5 -3
- package/dist/plugins/UnifiedLoaderGenerator.d.ts +3 -2
- package/dist/plugins/UnifiedLoaderGenerator.js +5 -3
- package/dist/plugins/VariablesJSMonitorPlugin.d.ts +1 -1
- package/dist/plugins/index.d.ts +8 -0
- package/dist/plugins/index.js +24 -0
- package/dist/shared.d.ts +4 -0
- package/dist/utils/common-config-helpers.d.ts +1 -5
- package/dist/wordpress-scripts-wrapper.js +4 -4
- package/package.json +9 -7
- /package/dist/utils/{pseduo-semaphore.d.ts → pseudo-semaphore.d.ts} +0 -0
- /package/dist/utils/{pseduo-semaphore.js → pseudo-semaphore.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ 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.20.1] - 2026-08-26
|
|
9
|
+
### Internals
|
|
10
|
+
- Updated to the 34.x line of `@wordpress/scripts`
|
|
11
|
+
- This comes from version `2.99.1`
|
|
12
|
+
- Removed the `@types/wordpress` override
|
|
13
|
+
- This comes from version `2.99.1`
|
|
14
|
+
|
|
15
|
+
## [3.20.0] - 2026-08-24
|
|
16
|
+
### Added
|
|
17
|
+
- Mixable versions of the `BiPhasicGroup...` plugins
|
|
18
|
+
- This comes from version `2.99.0`
|
|
19
|
+
- Entrypoints to allow other code to reference some of the plugins and utilities
|
|
20
|
+
- This comes from version `2.99.0`
|
|
21
|
+
|
|
22
|
+
### Internals
|
|
23
|
+
- Dropped unnecessary constructor parameters to make re-using the more general components easier
|
|
24
|
+
- This comes from version `2.99.0`
|
|
25
|
+
|
|
8
26
|
## [3.19.0] - 2026-08-18
|
|
9
27
|
### Added
|
|
10
28
|
- Automatic sync of WordPress's bundled packages list
|
|
@@ -280,6 +298,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
280
298
|
- Legacy PostCSS features that have been integrated into modern CSS
|
|
281
299
|
- `@extends` support
|
|
282
300
|
|
|
301
|
+
## [2.99.1] - 2026-08-26
|
|
302
|
+
### Internals
|
|
303
|
+
- Updated to the 34.x line of `@wordpress/scripts`
|
|
304
|
+
- Removed the `@types/wordpress` override
|
|
305
|
+
|
|
306
|
+
## [2.99.0] - 2026-08-24
|
|
307
|
+
### Added
|
|
308
|
+
- Mixable versions of the `BiPhasicGroup...` plugins
|
|
309
|
+
- Entrypoints to allow other code to reference some of the plugins and utilities
|
|
310
|
+
|
|
311
|
+
### Internals
|
|
312
|
+
- Dropped unnecessary constructor parameters to make re-using the more general components easier
|
|
313
|
+
|
|
283
314
|
## [2.98.0] - 2026-08-18
|
|
284
315
|
### Added
|
|
285
316
|
- Automatic sync of WordPress's bundled packages list
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MinimumViableMetadata, ParsedAssetJsonProvider, ParsedAssetsJson } from "../shared";
|
|
2
|
-
import type { ExtensibleEntryObject
|
|
3
|
-
import { PseudoSemaphore } from "../utils/
|
|
2
|
+
import type { ExtensibleEntryObject } from "../utils/common-config-helpers";
|
|
3
|
+
import { PseudoSemaphore } from "../utils/pseudo-semaphore";
|
|
4
4
|
import { AbstractBiPhasicGroupPlugin } from "./AbstractBiPhasicGroupPlugin";
|
|
5
5
|
import { type Compilation, type Compiler, type Entrypoint } from "webpack";
|
|
6
6
|
export type EntryProvider<M extends MinimumViableMetadata = MinimumViableMetadata> = () => ExtensibleEntryObject<M> | Promise<ExtensibleEntryObject<M>>;
|
|
@@ -9,7 +9,7 @@ export declare abstract class AbstractBiPhasicGroupAndEntryPlugin<M extends Mini
|
|
|
9
9
|
private readonly entry;
|
|
10
10
|
private static readonly configuredCompilations;
|
|
11
11
|
private readonly entryMetadataRecord;
|
|
12
|
-
|
|
12
|
+
constructor(group: string, semaphores: PseudoSemaphore<any>[], context: string, entry: EntryProvider<M>);
|
|
13
13
|
apply(compiler: Compiler): void;
|
|
14
14
|
protected attachStandardPhase(compilation: Compilation): void;
|
|
15
15
|
/**
|
|
@@ -9,8 +9,8 @@ class AbstractBiPhasicGroupAndEntryPlugin extends AbstractBiPhasicGroupPlugin_1.
|
|
|
9
9
|
entry;
|
|
10
10
|
static configuredCompilations = new WeakSet();
|
|
11
11
|
entryMetadataRecord = {};
|
|
12
|
-
constructor(
|
|
13
|
-
super(
|
|
12
|
+
constructor(group, semaphores, context, entry) {
|
|
13
|
+
super(group, semaphores);
|
|
14
14
|
this.context = context;
|
|
15
15
|
this.entry = entry;
|
|
16
16
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Compilation, Compiler, type WebpackPluginInstance } from "webpack";
|
|
2
|
-
import { PseudoSemaphore } from "../utils/
|
|
3
|
-
import type { VerifiedPlauditWordpressWebpackConfig } from "../utils/common-config-helpers";
|
|
2
|
+
import { PseudoSemaphore } from "../utils/pseudo-semaphore";
|
|
4
3
|
import { type ParsedAssetJsonProvider } from "../shared";
|
|
5
4
|
type TapWithAssetsJsonOptions = {
|
|
6
5
|
name?: string;
|
|
@@ -10,14 +9,13 @@ type TapWithAssetsJsonOptions = {
|
|
|
10
9
|
type TapWithAssetsJsonFn = Parameters<Compilation['hooks']['processAssets']['tapPromise']>[1];
|
|
11
10
|
type TapWithParsedAssetsJsonFn = (parsedAssetJsonProvider: ParsedAssetJsonProvider, assets: Parameters<TapWithAssetsJsonFn>[0]) => Promise<void> | void;
|
|
12
11
|
export declare abstract class AbstractBiPhasicGroupPlugin implements WebpackPluginInstance {
|
|
13
|
-
protected readonly config: VerifiedPlauditWordpressWebpackConfig;
|
|
14
12
|
readonly group: string;
|
|
15
13
|
private readonly semaphores;
|
|
16
14
|
protected static readonly uniquePhaseAttached: {
|
|
17
15
|
[key in string]: any;
|
|
18
16
|
};
|
|
19
17
|
protected readonly id: string;
|
|
20
|
-
|
|
18
|
+
constructor(group: string, semaphores: PseudoSemaphore<any>[]);
|
|
21
19
|
apply(compiler: Compiler): void;
|
|
22
20
|
protected resetSemaphores(): void;
|
|
23
21
|
protected rejectSemaphores(): void;
|
|
@@ -4,13 +4,11 @@ exports.AbstractBiPhasicGroupPlugin = void 0;
|
|
|
4
4
|
const webpack_1 = require("webpack");
|
|
5
5
|
const shared_1 = require("../shared");
|
|
6
6
|
class AbstractBiPhasicGroupPlugin {
|
|
7
|
-
config;
|
|
8
7
|
group;
|
|
9
8
|
semaphores;
|
|
10
9
|
static uniquePhaseAttached = {};
|
|
11
10
|
id;
|
|
12
|
-
constructor(
|
|
13
|
-
this.config = config;
|
|
11
|
+
constructor(group, semaphores) {
|
|
14
12
|
this.group = group;
|
|
15
13
|
this.semaphores = semaphores;
|
|
16
14
|
this.id = Math.random().toString();
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { AbstractBiPhasicGroupPlugin } from "./AbstractBiPhasicGroupPlugin";
|
|
2
2
|
import type { AbstractBiPhasicGroupAndEntryPlugin } from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
3
|
-
import { VerifiedPlauditWordpressWebpackConfig } from "../utils/common-config-helpers";
|
|
4
3
|
import { Compilation } from "webpack";
|
|
5
4
|
export declare class AdditionalDependencyInjectorPlugin extends AbstractBiPhasicGroupPlugin {
|
|
6
5
|
private readonly processingModules;
|
|
7
6
|
private readonly addExternalizedDep;
|
|
8
7
|
private readonly referencePlugin;
|
|
9
|
-
constructor(
|
|
8
|
+
constructor(processingModules: boolean | undefined, addExternalizedDep: (dep: string) => void, referencePlugin: AbstractBiPhasicGroupAndEntryPlugin<any>);
|
|
10
9
|
protected attachStandardPhase(compilation: Compilation): void;
|
|
11
10
|
protected attachUniquePhase(): void;
|
|
12
11
|
}
|
|
@@ -12,8 +12,8 @@ class AdditionalDependencyInjectorPlugin extends AbstractBiPhasicGroupPlugin_1.A
|
|
|
12
12
|
processingModules;
|
|
13
13
|
addExternalizedDep;
|
|
14
14
|
referencePlugin;
|
|
15
|
-
constructor(
|
|
16
|
-
super(
|
|
15
|
+
constructor(processingModules, addExternalizedDep, referencePlugin) {
|
|
16
|
+
super("additional-dependency-injector-plugin", []);
|
|
17
17
|
this.processingModules = processingModules;
|
|
18
18
|
this.addExternalizedDep = addExternalizedDep;
|
|
19
19
|
this.referencePlugin = referencePlugin;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Compilation } from "webpack";
|
|
2
2
|
import type WebpackRemoveEmptyScriptsPlugin from "webpack-remove-empty-scripts";
|
|
3
3
|
import { AbstractBiPhasicGroupAndEntryPlugin, EntryProvider } from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
4
|
-
import { AssetMetaSegment, BlockEntrypointInfo, FileSegmentBlockEntrypointInfo, ParsedAssetJsonProvider, ParsedAssetsJson, ScriptArgsObject, VerifiedAdvancedOutputConfig } from "../shared";
|
|
5
|
-
import type { VerifiedPlauditWordpressWebpackConfig } from "../utils/common-config-helpers";
|
|
4
|
+
import { AssetMetaSegment, BlockEntrypointInfo, FileSegmentBlockEntrypointInfo, ParsedAssetJsonProvider, ParsedAssetsJson, ScriptArgsObject, VerifiedAdvancedOutputConfig, VerifiedPlauditWordpressWebpackConfig } from "../shared";
|
|
6
5
|
type WorkableBlockEntrypointInfo = Omit<FileSegmentBlockEntrypointInfo, 'originalValue' | 'pathQueryParameters'> & Partial<Pick<FileSegmentBlockEntrypointInfo, 'originalValue'>> & {
|
|
7
6
|
outputPath: string;
|
|
8
7
|
assetData: ParsedAssetsJson[string];
|
|
@@ -18,6 +17,7 @@ type CollatedWorkableBlockInfo = Record<string, {
|
|
|
18
17
|
blockJsonText?: string;
|
|
19
18
|
}>;
|
|
20
19
|
export declare class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin<BlockEntrypointInfo> {
|
|
20
|
+
private readonly config;
|
|
21
21
|
private readonly dest;
|
|
22
22
|
private readonly webpackRemoveEmptyScriptsPlugin;
|
|
23
23
|
private static readonly semaphore;
|
|
@@ -12,13 +12,15 @@ const AbstractBiPhasicGroupAndEntryPlugin_1 = require("./AbstractBiPhasicGroupAn
|
|
|
12
12
|
const UnifiedLoaderGenerator_1 = require("./UnifiedLoaderGenerator");
|
|
13
13
|
const shared_1 = require("../shared");
|
|
14
14
|
const path_query_and_related_helpers_1 = require("../utils/path-query-and-related-helpers");
|
|
15
|
-
const
|
|
15
|
+
const pseudo_semaphore_1 = require("../utils/pseudo-semaphore");
|
|
16
16
|
class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.AbstractBiPhasicGroupAndEntryPlugin {
|
|
17
|
+
config;
|
|
17
18
|
dest;
|
|
18
19
|
webpackRemoveEmptyScriptsPlugin;
|
|
19
|
-
static semaphore = new
|
|
20
|
+
static semaphore = new pseudo_semaphore_1.PseudoSemaphore("Block JSON v3");
|
|
20
21
|
constructor(config, dest, webpackRemoveEmptyScriptsPlugin, context, entry) {
|
|
21
|
-
super(
|
|
22
|
+
super(`block-json-${dest.destination}`, [EnhancedBlockJSONPlugin.semaphore, UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore], context, entry);
|
|
23
|
+
this.config = config;
|
|
22
24
|
this.dest = dest;
|
|
23
25
|
this.webpackRemoveEmptyScriptsPlugin = webpackRemoveEmptyScriptsPlugin;
|
|
24
26
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Compilation } from "webpack";
|
|
2
2
|
import { AbstractBiPhasicGroupAndEntryPlugin, EntryProvider } from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
3
|
-
import type {
|
|
4
|
-
import { ParsedAssetJsonProvider } from "../shared";
|
|
3
|
+
import type { ParsedAssetJsonProvider } from "../shared";
|
|
5
4
|
export declare class EnhancedDynamicEntryPlugin extends AbstractBiPhasicGroupAndEntryPlugin {
|
|
6
|
-
constructor(
|
|
5
|
+
constructor(context: string, entry: EntryProvider);
|
|
7
6
|
protected attachUniquePhase(): void;
|
|
8
7
|
protected processAssets(compilation: Compilation, parsedAssetJsonProvider: ParsedAssetJsonProvider): void;
|
|
9
8
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EnhancedDynamicEntryPlugin = void 0;
|
|
4
4
|
const AbstractBiPhasicGroupAndEntryPlugin_1 = require("./AbstractBiPhasicGroupAndEntryPlugin");
|
|
5
5
|
class EnhancedDynamicEntryPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.AbstractBiPhasicGroupAndEntryPlugin {
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
6
|
+
constructor(context, entry) {
|
|
7
|
+
super(`enhanced-dynamic-entries`, [], context, entry);
|
|
8
8
|
}
|
|
9
9
|
attachUniquePhase() { }
|
|
10
10
|
processAssets(compilation, parsedAssetJsonProvider) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AbstractBiPhasicGroupAndEntryPlugin, EntryProvider } from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
2
|
-
import { MinimumViableMetadata, ParsedAssetJsonProvider, VerifiedAdvancedOutputConfig } from "../shared";
|
|
3
|
-
import type { VerifiedPlauditWordpressWebpackConfig } from "../utils/common-config-helpers";
|
|
2
|
+
import { MinimumViableMetadata, ParsedAssetJsonProvider, VerifiedAdvancedOutputConfig, VerifiedPlauditWordpressWebpackConfig } from "../shared";
|
|
4
3
|
import { Compilation, type Compiler } from "webpack";
|
|
5
4
|
export type ExtensionConfigFileGeneratorMetadata = MinimumViableMetadata & {
|
|
6
5
|
extensionId: string;
|
|
7
6
|
};
|
|
8
7
|
export declare class ExtensionsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAndEntryPlugin<ExtensionConfigFileGeneratorMetadata> {
|
|
8
|
+
private readonly config;
|
|
9
9
|
private readonly extensionsSrcPath;
|
|
10
10
|
private readonly dest;
|
|
11
11
|
private static readonly semaphore;
|
|
@@ -8,15 +8,17 @@ const expressions_1 = require("@plaudit/php-writer/expressions");
|
|
|
8
8
|
const AbstractBiPhasicGroupAndEntryPlugin_1 = require("./AbstractBiPhasicGroupAndEntryPlugin");
|
|
9
9
|
const UnifiedLoaderGenerator_1 = require("./UnifiedLoaderGenerator");
|
|
10
10
|
const shared_1 = require("../shared");
|
|
11
|
-
const
|
|
11
|
+
const pseudo_semaphore_1 = require("../utils/pseudo-semaphore");
|
|
12
12
|
const webpack_1 = require("webpack");
|
|
13
13
|
class ExtensionsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.AbstractBiPhasicGroupAndEntryPlugin {
|
|
14
|
+
config;
|
|
14
15
|
extensionsSrcPath;
|
|
15
16
|
dest;
|
|
16
|
-
static semaphore = new
|
|
17
|
+
static semaphore = new pseudo_semaphore_1.PseudoSemaphore("Extensions");
|
|
17
18
|
setupFiles = [];
|
|
18
19
|
constructor(config, extensionsSrcPath, dest, context, entry) {
|
|
19
|
-
super(
|
|
20
|
+
super(`extensions-v2-${dest.destination}`, [ExtensionsConfigFileGeneratorPlugin.semaphore, UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore], context, entry);
|
|
21
|
+
this.config = config;
|
|
20
22
|
this.extensionsSrcPath = extensionsSrcPath;
|
|
21
23
|
this.dest = dest;
|
|
22
24
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AbstractBiPhasicGroupAndEntryPlugin, EntryProvider } from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
2
2
|
import type { ParsedAssetJsonProvider } from "../shared";
|
|
3
|
-
import type { VerifiedPlauditWordpressWebpackConfig } from "../utils/common-config-helpers";
|
|
4
3
|
import { Compilation } from "webpack";
|
|
5
4
|
export declare class ExtensionsConfigFileGeneratorPluginV1 extends AbstractBiPhasicGroupAndEntryPlugin {
|
|
6
5
|
private readonly extensionsDest;
|
|
7
|
-
constructor(
|
|
6
|
+
constructor(extensionsDest: string, context: string, entry: EntryProvider);
|
|
8
7
|
protected attachUniquePhase(): void;
|
|
9
8
|
protected processAssets(compilation: Compilation, parsedAssetJsonProvider: ParsedAssetJsonProvider): void;
|
|
10
9
|
}
|
|
@@ -12,8 +12,8 @@ const UnifiedLoaderGenerator_1 = require("./UnifiedLoaderGenerator");
|
|
|
12
12
|
const webpack_1 = require("webpack");
|
|
13
13
|
class ExtensionsConfigFileGeneratorPluginV1 extends AbstractBiPhasicGroupAndEntryPlugin_1.AbstractBiPhasicGroupAndEntryPlugin {
|
|
14
14
|
extensionsDest;
|
|
15
|
-
constructor(
|
|
16
|
-
super(
|
|
15
|
+
constructor(extensionsDest, context, entry) {
|
|
16
|
+
super(`extensions-v1-${extensionsDest}`, [UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore], context, entry);
|
|
17
17
|
this.extensionsDest = extensionsDest;
|
|
18
18
|
}
|
|
19
19
|
attachUniquePhase() { }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractBiPhasicGroupPlugin } from "./AbstractBiPhasicGroupPlugin";
|
|
2
|
+
import { Compilation } from "webpack";
|
|
3
|
+
export declare class MixableBiPhasicGroupAndEntryPlugin extends AbstractBiPhasicGroupPlugin {
|
|
4
|
+
protected attachStandardPhase(compilation: Compilation): void;
|
|
5
|
+
protected attachUniquePhase(compilation: Compilation): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MixableBiPhasicGroupAndEntryPlugin = void 0;
|
|
4
|
+
const AbstractBiPhasicGroupPlugin_1 = require("./AbstractBiPhasicGroupPlugin");
|
|
5
|
+
class MixableBiPhasicGroupAndEntryPlugin extends AbstractBiPhasicGroupPlugin_1.AbstractBiPhasicGroupPlugin {
|
|
6
|
+
attachStandardPhase(compilation) {
|
|
7
|
+
throw new Error("This must be implemented");
|
|
8
|
+
}
|
|
9
|
+
attachUniquePhase(compilation) {
|
|
10
|
+
throw new Error("This must be implemented");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.MixableBiPhasicGroupAndEntryPlugin = MixableBiPhasicGroupAndEntryPlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractBiPhasicGroupPlugin } from "./AbstractBiPhasicGroupPlugin";
|
|
2
|
+
import { Compilation } from "webpack";
|
|
3
|
+
export declare class MixableBiPhasicGroupPlugin extends AbstractBiPhasicGroupPlugin {
|
|
4
|
+
protected attachStandardPhase(compilation: Compilation): void;
|
|
5
|
+
protected attachUniquePhase(compilation: Compilation): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MixableBiPhasicGroupPlugin = void 0;
|
|
4
|
+
const AbstractBiPhasicGroupPlugin_1 = require("./AbstractBiPhasicGroupPlugin");
|
|
5
|
+
class MixableBiPhasicGroupPlugin extends AbstractBiPhasicGroupPlugin_1.AbstractBiPhasicGroupPlugin {
|
|
6
|
+
attachStandardPhase(compilation) {
|
|
7
|
+
throw new Error("This must be implemented");
|
|
8
|
+
}
|
|
9
|
+
attachUniquePhase(compilation) {
|
|
10
|
+
throw new Error("This must be implemented");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.MixableBiPhasicGroupPlugin = MixableBiPhasicGroupPlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BlockEntrypointInfo, ParsedAssetJsonProvider, VerifiedAdvancedOutputConfig } from "../shared";
|
|
2
|
-
import type { VerifiedPlauditWordpressWebpackConfig } from "../utils/common-config-helpers";
|
|
1
|
+
import { BlockEntrypointInfo, ParsedAssetJsonProvider, VerifiedAdvancedOutputConfig, VerifiedPlauditWordpressWebpackConfig } from "../shared";
|
|
3
2
|
import { AbstractBiPhasicGroupAndEntryPlugin, EntryProvider } from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
4
3
|
import { Compilation } from "webpack";
|
|
5
4
|
export declare class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAndEntryPlugin<BlockEntrypointInfo> {
|
|
5
|
+
private readonly config;
|
|
6
6
|
private readonly buildRoot;
|
|
7
7
|
private readonly outputDir;
|
|
8
8
|
private readonly dest;
|
|
@@ -5,19 +5,21 @@ const node_path_1 = require("node:path");
|
|
|
5
5
|
const php_writer_1 = require("@plaudit/php-writer");
|
|
6
6
|
const expressions_1 = require("@plaudit/php-writer/expressions");
|
|
7
7
|
const shared_1 = require("../shared");
|
|
8
|
-
const
|
|
8
|
+
const pseudo_semaphore_1 = require("../utils/pseudo-semaphore");
|
|
9
9
|
const path_query_and_related_helpers_1 = require("../utils/path-query-and-related-helpers");
|
|
10
10
|
const AbstractBiPhasicGroupAndEntryPlugin_1 = require("./AbstractBiPhasicGroupAndEntryPlugin");
|
|
11
11
|
const UnifiedLoaderGenerator_1 = require("./UnifiedLoaderGenerator");
|
|
12
12
|
const webpack_1 = require("webpack");
|
|
13
13
|
class PlainEntrypointsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.AbstractBiPhasicGroupAndEntryPlugin {
|
|
14
|
+
config;
|
|
14
15
|
buildRoot;
|
|
15
16
|
outputDir;
|
|
16
17
|
dest;
|
|
17
18
|
useUnifiedLoader;
|
|
18
|
-
static semaphore = new
|
|
19
|
+
static semaphore = new pseudo_semaphore_1.PseudoSemaphore("Plain");
|
|
19
20
|
constructor(config, buildRoot, outputDir, dest, useUnifiedLoader, context, entry) {
|
|
20
|
-
super(
|
|
21
|
+
super("plain-entrypoints-v2", [PlainEntrypointsConfigFileGeneratorPlugin.semaphore, UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore], context, entry);
|
|
22
|
+
this.config = config;
|
|
21
23
|
this.buildRoot = buildRoot;
|
|
22
24
|
this.outputDir = outputDir;
|
|
23
25
|
this.dest = dest;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { VerifiedPlauditWordpressWebpackConfig } from "../shared";
|
|
2
2
|
import { AbstractBiPhasicGroupPlugin } from "./AbstractBiPhasicGroupPlugin";
|
|
3
3
|
import { Compilation } from "webpack";
|
|
4
4
|
export declare class SpecialAssetHandlingPlugin extends AbstractBiPhasicGroupPlugin {
|
|
5
|
+
private readonly config;
|
|
5
6
|
private static readonly semaphore;
|
|
6
7
|
private static validPathname?;
|
|
7
8
|
constructor(config: VerifiedPlauditWordpressWebpackConfig);
|
|
@@ -8,15 +8,17 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
8
8
|
const php_writer_1 = require("@plaudit/php-writer");
|
|
9
9
|
const expressions_1 = require("@plaudit/php-writer/expressions");
|
|
10
10
|
const shared_1 = require("../shared");
|
|
11
|
-
const
|
|
11
|
+
const pseudo_semaphore_1 = require("../utils/pseudo-semaphore");
|
|
12
12
|
const AbstractBiPhasicGroupPlugin_1 = require("./AbstractBiPhasicGroupPlugin");
|
|
13
13
|
const UnifiedLoaderGenerator_1 = require("./UnifiedLoaderGenerator");
|
|
14
14
|
const webpack_1 = require("webpack");
|
|
15
15
|
class SpecialAssetHandlingPlugin extends AbstractBiPhasicGroupPlugin_1.AbstractBiPhasicGroupPlugin {
|
|
16
|
-
|
|
16
|
+
config;
|
|
17
|
+
static semaphore = new pseudo_semaphore_1.PseudoSemaphore("Special");
|
|
17
18
|
static validPathname = undefined;
|
|
18
19
|
constructor(config) {
|
|
19
|
-
super(
|
|
20
|
+
super("special-assets", [SpecialAssetHandlingPlugin.semaphore, UnifiedLoaderGenerator_1.UnifiedLoaderGenerator.semaphore]);
|
|
21
|
+
this.config = config;
|
|
20
22
|
}
|
|
21
23
|
attachStandardPhase(compilation) {
|
|
22
24
|
compilation.hooks.processAssets.tapPromise({ name: this.constructor.name, stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_ANALYSE }, async (assets) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PHPFile } from "@plaudit/php-writer";
|
|
2
2
|
import { AbstractBiPhasicGroupPlugin } from "./AbstractBiPhasicGroupPlugin";
|
|
3
|
-
import
|
|
4
|
-
import { PseudoSemaphore } from "../utils/
|
|
3
|
+
import { VerifiedPlauditWordpressWebpackConfig } from "../shared";
|
|
4
|
+
import { PseudoSemaphore } from "../utils/pseudo-semaphore";
|
|
5
5
|
import { Compilation } from "webpack";
|
|
6
6
|
export type LoaderInfo = {
|
|
7
7
|
group: string;
|
|
@@ -11,6 +11,7 @@ export type LoaderInfo = {
|
|
|
11
11
|
priority?: number;
|
|
12
12
|
};
|
|
13
13
|
export declare class UnifiedLoaderGenerator extends AbstractBiPhasicGroupPlugin {
|
|
14
|
+
private readonly config;
|
|
14
15
|
static readonly semaphore: PseudoSemaphore<LoaderInfo>;
|
|
15
16
|
constructor(config: VerifiedPlauditWordpressWebpackConfig);
|
|
16
17
|
protected attachStandardPhase(compilation: Compilation): void;
|
|
@@ -39,13 +39,15 @@ const php_writer_1 = require("@plaudit/php-writer");
|
|
|
39
39
|
const expressions_1 = require("@plaudit/php-writer/expressions");
|
|
40
40
|
const AbstractBiPhasicGroupPlugin_1 = require("./AbstractBiPhasicGroupPlugin");
|
|
41
41
|
const shared_1 = require("../shared");
|
|
42
|
-
const
|
|
42
|
+
const pseudo_semaphore_1 = require("../utils/pseudo-semaphore");
|
|
43
43
|
const webpack_1 = require("webpack");
|
|
44
44
|
const promises_1 = require("node:fs/promises");
|
|
45
45
|
class UnifiedLoaderGenerator extends AbstractBiPhasicGroupPlugin_1.AbstractBiPhasicGroupPlugin {
|
|
46
|
-
|
|
46
|
+
config;
|
|
47
|
+
static semaphore = new pseudo_semaphore_1.PseudoSemaphore("Unified");
|
|
47
48
|
constructor(config) {
|
|
48
|
-
super(
|
|
49
|
+
super("unified-loader", []);
|
|
50
|
+
this.config = config;
|
|
49
51
|
}
|
|
50
52
|
attachStandardPhase(compilation) {
|
|
51
53
|
compilation.hooks.afterProcessAssets.tap(this.constructor.name, () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VerifiedPlauditWordpressWebpackConfig } from "../
|
|
1
|
+
import type { VerifiedPlauditWordpressWebpackConfig } from "../shared";
|
|
2
2
|
import type { Compiler, WebpackPluginInstance } from "webpack";
|
|
3
3
|
export declare class VariablesJSMonitorPlugin implements WebpackPluginInstance {
|
|
4
4
|
private readonly config;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./AbstractBiPhasicGroupAndEntryPlugin";
|
|
2
|
+
export * from "./AbstractBiPhasicGroupPlugin";
|
|
3
|
+
export * from "./EnhancedBlockJSONPlugin";
|
|
4
|
+
export * from "./ExtensionsConfigFileGeneratorPlugin";
|
|
5
|
+
export * from "./MixableBiPhasicGroupAndEntryPlugin";
|
|
6
|
+
export * from "./MixableBiPhasicGroupPlugin";
|
|
7
|
+
export * from "./PlainEntrypointsConfigFileGeneratorPlugin";
|
|
8
|
+
export * from "./UnifiedLoaderGenerator";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AbstractBiPhasicGroupAndEntryPlugin"), exports);
|
|
18
|
+
__exportStar(require("./AbstractBiPhasicGroupPlugin"), exports);
|
|
19
|
+
__exportStar(require("./EnhancedBlockJSONPlugin"), exports);
|
|
20
|
+
__exportStar(require("./ExtensionsConfigFileGeneratorPlugin"), exports);
|
|
21
|
+
__exportStar(require("./MixableBiPhasicGroupAndEntryPlugin"), exports);
|
|
22
|
+
__exportStar(require("./MixableBiPhasicGroupPlugin"), exports);
|
|
23
|
+
__exportStar(require("./PlainEntrypointsConfigFileGeneratorPlugin"), exports);
|
|
24
|
+
__exportStar(require("./UnifiedLoaderGenerator"), exports);
|
package/dist/shared.d.ts
CHANGED
|
@@ -158,6 +158,10 @@ export type PlauditWordpressWebpackConfig = {
|
|
|
158
158
|
targetNamespace?: string;
|
|
159
159
|
useBlockSupportsAsThemeJsonDefaults?: boolean;
|
|
160
160
|
};
|
|
161
|
+
export type VerifiedPlauditWordpressWebpackConfig = Required<Omit<PlauditWordpressWebpackConfig, 'variables' | 'src' | 'externals' | 'standard'>> & {
|
|
162
|
+
variablesFilePath?: string;
|
|
163
|
+
currentVariables: Record<string, any>;
|
|
164
|
+
} & Pick<PlauditWordpressWebpackConfig, 'externals'>;
|
|
161
165
|
/** Unified-loader watch output: `dist` → `dist-dev` when SERVER_MODE is development. */
|
|
162
166
|
export declare function shouldWriteDistDev(config: Pick<PlauditWordpressWebpackConfig, 'outputDir' | 'useUnifiedLoader' | 'omitDistDev'>): boolean;
|
|
163
167
|
/**
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { AbstractBiPhasicGroupAndEntryPlugin, EntryProvider } from "../plugins/AbstractBiPhasicGroupAndEntryPlugin";
|
|
2
2
|
import type { AdditionalDependencyInjectorPlugin } from "../plugins/AdditionalDependencyInjectorPlugin";
|
|
3
|
-
import { EntrypointFields,
|
|
3
|
+
import { EntrypointFields, VerifiedPlauditWordpressWebpackConfig, BlockEntrypointInfo, VerifiedAdvancedOutputConfig, MinimumViableMetadata } from "../shared";
|
|
4
4
|
import type { Compiler, Configuration, DynamicEntryPlugin, WebpackPluginInstance } from "webpack";
|
|
5
5
|
import type WebpackRemoveEmptyScriptsPlugin from "webpack-remove-empty-scripts";
|
|
6
|
-
export type VerifiedPlauditWordpressWebpackConfig = Required<Omit<PlauditWordpressWebpackConfig, 'variables' | 'src' | 'externals' | 'standard'>> & {
|
|
7
|
-
variablesFilePath?: string;
|
|
8
|
-
currentVariables: Record<string, any>;
|
|
9
|
-
} & Pick<PlauditWordpressWebpackConfig, 'externals'>;
|
|
10
6
|
export type CommonPluginConfig = {
|
|
11
7
|
plugins: (WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void))[];
|
|
12
8
|
removeEmptyScriptsPlugin: WebpackRemoveEmptyScriptsPlugin;
|
|
@@ -461,14 +461,14 @@ function buildCommonPluginConfig(webpackConfig, config, bundleAnalyzer, assumeGl
|
|
|
461
461
|
if ((0, shared_1.isDistDevOutputPath)(config.outputDir)) {
|
|
462
462
|
try {
|
|
463
463
|
const { PlauditDevPlugin } = require("@plaudit/dev-webpack-plugin");
|
|
464
|
-
plugins.push(new PlauditDevPlugin());
|
|
464
|
+
plugins.push(new PlauditDevPlugin(config));
|
|
465
465
|
}
|
|
466
466
|
catch { }
|
|
467
467
|
}
|
|
468
468
|
return {
|
|
469
469
|
plugins, removeEmptyScriptsPlugin,
|
|
470
470
|
makeAdditionalDependencyInjectorPlugin(referencePlugin) {
|
|
471
|
-
return new AdditionalDependencyInjectorPlugin_1.AdditionalDependencyInjectorPlugin(
|
|
471
|
+
return new AdditionalDependencyInjectorPlugin_1.AdditionalDependencyInjectorPlugin(webpackConfig.output?.module, builtDependencyExtractionWebpackPlugin.addExternalizedDep, referencePlugin);
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
474
|
}
|
|
@@ -593,7 +593,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
|
|
|
593
593
|
};
|
|
594
594
|
plugin = config.extensionsVersion > 1
|
|
595
595
|
? new ExtensionsConfigFileGeneratorPlugin_1.ExtensionsConfigFileGeneratorPlugin(config, srcRoot, dest, contextPath, entry)
|
|
596
|
-
: new ExtensionsConfigFileGeneratorPluginV1_1.ExtensionsConfigFileGeneratorPluginV1(
|
|
596
|
+
: new ExtensionsConfigFileGeneratorPluginV1_1.ExtensionsConfigFileGeneratorPluginV1(dest.destination, contextPath, entry);
|
|
597
597
|
plugins.push(plugin);
|
|
598
598
|
}
|
|
599
599
|
else if (sourceType === "plain" /* SourceType.plain */) {
|
|
@@ -613,7 +613,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
|
|
|
613
613
|
console.error("Using directory mode with legacy plain entrypoint handling is not supported");
|
|
614
614
|
continue;
|
|
615
615
|
}
|
|
616
|
-
plugin = new EnhancedDynamicEntryPlugin_1.EnhancedDynamicEntryPlugin(
|
|
616
|
+
plugin = new EnhancedDynamicEntryPlugin_1.EnhancedDynamicEntryPlugin(contextPath, () => ({ [baseDest]: { import: Array.isArray(srcRoot) ? srcRoot : [srcRoot], plauditMetadata: { purpose: "plain-entrypoint", dest, absoluteSrc } } }));
|
|
617
617
|
}
|
|
618
618
|
plugins.push(plugin);
|
|
619
619
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaudit/webpack-extensions",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
"./wordpress-scripts-wrapper": "./dist/wordpress-scripts-wrapper.js",
|
|
18
18
|
"./location-encoding-filename-parser": "./dist/utils/location-encoding-filename-parser.js",
|
|
19
|
-
"./shared": "./dist/shared.js"
|
|
19
|
+
"./shared": "./dist/shared.js",
|
|
20
|
+
"./plugins": "./dist/plugins/index.js",
|
|
21
|
+
"./utils/pseudo-semaphore": "./dist/utils/pseudo-semaphore.js"
|
|
20
22
|
},
|
|
21
23
|
"typesVersions": {
|
|
22
24
|
"*": {
|
|
@@ -32,10 +34,10 @@
|
|
|
32
34
|
}
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
|
-
"@plaudit/dev-webpack-plugin": "^1.
|
|
37
|
+
"@plaudit/dev-webpack-plugin": "^1.3.1",
|
|
36
38
|
"@plaudit/gutenberg-api-extensions": "^2.98.2",
|
|
37
39
|
"@types/jsdom": "^30.0.0",
|
|
38
|
-
"@types/node": "^26.
|
|
40
|
+
"@types/node": "^26.3.0",
|
|
39
41
|
"@types/postcss-functions": "^4.0.4",
|
|
40
42
|
"@types/postcss-import": "^14.0.3",
|
|
41
43
|
"@types/tapable": "^2.3.0",
|
|
@@ -52,14 +54,14 @@
|
|
|
52
54
|
"react-dom": "^18.3.1",
|
|
53
55
|
"rimraf": "^5.0.10",
|
|
54
56
|
"typescript": "^7.0.2",
|
|
55
|
-
"webpack-bundle-analyzer": "^5.3.
|
|
57
|
+
"webpack-bundle-analyzer": "^5.3.2"
|
|
56
58
|
},
|
|
57
59
|
"dependencies": {
|
|
58
60
|
"@plaudit/php-writer": "^1.5.5",
|
|
59
61
|
"@plaudit/postcss-color-function": "^5.1.0",
|
|
60
62
|
"@plaudit/postcss-strip-units": "^3.0.0",
|
|
61
63
|
"@plaudit/postcss-variables": "^2.0.1",
|
|
62
|
-
"@wordpress/scripts": "^
|
|
64
|
+
"@wordpress/scripts": "^34.1.0",
|
|
63
65
|
"autoprefixer": "^10.5.4",
|
|
64
66
|
"copy-webpack-plugin": "10.2.4",
|
|
65
67
|
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
@@ -82,7 +84,7 @@
|
|
|
82
84
|
"xml-formatter": "^3.7.0"
|
|
83
85
|
},
|
|
84
86
|
"peerDependencies": {
|
|
85
|
-
"@plaudit/dev-webpack-plugin": "^1.
|
|
87
|
+
"@plaudit/dev-webpack-plugin": "^1.3.1"
|
|
86
88
|
},
|
|
87
89
|
"peerDependenciesMeta": {
|
|
88
90
|
"@plaudit/dev-webpack-plugin": {
|
|
File without changes
|
|
File without changes
|