@plaudit/webpack-extensions 2.70.1 → 2.72.0
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/build/plugins/ExtensionsConfigFileGeneratorPlugin.js +5 -5
- package/build/plugins/ExtensionsConfigFileGeneratorPluginV1.js +4 -4
- package/build/plugins/PlainEntrypointsConfigFileGeneratorPlugin.js +6 -5
- package/build/plugins/PlainEntrypointsStyleBlockJSONPlugin.d.ts +3 -3
- package/build/plugins/PlainEntrypointsStyleBlockJSONPlugin.js +37 -19
- package/build/plugins/SpecialAssetHandlingPlugin.js +7 -6
- package/build/plugins/UnifiedLoaderGenerator.d.ts +1 -1
- package/build/plugins/UnifiedLoaderGenerator.js +3 -4
- package/build/shared.d.ts +3 -2
- package/build/shared.js +18 -13
- package/build/wordpress-scripts-wrapper.js +7 -6
- package/package.json +5 -4
- package/build/utils/json-to-php-but-with-__-injection.d.ts +0 -11
- package/build/utils/json-to-php-but-with-__-injection.js +0 -53
- package/build/utils/php-serializer.d.ts +0 -6
- package/build/utils/php-serializer.js +0 -53
- package/build/utils/php-writer.d.ts +0 -237
- package/build/utils/php-writer.js +0 -634
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { AssetInfo, Compilation } from "webpack";
|
|
2
|
-
export declare abstract class Expr {
|
|
3
|
-
static readonly jsonToPHPConverter: (obj: unknown, parentIndent?: string) => string;
|
|
4
|
-
static readonly convertJsonToPHP: (obj: unknown) => string;
|
|
5
|
-
protected constructor();
|
|
6
|
-
abstract toString(): string;
|
|
7
|
-
typeName(): string;
|
|
8
|
-
static isset(...checks: (Var | ArrayAccess | ObjectAccess)[]): Call;
|
|
9
|
-
static call(name: string, args: ConstructorParameters<typeof Call>[1]): Call;
|
|
10
|
-
}
|
|
11
|
-
export interface EnclosableExpression extends Expr {
|
|
12
|
-
toEnclosedForm(): string;
|
|
13
|
-
not(): Not;
|
|
14
|
-
}
|
|
15
|
-
export interface PotentiallyWriteableExpression extends EnclosableExpression {
|
|
16
|
-
readonly potentiallyWritable: true;
|
|
17
|
-
}
|
|
18
|
-
export declare function isEnclosableExpression(a: unknown): a is EnclosableExpression;
|
|
19
|
-
export declare function isPotentiallyWriteableExpression(a: unknown): a is PotentiallyWriteableExpression;
|
|
20
|
-
export declare abstract class AbstractEnclosableExpression extends Expr implements EnclosableExpression {
|
|
21
|
-
static readonly closers: Readonly<{
|
|
22
|
-
"(": ")";
|
|
23
|
-
"[": "]";
|
|
24
|
-
"{": "}";
|
|
25
|
-
}>;
|
|
26
|
-
abstract toEnclosedForm(): string;
|
|
27
|
-
not(): Not;
|
|
28
|
-
}
|
|
29
|
-
export declare abstract class ParenthesesEnclosableExpression extends AbstractEnclosableExpression {
|
|
30
|
-
toEnclosedForm(): string;
|
|
31
|
-
}
|
|
32
|
-
export declare abstract class EnclosedExpression extends AbstractEnclosableExpression {
|
|
33
|
-
toEnclosedForm(): string;
|
|
34
|
-
}
|
|
35
|
-
export declare class Literal extends Expr {
|
|
36
|
-
readonly expression: string;
|
|
37
|
-
constructor(expression: string);
|
|
38
|
-
toString(): string;
|
|
39
|
-
static of(expression: string | PHPWriter, enclosed: true): EnclosedLiteral;
|
|
40
|
-
static of(expression: string | PHPWriter, enclosureOpen: keyof typeof AbstractEnclosableExpression.closers, encloserClose?: string): EnclosableLiteral;
|
|
41
|
-
static of(expression: string | PHPWriter, enclosureOpen: string, encloserClose: string): EnclosableLiteral;
|
|
42
|
-
static of(expression: string | PHPWriter, enclosed?: false | undefined): Literal;
|
|
43
|
-
static name(expression: string): EnclosedLiteral;
|
|
44
|
-
}
|
|
45
|
-
export declare class EnclosedLiteral extends Literal implements EnclosableExpression {
|
|
46
|
-
constructor(expression: string);
|
|
47
|
-
toEnclosedForm(): string;
|
|
48
|
-
not(): Not;
|
|
49
|
-
}
|
|
50
|
-
export declare class EnclosableLiteral extends Literal implements EnclosableExpression {
|
|
51
|
-
private readonly enclosureOpen;
|
|
52
|
-
private readonly enclosureClose;
|
|
53
|
-
constructor(expression: string, enclosureOpen: string, enclosureClose: string);
|
|
54
|
-
toEnclosedForm(): string;
|
|
55
|
-
not(): Not;
|
|
56
|
-
}
|
|
57
|
-
export declare class Var extends EnclosedExpression implements PotentiallyWriteableExpression {
|
|
58
|
-
readonly name: string;
|
|
59
|
-
readonly potentiallyWritable = true;
|
|
60
|
-
constructor(name: string);
|
|
61
|
-
toString(): string;
|
|
62
|
-
}
|
|
63
|
-
export declare class Op extends ParenthesesEnclosableExpression {
|
|
64
|
-
readonly operator: string;
|
|
65
|
-
readonly args: readonly unknown[];
|
|
66
|
-
constructor(operator: string, ...args: unknown[]);
|
|
67
|
-
toString(): string;
|
|
68
|
-
static binary(left: unknown, operator: string, right: unknown): Op;
|
|
69
|
-
static concat(...args: unknown[]): Op;
|
|
70
|
-
}
|
|
71
|
-
export declare class Not extends ParenthesesEnclosableExpression {
|
|
72
|
-
readonly expression: EnclosableExpression;
|
|
73
|
-
constructor(expression: EnclosableExpression);
|
|
74
|
-
toString(): string;
|
|
75
|
-
}
|
|
76
|
-
type AtLeastOneArray<T> = [T, ...T[]];
|
|
77
|
-
type ReadonlyAtLeastOneArray<T> = readonly [T, ...T[]];
|
|
78
|
-
export type Accessor = Expr | string | number;
|
|
79
|
-
export type AccessorOrAccessorArray = Accessor | AtLeastOneArray<Accessor>;
|
|
80
|
-
export declare abstract class Access extends EnclosedExpression implements PotentiallyWriteableExpression {
|
|
81
|
-
readonly target: EnclosableExpression;
|
|
82
|
-
readonly potentiallyWritable = true;
|
|
83
|
-
readonly accesses: ReadonlyAtLeastOneArray<Accessor>;
|
|
84
|
-
constructor(target: EnclosableExpression, accesses: AccessorOrAccessorArray);
|
|
85
|
-
abstract endsWithCall(): boolean;
|
|
86
|
-
abstract endsWithPotentiallyWritableExpression(): boolean;
|
|
87
|
-
}
|
|
88
|
-
export declare class ArrayAccess extends Access {
|
|
89
|
-
toString(): string;
|
|
90
|
-
endsWithCall(): boolean;
|
|
91
|
-
endsWithPotentiallyWritableExpression(): boolean;
|
|
92
|
-
}
|
|
93
|
-
export declare class ObjectAccess extends Access {
|
|
94
|
-
static readonly validObjectKey: RegExp;
|
|
95
|
-
toString(): string;
|
|
96
|
-
endsWithCall(): boolean;
|
|
97
|
-
endsWithPotentiallyWritableExpression(): boolean;
|
|
98
|
-
}
|
|
99
|
-
export declare class Call extends EnclosedExpression implements PotentiallyWriteableExpression {
|
|
100
|
-
readonly callee: string | EnclosableExpression;
|
|
101
|
-
readonly args: readonly unknown[];
|
|
102
|
-
readonly potentiallyWritable = true;
|
|
103
|
-
constructor(callee: string | EnclosableExpression, args: readonly unknown[]);
|
|
104
|
-
toString(): string;
|
|
105
|
-
}
|
|
106
|
-
export declare class Parameter extends Expr {
|
|
107
|
-
readonly value: unknown;
|
|
108
|
-
readonly name?: string | undefined;
|
|
109
|
-
constructor(value: unknown, name?: string | undefined);
|
|
110
|
-
toString(): string;
|
|
111
|
-
}
|
|
112
|
-
export declare class FirstClassCallable extends ParenthesesEnclosableExpression {
|
|
113
|
-
readonly name: EnclosableExpression;
|
|
114
|
-
constructor(name: EnclosableExpression);
|
|
115
|
-
static from(literal: string): FirstClassCallable;
|
|
116
|
-
toString(): string;
|
|
117
|
-
}
|
|
118
|
-
export declare const validPHPLabel: RegExp;
|
|
119
|
-
type Assignable = EnclosedExpression & PotentiallyWriteableExpression;
|
|
120
|
-
export declare class Assignment extends ParenthesesEnclosableExpression {
|
|
121
|
-
readonly value: unknown;
|
|
122
|
-
readonly push: boolean;
|
|
123
|
-
readonly assignees: ReadonlyAtLeastOneArray<Assignable>;
|
|
124
|
-
constructor(assignees: Assignable, value: unknown, push: true);
|
|
125
|
-
constructor(assignees: Assignable | AtLeastOneArray<Assignable>, value: unknown, push?: false | undefined);
|
|
126
|
-
toString(): string;
|
|
127
|
-
}
|
|
128
|
-
export declare abstract class Constants {
|
|
129
|
-
static readonly __FILE__: EnclosedLiteral;
|
|
130
|
-
static readonly __DIR__: EnclosedLiteral;
|
|
131
|
-
static readonly ABSPATH: EnclosedLiteral;
|
|
132
|
-
}
|
|
133
|
-
export type AppendExprArgs = {
|
|
134
|
-
chain?: boolean;
|
|
135
|
-
return?: boolean;
|
|
136
|
-
};
|
|
137
|
-
export type ActionOrFilterArgs = {
|
|
138
|
-
priority?: number | Expr;
|
|
139
|
-
functionArgParameters?: string[];
|
|
140
|
-
useVars?: Var[];
|
|
141
|
-
accountForAlreadyDoing?: boolean | Parameters<PHPWriter['call']>[1];
|
|
142
|
-
};
|
|
143
|
-
export type FunctionCreationArgs = {
|
|
144
|
-
includeExistenceCheck?: boolean;
|
|
145
|
-
useVars?: Var[];
|
|
146
|
-
returnType?: string;
|
|
147
|
-
assignToName?: boolean;
|
|
148
|
-
scopeActionDescription?: string;
|
|
149
|
-
};
|
|
150
|
-
export type RequireOrIncludeArgs = {
|
|
151
|
-
dirRelative?: boolean;
|
|
152
|
-
once?: boolean;
|
|
153
|
-
} & AppendExprArgs;
|
|
154
|
-
export declare class PHPWriter {
|
|
155
|
-
private readonly inlineFirstLine;
|
|
156
|
-
private readonly scopeStack;
|
|
157
|
-
private readonly useList;
|
|
158
|
-
private readonly allocatedGeneratedFunctionNames;
|
|
159
|
-
private readonly isSubwriter;
|
|
160
|
-
private printingInPHP;
|
|
161
|
-
private buffer;
|
|
162
|
-
private indentation;
|
|
163
|
-
private fileNamespace;
|
|
164
|
-
private myOpenedScopes;
|
|
165
|
-
constructor(inlineFirstLine?: boolean, scopeStack?: string[][], useList?: string[], allocatedGeneratedFunctionNames?: Set<string>, isSubwriter?: boolean, printingInPHP?: boolean, initialIndentation?: number);
|
|
166
|
-
createSubwriter(): PHPWriter;
|
|
167
|
-
indent(): this;
|
|
168
|
-
outdent(): this;
|
|
169
|
-
setIndentation(level: number): this;
|
|
170
|
-
/**
|
|
171
|
-
* @param lines These are treated as literal *regardless of their types*
|
|
172
|
-
*/
|
|
173
|
-
append(...lines: (string | Expr)[]): this;
|
|
174
|
-
/**
|
|
175
|
-
* @param expr This is treated as literal *regardless of its type*
|
|
176
|
-
* @param opts flags to add additional markup around the expression
|
|
177
|
-
*/
|
|
178
|
-
appendExpr(expr: string | Expr, opts?: AppendExprArgs): this;
|
|
179
|
-
assign(assignee: ConstructorParameters<typeof Assignment>[0] | string, expression: unknown, opts?: AppendExprArgs): this;
|
|
180
|
-
return(expression: unknown | Expr): this;
|
|
181
|
-
static(variable: Var | string, opts?: {
|
|
182
|
-
initializer?: unknown | Literal;
|
|
183
|
-
withTest?: boolean | 'chainable';
|
|
184
|
-
}): this;
|
|
185
|
-
linebreak(): this;
|
|
186
|
-
/**
|
|
187
|
-
* @param func This is treated as literal *regardless of its type*
|
|
188
|
-
* @param args
|
|
189
|
-
* @param opts
|
|
190
|
-
*/
|
|
191
|
-
call(func: string | EnclosableExpression, args: unknown[], opts?: {
|
|
192
|
-
assignTo?: ConstructorParameters<typeof Assignment>[0];
|
|
193
|
-
} & AppendExprArgs): this;
|
|
194
|
-
action(name: string | Expr, contents: (writer: PHPWriter) => void, args?: ActionOrFilterArgs): this;
|
|
195
|
-
filter(name: string | Expr, contents: (writer: PHPWriter) => void, args?: ActionOrFilterArgs): this;
|
|
196
|
-
actionOrFilter(type: 'action' | 'filter', name: string | Expr, contents: (writer: PHPWriter) => void, args: ActionOrFilterArgs): this;
|
|
197
|
-
if(condition: Expr): this;
|
|
198
|
-
elseIf(condition: Expr): this;
|
|
199
|
-
else(): this;
|
|
200
|
-
endIf(): this;
|
|
201
|
-
function(name: true, parameters: (string | Var)[], body: (writer: PHPWriter) => void, args?: FunctionCreationArgs): Var;
|
|
202
|
-
function(name: string | Var | false, parameters: (string | Var)[], body: (writer: PHPWriter) => void, args?: FunctionCreationArgs): this;
|
|
203
|
-
generateFunctionName(asVariable: true): Var;
|
|
204
|
-
generateFunctionName(asVariable?: false | undefined): string;
|
|
205
|
-
generateFunctionName(asVariable?: boolean): string | Var;
|
|
206
|
-
closePHP(): this;
|
|
207
|
-
openPHP(): this;
|
|
208
|
-
namespace(namespace: string): this;
|
|
209
|
-
use(...uses: string[]): this;
|
|
210
|
-
require(filePath: string | Expr, args?: RequireOrIncludeArgs): this;
|
|
211
|
-
include(filePath: string | Expr, args?: RequireOrIncludeArgs): this;
|
|
212
|
-
requireOrInclude(type: 'require' | 'include', filePath: string | Expr, args: RequireOrIncludeArgs): this;
|
|
213
|
-
/**
|
|
214
|
-
* Starts a scope that, when paired with {@link #closeScope()}, allows for automating unset calls.
|
|
215
|
-
* All scopes started MUST be paired with either an {@link #closeScope()} or {@link #popScope()} call.
|
|
216
|
-
*/
|
|
217
|
-
openScope(): this;
|
|
218
|
-
/**
|
|
219
|
-
* Pops the top scope from the stack AND unsets all variables that were assigned within it
|
|
220
|
-
*/
|
|
221
|
-
closeScope(): this;
|
|
222
|
-
/**
|
|
223
|
-
* Pops the top scope from the stack WITHOUT calling unset for the variables that were assigned within it.
|
|
224
|
-
* This is used to allow function bodies to be safely created without disrupting their containing scope.
|
|
225
|
-
*/
|
|
226
|
-
popScope(): this;
|
|
227
|
-
withScope(code: (writer: PHPWriter) => void, opts?: {
|
|
228
|
-
actionDescription?: string;
|
|
229
|
-
usePopScopeInstead?: boolean;
|
|
230
|
-
}): this;
|
|
231
|
-
toString(args?: {
|
|
232
|
-
includeOpenPHP?: boolean;
|
|
233
|
-
includeNamespaceAndUse?: boolean;
|
|
234
|
-
}): string;
|
|
235
|
-
emitAsset(compilation: Compilation, file: string, assetInfo?: AssetInfo): void;
|
|
236
|
-
}
|
|
237
|
-
export {};
|