@visulima/packem-rollup 1.0.0-alpha.23 → 1.0.0-alpha.25
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 +20 -0
- package/LICENSE.md +0 -436
- package/dist/index.d.ts +25 -26
- package/dist/index.js +1 -0
- package/dist/packem_shared/cachingPlugin-CLawAGhx.js +1 -0
- package/dist/packem_shared/createSplitChunks-Ceq_Ca5Y.js +1 -0
- package/dist/packem_shared/{esbuildPlugin-BrFhdKJk.mjs → esbuildPlugin-DpLtQGuZ.js} +1 -1
- package/dist/packem_shared/oxcResolvePlugin-Ccef6pyL.js +1 -0
- package/dist/packem_shared/{patchTypescriptTypes-BEdkvKxL.mjs → patchTypescriptTypes-BX_sJsvd.js} +2 -2
- package/dist/packem_shared/{resolveTsconfigPathsPlugin-pUcTdE77.mjs → resolveTsconfigPathsPlugin-CEasmDpi.js} +1 -1
- package/dist/packem_shared/{resolveTsconfigRootDirectoriesPlugin-_93afm2q.mjs → resolveTsconfigRootDirectoriesPlugin-Cwj3tqCJ.js} +1 -1
- package/dist/packem_shared/{types-Bk7lLMcF.d.ts → types-BiZanzz1.d.ts} +25 -136
- package/dist/plugins/cjs-interop.d.ts +11 -0
- package/dist/{packem_shared/cjsInteropPlugin-D5wyoQ_B.mjs → plugins/cjs-interop.js} +1 -1
- package/dist/plugins/copy.d.ts +18 -0
- package/dist/plugins/copy.js +1 -0
- package/dist/plugins/data-uri.d.ts +12 -0
- package/dist/plugins/data-uri.js +1 -0
- package/dist/plugins/debarrel.d.ts +11 -0
- package/dist/{packem_shared/debarrelPlugin-BTYc859G.mjs → plugins/debarrel.js} +1 -1
- package/dist/plugins/esbuild/index.d.ts +19 -5
- package/dist/plugins/esbuild/index.js +1 -0
- package/dist/plugins/esm-shim-cjs-syntax.d.ts +13 -0
- package/dist/plugins/fix-dts-default-cjs-exports.d.ts +9 -0
- package/dist/plugins/fix-dts-default-cjs-exports.js +1 -0
- package/dist/plugins/isolated-declarations/index.d.ts +13 -0
- package/dist/{packem_shared/isolatedDeclarationsPlugin-B34s_qkE.mjs → plugins/isolated-declarations/index.js} +1 -1
- package/dist/plugins/json.d.ts +7 -0
- package/dist/plugins/json.js +1 -0
- package/dist/plugins/jsx-remove-attributes.d.ts +11 -0
- package/dist/plugins/jsx-remove-attributes.js +1 -0
- package/dist/plugins/license.d.ts +21 -0
- package/dist/plugins/license.js +13 -0
- package/dist/plugins/minify-html-literals/index.d.ts +96 -6
- package/dist/plugins/native-modules-plugin.d.ts +9 -0
- package/dist/plugins/oxc/index.d.ts +20 -6
- package/dist/plugins/oxc/index.js +1 -0
- package/dist/plugins/preserve-directives.d.ts +13 -0
- package/dist/{packem_shared/preserveDirectivesPlugin-B49Cbykd.mjs → plugins/preserve-directives.js} +3 -3
- package/dist/plugins/raw.d.ts +11 -0
- package/dist/plugins/require-cjs-transformer.d.ts +17 -0
- package/dist/plugins/require-cjs-transformer.js +21 -0
- package/dist/plugins/shebang.d.ts +13 -0
- package/dist/plugins/source-maps.d.ts +11 -0
- package/dist/plugins/sucrase/index.d.ts +18 -4
- package/dist/plugins/swc/index.d.ts +19 -5
- package/dist/plugins/swc/index.js +1 -0
- package/dist/plugins/typescript/index.d.ts +20 -6
- package/dist/plugins/typescript/index.js +1 -0
- package/dist/plugins/url.d.ts +17 -0
- package/dist/plugins/url.js +1 -0
- package/package.json +86 -18
- package/dist/index.d.mts +0 -59
- package/dist/index.mjs +0 -1
- package/dist/packem_shared/browserslist-to-esbuild-DY9HwYtp.d.mts +0 -3
- package/dist/packem_shared/cachingPlugin-TWoY5ZxV.mjs +0 -1
- package/dist/packem_shared/copyPlugin--6RITp1-.mjs +0 -1
- package/dist/packem_shared/createSplitChunks-CGDk55G3.mjs +0 -1
- package/dist/packem_shared/dataUriPlugin-BFb7bZZs.mjs +0 -1
- package/dist/packem_shared/fixDtsDefaultCjsExportsPlugin-Dp1UcHVR.mjs +0 -1
- package/dist/packem_shared/index-hWYvkB02.d.mts +0 -346
- package/dist/packem_shared/index-hWYvkB02.d.ts +0 -346
- package/dist/packem_shared/jsonPlugin-BAi3Da-h.mjs +0 -1
- package/dist/packem_shared/jsxRemoveAttributes-B1PLPffj.mjs +0 -1
- package/dist/packem_shared/licensePlugin-C5yzUqe-.mjs +0 -13
- package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG.mjs +0 -1
- package/dist/packem_shared/requireCJSTransformerPlugin-E2iuTrjs.mjs +0 -27
- package/dist/packem_shared/types-CMThMMkh.d.mts +0 -4337
- package/dist/packem_shared/urlPlugin-DJJrDWjj.mjs +0 -1
- package/dist/plugins/esbuild/index.d.mts +0 -28
- package/dist/plugins/esbuild/index.mjs +0 -1
- package/dist/plugins/minify-html-literals/index.d.mts +0 -5
- package/dist/plugins/oxc/index.d.mts +0 -31
- package/dist/plugins/oxc/index.mjs +0 -1
- package/dist/plugins/sucrase/index.d.mts +0 -22
- package/dist/plugins/swc/index.d.mts +0 -29
- package/dist/plugins/swc/index.mjs +0 -1
- package/dist/plugins/typescript/index.d.mts +0 -32
- package/dist/plugins/typescript/index.mjs +0 -1
- /package/dist/packem_shared/{browserslistToEsbuild-C0IWmbNe.mjs → browserslistToEsbuild-C0IWmbNe.js} +0 -0
- /package/dist/packem_shared/{chunkSplitter-DWAy1JkE.mjs → chunkSplitter-DWAy1JkE.js} +0 -0
- /package/dist/packem_shared/{fix-dts-default-cjs-exports-BQc0nwIG.mjs → fix-dts-default-cjs-exports-BQc0nwIG.js} +0 -0
- /package/dist/packem_shared/{fixDynamicImportExtension-BBGNRniz.mjs → fixDynamicImportExtension-BBGNRniz.js} +0 -0
- /package/dist/packem_shared/{getCustomModuleLayer-d8i66lfh.mjs → getCustomModuleLayer-d8i66lfh.js} +0 -0
- /package/dist/packem_shared/{getModuleLayer-rF9RxnJ5.mjs → getModuleLayer-rF9RxnJ5.js} +0 -0
- /package/dist/packem_shared/{index-Dq8IUFTs.mjs → index-Dq8IUFTs.js} +0 -0
- /package/dist/packem_shared/{index-QEzU3Fey.mjs → index-QEzU3Fey.js} +0 -0
- /package/dist/packem_shared/{isolatedDeclarationsOxcTransformer-WbfE6cGu.mjs → isolatedDeclarationsOxcTransformer-WbfE6cGu.js} +0 -0
- /package/dist/packem_shared/{isolatedDeclarationsSwcTransformer-Ch2AgtWC.mjs → isolatedDeclarationsSwcTransformer-Ch2AgtWC.js} +0 -0
- /package/dist/packem_shared/{isolatedDeclarationsTypescriptTransformer-DkuEkofo.mjs → isolatedDeclarationsTypescriptTransformer-DkuEkofo.js} +0 -0
- /package/dist/packem_shared/{metafilePlugin-CVcqFpPJ.mjs → metafilePlugin-CVcqFpPJ.js} +0 -0
- /package/dist/packem_shared/{oxcTransformPlugin-DfVQouIB.mjs → oxcTransformPlugin-DfVQouIB.js} +0 -0
- /package/dist/packem_shared/{resolveFileUrlPlugin-BkpjVHeK.mjs → resolveFileUrlPlugin-BkpjVHeK.js} +0 -0
- /package/dist/packem_shared/{resolveTypescriptMjsCtsPlugin-DcZrZTmM.mjs → resolveTypescriptMjsCtsPlugin-DcZrZTmM.js} +0 -0
- /package/dist/packem_shared/{swcPlugin-Boip4lWG.mjs → swcPlugin-Boip4lWG.js} +0 -0
- /package/dist/{packem_shared/esmShimCjsSyntaxPlugin-DjKqX4DE.mjs → plugins/esm-shim-cjs-syntax.js} +0 -0
- /package/dist/plugins/minify-html-literals/{index.mjs → index.js} +0 -0
- /package/dist/{packem_shared/nativeModulesPlugin-D6lO-8g6.mjs → plugins/native-modules-plugin.js} +0 -0
- /package/dist/{packem_shared/rawPlugin-DgRj14Xy.mjs → plugins/raw.js} +0 -0
- /package/dist/{packem_shared/makeExecutable-6aOVHoJR.mjs → plugins/shebang.js} +0 -0
- /package/dist/{packem_shared/sourcemapsPlugin-B4W3J79w.mjs → plugins/source-maps.js} +0 -0
- /package/dist/plugins/sucrase/{index.mjs → index.js} +0 -0
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import { FilterPattern } from '@rollup/pluginutils';
|
|
2
|
-
import { Plugin } from 'rollup';
|
|
3
|
-
import { SourceMapOptions } from 'magic-string';
|
|
4
|
-
import { MinifierOptions } from 'html-minifier-next';
|
|
5
|
-
|
|
6
|
-
type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
10
|
-
|
|
11
|
-
@category Type
|
|
12
|
-
*/
|
|
13
|
-
type Primitive =
|
|
14
|
-
| null
|
|
15
|
-
| undefined
|
|
16
|
-
| string
|
|
17
|
-
| number
|
|
18
|
-
| boolean
|
|
19
|
-
| symbol
|
|
20
|
-
| bigint;
|
|
21
|
-
|
|
22
|
-
declare global {
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
24
|
-
interface SymbolConstructor {
|
|
25
|
-
readonly observable: symbol;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
31
|
-
|
|
32
|
-
Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
|
|
33
|
-
|
|
34
|
-
This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
|
|
35
|
-
|
|
36
|
-
@example
|
|
37
|
-
```
|
|
38
|
-
import type {LiteralUnion} from 'type-fest';
|
|
39
|
-
|
|
40
|
-
// Before
|
|
41
|
-
|
|
42
|
-
type Pet = 'dog' | 'cat' | string;
|
|
43
|
-
|
|
44
|
-
const pet: Pet = '';
|
|
45
|
-
// Start typing in your TypeScript-enabled IDE.
|
|
46
|
-
// You **will not** get auto-completion for `dog` and `cat` literals.
|
|
47
|
-
|
|
48
|
-
// After
|
|
49
|
-
|
|
50
|
-
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
|
|
51
|
-
|
|
52
|
-
const pet: Pet2 = '';
|
|
53
|
-
// You **will** get auto-completion for `dog` and `cat` literals.
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
@category Type
|
|
57
|
-
*/
|
|
58
|
-
type LiteralUnion<
|
|
59
|
-
LiteralType,
|
|
60
|
-
BaseType extends Primitive,
|
|
61
|
-
> = LiteralType | (BaseType & Record<never, never>);
|
|
62
|
-
|
|
63
|
-
declare class InteractiveStreamHook {
|
|
64
|
-
#private;
|
|
65
|
-
static readonly DRAIN = true;
|
|
66
|
-
constructor(stream: NodeJS.WriteStream);
|
|
67
|
-
active(): void;
|
|
68
|
-
erase(count: number): void;
|
|
69
|
-
inactive(separateHistory?: boolean): void;
|
|
70
|
-
renew(): void;
|
|
71
|
-
write(message: string): void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
type StreamType = "stderr" | "stdout";
|
|
75
|
-
declare class InteractiveManager {
|
|
76
|
-
#private;
|
|
77
|
-
constructor(stdout: InteractiveStreamHook, stderr: InteractiveStreamHook);
|
|
78
|
-
get lastLength(): number;
|
|
79
|
-
get outside(): number;
|
|
80
|
-
get isHooked(): boolean;
|
|
81
|
-
get isSuspended(): boolean;
|
|
82
|
-
erase(stream: StreamType, count?: number): void;
|
|
83
|
-
hook(): boolean;
|
|
84
|
-
resume(stream: StreamType, eraseRowCount?: number): void;
|
|
85
|
-
suspend(stream: StreamType, erase?: boolean): void;
|
|
86
|
-
unhook(separateHistory?: boolean): boolean;
|
|
87
|
-
update(stream: StreamType, rows: string[], from?: number): void;
|
|
88
|
-
private _clear;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
declare global {
|
|
92
|
-
namespace VisulimaPail {
|
|
93
|
-
interface CustomMeta<L> {
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
interface Meta<L> extends VisulimaPail.CustomMeta<L> {
|
|
98
|
-
badge: string | undefined;
|
|
99
|
-
context: any[] | undefined;
|
|
100
|
-
date: Date | string;
|
|
101
|
-
error: Error | undefined;
|
|
102
|
-
groups: string[];
|
|
103
|
-
label: string | undefined;
|
|
104
|
-
message: Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;
|
|
105
|
-
prefix: string | undefined;
|
|
106
|
-
repeated?: number | undefined;
|
|
107
|
-
scope: string[] | undefined;
|
|
108
|
-
suffix: string | undefined;
|
|
109
|
-
traceError: Error | undefined;
|
|
110
|
-
type: {
|
|
111
|
-
level: ExtendedRfc5424LogLevels | L;
|
|
112
|
-
name: string;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
type ExtendedRfc5424LogLevels = "alert" | "critical" | "debug" | "emergency" | "error" | "informational" | "notice" | "trace" | "warning";
|
|
116
|
-
type DefaultLogTypes = "alert" | "await" | "complete" | "critical" | "debug" | "emergency" | "error" | "info" | "log" | "notice" | "pending" | "start" | "stop" | "success" | "trace" | "wait" | "warn" | "watch";
|
|
117
|
-
interface LoggerFunction {
|
|
118
|
-
(message: Message): void;
|
|
119
|
-
(...message: any[]): void;
|
|
120
|
-
}
|
|
121
|
-
interface LoggerConfiguration<L extends string> {
|
|
122
|
-
badge?: string;
|
|
123
|
-
color?: AnsiColors | undefined;
|
|
124
|
-
label: string;
|
|
125
|
-
logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
126
|
-
}
|
|
127
|
-
type LoggerTypesConfig<T extends string, L extends string> = Record<T, Partial<LoggerConfiguration<L>>>;
|
|
128
|
-
type ReadonlyMeta<L extends string> = Readonly<Meta<L>>;
|
|
129
|
-
interface Reporter<L extends string> {
|
|
130
|
-
log: (meta: ReadonlyMeta<L>) => void;
|
|
131
|
-
}
|
|
132
|
-
interface Processor<L extends string> {
|
|
133
|
-
process: (meta: Meta<L>) => Meta<L>;
|
|
134
|
-
}
|
|
135
|
-
interface ConstructorOptions<T extends string, L extends string> {
|
|
136
|
-
disabled?: boolean;
|
|
137
|
-
logLevel?: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
138
|
-
logLevels?: Partial<Record<ExtendedRfc5424LogLevels, number>> & Record<L, number>;
|
|
139
|
-
messages?: {
|
|
140
|
-
timerEnd?: string;
|
|
141
|
-
timerStart?: string;
|
|
142
|
-
};
|
|
143
|
-
processors?: Processor<L>[];
|
|
144
|
-
rawReporter?: Reporter<L>;
|
|
145
|
-
reporters?: Reporter<L>[];
|
|
146
|
-
scope?: string[] | string;
|
|
147
|
-
throttle?: number;
|
|
148
|
-
throttleMin?: number;
|
|
149
|
-
types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
|
|
150
|
-
}
|
|
151
|
-
interface ServerConstructorOptions<T extends string, L extends string> extends ConstructorOptions<T, L> {
|
|
152
|
-
interactive?: boolean;
|
|
153
|
-
stderr: NodeJS.WriteStream;
|
|
154
|
-
stdout: NodeJS.WriteStream;
|
|
155
|
-
}
|
|
156
|
-
type Message = {
|
|
157
|
-
context?: any[] | undefined;
|
|
158
|
-
message: any;
|
|
159
|
-
prefix?: string;
|
|
160
|
-
suffix?: string;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object)
|
|
164
|
-
|
|
165
|
-
interface StringifyOptions {
|
|
166
|
-
bigint?: boolean,
|
|
167
|
-
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
|
|
168
|
-
deterministic?: boolean | ((a: string, b: string) => number),
|
|
169
|
-
maximumBreadth?: number,
|
|
170
|
-
maximumDepth?: number,
|
|
171
|
-
strict?: boolean,
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
declare function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
|
|
175
|
-
declare function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
|
|
176
|
-
declare function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
|
|
177
|
-
|
|
178
|
-
declare namespace stringify {
|
|
179
|
-
export function configure(options: StringifyOptions): typeof stringify
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
declare class PailBrowserImpl<T extends string = string, L extends string = string> {
|
|
183
|
-
protected timersMap: Map<string, number>;
|
|
184
|
-
protected countMap: Map<string, number>;
|
|
185
|
-
protected seqTimers: Set<string>;
|
|
186
|
-
protected readonly lastLog: {
|
|
187
|
-
count?: number;
|
|
188
|
-
object?: Meta<L>;
|
|
189
|
-
serialized?: string;
|
|
190
|
-
time?: Date;
|
|
191
|
-
timeout?: ReturnType<typeof setTimeout>;
|
|
192
|
-
};
|
|
193
|
-
protected readonly logLevels: Record<string, number>;
|
|
194
|
-
protected disabled: boolean;
|
|
195
|
-
protected scopeName: string[];
|
|
196
|
-
protected readonly types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
|
|
197
|
-
protected readonly longestLabel: string;
|
|
198
|
-
protected readonly processors: Set<Processor<L>>;
|
|
199
|
-
protected readonly generalLogLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
200
|
-
protected reporters: Set<Reporter<L>>;
|
|
201
|
-
protected readonly throttle: number;
|
|
202
|
-
protected readonly throttleMin: number;
|
|
203
|
-
protected readonly stringify: typeof stringify;
|
|
204
|
-
protected groups: string[];
|
|
205
|
-
protected readonly startTimerMessage: string;
|
|
206
|
-
protected readonly endTimerMessage: string;
|
|
207
|
-
protected rawReporter: Reporter<L>;
|
|
208
|
-
constructor(options: ConstructorOptions<T, L>);
|
|
209
|
-
wrapConsole(): void;
|
|
210
|
-
restoreConsole(): void;
|
|
211
|
-
wrapException(): void;
|
|
212
|
-
disable(): void;
|
|
213
|
-
enable(): void;
|
|
214
|
-
isEnabled(): boolean;
|
|
215
|
-
scope<N extends string = T>(...name: string[]): PailBrowserType<N, L>;
|
|
216
|
-
unscope(): void;
|
|
217
|
-
time(label?: string): void;
|
|
218
|
-
timeLog(label?: string, ...data: unknown[]): void;
|
|
219
|
-
timeEnd(label?: string): void;
|
|
220
|
-
group(label?: string): void;
|
|
221
|
-
groupEnd(): void;
|
|
222
|
-
count(label?: string): void;
|
|
223
|
-
countReset(label?: string): void;
|
|
224
|
-
clear(): void;
|
|
225
|
-
raw(message: string, ...arguments_: unknown[]): void;
|
|
226
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
227
|
-
protected registerReporters(reporters: Reporter<L>[]): void;
|
|
228
|
-
private _report;
|
|
229
|
-
private registerProcessors;
|
|
230
|
-
private _normalizeLogLevel;
|
|
231
|
-
private _buildMeta;
|
|
232
|
-
private _logger;
|
|
233
|
-
}
|
|
234
|
-
type PailBrowserType<T extends string = string, L extends string = string> = PailBrowserImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);
|
|
235
|
-
|
|
236
|
-
declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
|
|
237
|
-
readonly options: ServerConstructorOptions<T, L>;
|
|
238
|
-
protected readonly stdout: NodeJS.WriteStream;
|
|
239
|
-
protected readonly stderr: NodeJS.WriteStream;
|
|
240
|
-
protected interactiveManager: InteractiveManager | undefined;
|
|
241
|
-
protected readonly interactive: boolean;
|
|
242
|
-
constructor(options: ServerConstructorOptions<T, L>);
|
|
243
|
-
scope<N extends string = T>(...name: string[]): PailServerType<N, L>;
|
|
244
|
-
getInteractiveManager(): InteractiveManager | undefined;
|
|
245
|
-
wrapStd(): void;
|
|
246
|
-
restoreStd(): void;
|
|
247
|
-
wrapAll(): void;
|
|
248
|
-
restoreAll(): void;
|
|
249
|
-
clear(): void;
|
|
250
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
251
|
-
private _wrapStream;
|
|
252
|
-
private _restoreStream;
|
|
253
|
-
}
|
|
254
|
-
type PailServerType<T extends string = string, L extends string = string> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
|
|
255
|
-
|
|
256
|
-
interface Template {
|
|
257
|
-
parts: TemplatePart[];
|
|
258
|
-
tag?: string;
|
|
259
|
-
}
|
|
260
|
-
interface TemplatePart {
|
|
261
|
-
end: number;
|
|
262
|
-
start: number;
|
|
263
|
-
text: string;
|
|
264
|
-
}
|
|
265
|
-
interface Strategy$1<N = unknown> {
|
|
266
|
-
getRootNode: (source: string, fileName?: string) => N;
|
|
267
|
-
getTaggedTemplateTemplate: (node: N) => unknown;
|
|
268
|
-
getTagText: (node: N) => string;
|
|
269
|
-
getTemplateParts: (node: N) => TemplatePart[];
|
|
270
|
-
isTaggedTemplate: (node: N) => boolean;
|
|
271
|
-
isTemplate: (node: N) => boolean;
|
|
272
|
-
walkNodes: (parent: N, visit: (child: N) => void) => void;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
interface ParseLiteralsOptions {
|
|
276
|
-
fileName?: string;
|
|
277
|
-
strategy?: Partial<Strategy$1<unknown>>;
|
|
278
|
-
}
|
|
279
|
-
declare const parseLiterals: (source: string, options?: ParseLiteralsOptions) => Template[];
|
|
280
|
-
|
|
281
|
-
interface Strategy<O = unknown, C = unknown> {
|
|
282
|
-
combineHTMLStrings: (parts: TemplatePart[], placeholder: string) => string;
|
|
283
|
-
getPlaceholder: (parts: TemplatePart[]) => string;
|
|
284
|
-
minifyCSS?: (css: string, options?: C) => string;
|
|
285
|
-
minifyHTML: (html: string, options?: O) => string | Promise<string>;
|
|
286
|
-
splitHTMLByPlaceholder: (html: string, placeholder: string) => string[];
|
|
287
|
-
}
|
|
288
|
-
declare const defaultMinifyOptions: MinifierOptions;
|
|
289
|
-
|
|
290
|
-
type Options = DefaultOptions | CustomOptions<unknown>;
|
|
291
|
-
interface DefaultOptions extends BaseOptions {
|
|
292
|
-
minifyOptions?: Partial<typeof defaultMinifyOptions>;
|
|
293
|
-
}
|
|
294
|
-
interface CustomOptions<S extends Strategy | unknown> extends BaseOptions {
|
|
295
|
-
minifyOptions?: S extends Strategy<infer O> ? Partial<O> : never;
|
|
296
|
-
strategy: S;
|
|
297
|
-
}
|
|
298
|
-
interface BaseOptions {
|
|
299
|
-
fileName?: string;
|
|
300
|
-
generateSourceMap?: ((ms: MagicStringLike, fileName: string) => SourceMap | undefined) | false;
|
|
301
|
-
MagicString?: new (source: string) => MagicStringLike;
|
|
302
|
-
parseLiterals?: typeof parseLiterals;
|
|
303
|
-
parseLiteralsOptions?: Partial<ParseLiteralsOptions>;
|
|
304
|
-
shouldMinify?: (template: Template) => boolean;
|
|
305
|
-
shouldMinifyCSS?: (template: Template) => boolean;
|
|
306
|
-
validate?: Validation | false;
|
|
307
|
-
}
|
|
308
|
-
interface MagicStringLike {
|
|
309
|
-
generateMap: (options?: Partial<SourceMapOptions>) => SourceMap;
|
|
310
|
-
overwrite: (start: number, end: number, content: string) => unknown;
|
|
311
|
-
toString: () => string;
|
|
312
|
-
}
|
|
313
|
-
interface SourceMap {
|
|
314
|
-
file?: string;
|
|
315
|
-
mappings: string;
|
|
316
|
-
names: string[];
|
|
317
|
-
sources: string[];
|
|
318
|
-
sourcesContent?: string[];
|
|
319
|
-
toString: () => string;
|
|
320
|
-
toUrl: () => string;
|
|
321
|
-
version: number;
|
|
322
|
-
}
|
|
323
|
-
interface Validation {
|
|
324
|
-
ensureHTMLPartsValid: (parts: TemplatePart[], htmlParts: string[]) => void;
|
|
325
|
-
ensurePlaceholderValid: (placeholder: unknown) => void;
|
|
326
|
-
}
|
|
327
|
-
interface Result {
|
|
328
|
-
code: string;
|
|
329
|
-
map: SourceMap | undefined;
|
|
330
|
-
}
|
|
331
|
-
declare function minifyHTMLLiterals(source: string, options?: DefaultOptions): Promise<Result | null>;
|
|
332
|
-
declare function minifyHTMLLiterals<S extends Strategy>(source: string, options?: CustomOptions<S>): Promise<Result | null>;
|
|
333
|
-
|
|
334
|
-
interface MinifyHTMLLiteralsOptions {
|
|
335
|
-
exclude?: FilterPattern;
|
|
336
|
-
failOnError?: boolean;
|
|
337
|
-
include?: FilterPattern;
|
|
338
|
-
minifyHTMLLiterals?: typeof minifyHTMLLiterals;
|
|
339
|
-
options?: Partial<Options>;
|
|
340
|
-
}
|
|
341
|
-
declare const minifyHTMLLiteralsPlugin: ({ exclude, failOnError, include, logger, minifyHTMLLiterals, options, }: MinifyHTMLLiteralsOptions & {
|
|
342
|
-
logger: PailServerType;
|
|
343
|
-
}) => Plugin;
|
|
344
|
-
|
|
345
|
-
export { minifyHTMLLiteralsPlugin as m };
|
|
346
|
-
export type { MinifyHTMLLiteralsOptions as M, PailServerType as P };
|
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import { FilterPattern } from '@rollup/pluginutils';
|
|
2
|
-
import { Plugin } from 'rollup';
|
|
3
|
-
import { SourceMapOptions } from 'magic-string';
|
|
4
|
-
import { MinifierOptions } from 'html-minifier-next';
|
|
5
|
-
|
|
6
|
-
type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
10
|
-
|
|
11
|
-
@category Type
|
|
12
|
-
*/
|
|
13
|
-
type Primitive =
|
|
14
|
-
| null
|
|
15
|
-
| undefined
|
|
16
|
-
| string
|
|
17
|
-
| number
|
|
18
|
-
| boolean
|
|
19
|
-
| symbol
|
|
20
|
-
| bigint;
|
|
21
|
-
|
|
22
|
-
declare global {
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
24
|
-
interface SymbolConstructor {
|
|
25
|
-
readonly observable: symbol;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
31
|
-
|
|
32
|
-
Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
|
|
33
|
-
|
|
34
|
-
This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
|
|
35
|
-
|
|
36
|
-
@example
|
|
37
|
-
```
|
|
38
|
-
import type {LiteralUnion} from 'type-fest';
|
|
39
|
-
|
|
40
|
-
// Before
|
|
41
|
-
|
|
42
|
-
type Pet = 'dog' | 'cat' | string;
|
|
43
|
-
|
|
44
|
-
const pet: Pet = '';
|
|
45
|
-
// Start typing in your TypeScript-enabled IDE.
|
|
46
|
-
// You **will not** get auto-completion for `dog` and `cat` literals.
|
|
47
|
-
|
|
48
|
-
// After
|
|
49
|
-
|
|
50
|
-
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
|
|
51
|
-
|
|
52
|
-
const pet: Pet2 = '';
|
|
53
|
-
// You **will** get auto-completion for `dog` and `cat` literals.
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
@category Type
|
|
57
|
-
*/
|
|
58
|
-
type LiteralUnion<
|
|
59
|
-
LiteralType,
|
|
60
|
-
BaseType extends Primitive,
|
|
61
|
-
> = LiteralType | (BaseType & Record<never, never>);
|
|
62
|
-
|
|
63
|
-
declare class InteractiveStreamHook {
|
|
64
|
-
#private;
|
|
65
|
-
static readonly DRAIN = true;
|
|
66
|
-
constructor(stream: NodeJS.WriteStream);
|
|
67
|
-
active(): void;
|
|
68
|
-
erase(count: number): void;
|
|
69
|
-
inactive(separateHistory?: boolean): void;
|
|
70
|
-
renew(): void;
|
|
71
|
-
write(message: string): void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
type StreamType = "stderr" | "stdout";
|
|
75
|
-
declare class InteractiveManager {
|
|
76
|
-
#private;
|
|
77
|
-
constructor(stdout: InteractiveStreamHook, stderr: InteractiveStreamHook);
|
|
78
|
-
get lastLength(): number;
|
|
79
|
-
get outside(): number;
|
|
80
|
-
get isHooked(): boolean;
|
|
81
|
-
get isSuspended(): boolean;
|
|
82
|
-
erase(stream: StreamType, count?: number): void;
|
|
83
|
-
hook(): boolean;
|
|
84
|
-
resume(stream: StreamType, eraseRowCount?: number): void;
|
|
85
|
-
suspend(stream: StreamType, erase?: boolean): void;
|
|
86
|
-
unhook(separateHistory?: boolean): boolean;
|
|
87
|
-
update(stream: StreamType, rows: string[], from?: number): void;
|
|
88
|
-
private _clear;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
declare global {
|
|
92
|
-
namespace VisulimaPail {
|
|
93
|
-
interface CustomMeta<L> {
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
interface Meta<L> extends VisulimaPail.CustomMeta<L> {
|
|
98
|
-
badge: string | undefined;
|
|
99
|
-
context: any[] | undefined;
|
|
100
|
-
date: Date | string;
|
|
101
|
-
error: Error | undefined;
|
|
102
|
-
groups: string[];
|
|
103
|
-
label: string | undefined;
|
|
104
|
-
message: Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;
|
|
105
|
-
prefix: string | undefined;
|
|
106
|
-
repeated?: number | undefined;
|
|
107
|
-
scope: string[] | undefined;
|
|
108
|
-
suffix: string | undefined;
|
|
109
|
-
traceError: Error | undefined;
|
|
110
|
-
type: {
|
|
111
|
-
level: ExtendedRfc5424LogLevels | L;
|
|
112
|
-
name: string;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
type ExtendedRfc5424LogLevels = "alert" | "critical" | "debug" | "emergency" | "error" | "informational" | "notice" | "trace" | "warning";
|
|
116
|
-
type DefaultLogTypes = "alert" | "await" | "complete" | "critical" | "debug" | "emergency" | "error" | "info" | "log" | "notice" | "pending" | "start" | "stop" | "success" | "trace" | "wait" | "warn" | "watch";
|
|
117
|
-
interface LoggerFunction {
|
|
118
|
-
(message: Message): void;
|
|
119
|
-
(...message: any[]): void;
|
|
120
|
-
}
|
|
121
|
-
interface LoggerConfiguration<L extends string> {
|
|
122
|
-
badge?: string;
|
|
123
|
-
color?: AnsiColors | undefined;
|
|
124
|
-
label: string;
|
|
125
|
-
logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
126
|
-
}
|
|
127
|
-
type LoggerTypesConfig<T extends string, L extends string> = Record<T, Partial<LoggerConfiguration<L>>>;
|
|
128
|
-
type ReadonlyMeta<L extends string> = Readonly<Meta<L>>;
|
|
129
|
-
interface Reporter<L extends string> {
|
|
130
|
-
log: (meta: ReadonlyMeta<L>) => void;
|
|
131
|
-
}
|
|
132
|
-
interface Processor<L extends string> {
|
|
133
|
-
process: (meta: Meta<L>) => Meta<L>;
|
|
134
|
-
}
|
|
135
|
-
interface ConstructorOptions<T extends string, L extends string> {
|
|
136
|
-
disabled?: boolean;
|
|
137
|
-
logLevel?: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
138
|
-
logLevels?: Partial<Record<ExtendedRfc5424LogLevels, number>> & Record<L, number>;
|
|
139
|
-
messages?: {
|
|
140
|
-
timerEnd?: string;
|
|
141
|
-
timerStart?: string;
|
|
142
|
-
};
|
|
143
|
-
processors?: Processor<L>[];
|
|
144
|
-
rawReporter?: Reporter<L>;
|
|
145
|
-
reporters?: Reporter<L>[];
|
|
146
|
-
scope?: string[] | string;
|
|
147
|
-
throttle?: number;
|
|
148
|
-
throttleMin?: number;
|
|
149
|
-
types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
|
|
150
|
-
}
|
|
151
|
-
interface ServerConstructorOptions<T extends string, L extends string> extends ConstructorOptions<T, L> {
|
|
152
|
-
interactive?: boolean;
|
|
153
|
-
stderr: NodeJS.WriteStream;
|
|
154
|
-
stdout: NodeJS.WriteStream;
|
|
155
|
-
}
|
|
156
|
-
type Message = {
|
|
157
|
-
context?: any[] | undefined;
|
|
158
|
-
message: any;
|
|
159
|
-
prefix?: string;
|
|
160
|
-
suffix?: string;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object)
|
|
164
|
-
|
|
165
|
-
interface StringifyOptions {
|
|
166
|
-
bigint?: boolean,
|
|
167
|
-
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
|
|
168
|
-
deterministic?: boolean | ((a: string, b: string) => number),
|
|
169
|
-
maximumBreadth?: number,
|
|
170
|
-
maximumDepth?: number,
|
|
171
|
-
strict?: boolean,
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
declare function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
|
|
175
|
-
declare function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
|
|
176
|
-
declare function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
|
|
177
|
-
|
|
178
|
-
declare namespace stringify {
|
|
179
|
-
export function configure(options: StringifyOptions): typeof stringify
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
declare class PailBrowserImpl<T extends string = string, L extends string = string> {
|
|
183
|
-
protected timersMap: Map<string, number>;
|
|
184
|
-
protected countMap: Map<string, number>;
|
|
185
|
-
protected seqTimers: Set<string>;
|
|
186
|
-
protected readonly lastLog: {
|
|
187
|
-
count?: number;
|
|
188
|
-
object?: Meta<L>;
|
|
189
|
-
serialized?: string;
|
|
190
|
-
time?: Date;
|
|
191
|
-
timeout?: ReturnType<typeof setTimeout>;
|
|
192
|
-
};
|
|
193
|
-
protected readonly logLevels: Record<string, number>;
|
|
194
|
-
protected disabled: boolean;
|
|
195
|
-
protected scopeName: string[];
|
|
196
|
-
protected readonly types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
|
|
197
|
-
protected readonly longestLabel: string;
|
|
198
|
-
protected readonly processors: Set<Processor<L>>;
|
|
199
|
-
protected readonly generalLogLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
200
|
-
protected reporters: Set<Reporter<L>>;
|
|
201
|
-
protected readonly throttle: number;
|
|
202
|
-
protected readonly throttleMin: number;
|
|
203
|
-
protected readonly stringify: typeof stringify;
|
|
204
|
-
protected groups: string[];
|
|
205
|
-
protected readonly startTimerMessage: string;
|
|
206
|
-
protected readonly endTimerMessage: string;
|
|
207
|
-
protected rawReporter: Reporter<L>;
|
|
208
|
-
constructor(options: ConstructorOptions<T, L>);
|
|
209
|
-
wrapConsole(): void;
|
|
210
|
-
restoreConsole(): void;
|
|
211
|
-
wrapException(): void;
|
|
212
|
-
disable(): void;
|
|
213
|
-
enable(): void;
|
|
214
|
-
isEnabled(): boolean;
|
|
215
|
-
scope<N extends string = T>(...name: string[]): PailBrowserType<N, L>;
|
|
216
|
-
unscope(): void;
|
|
217
|
-
time(label?: string): void;
|
|
218
|
-
timeLog(label?: string, ...data: unknown[]): void;
|
|
219
|
-
timeEnd(label?: string): void;
|
|
220
|
-
group(label?: string): void;
|
|
221
|
-
groupEnd(): void;
|
|
222
|
-
count(label?: string): void;
|
|
223
|
-
countReset(label?: string): void;
|
|
224
|
-
clear(): void;
|
|
225
|
-
raw(message: string, ...arguments_: unknown[]): void;
|
|
226
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
227
|
-
protected registerReporters(reporters: Reporter<L>[]): void;
|
|
228
|
-
private _report;
|
|
229
|
-
private registerProcessors;
|
|
230
|
-
private _normalizeLogLevel;
|
|
231
|
-
private _buildMeta;
|
|
232
|
-
private _logger;
|
|
233
|
-
}
|
|
234
|
-
type PailBrowserType<T extends string = string, L extends string = string> = PailBrowserImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);
|
|
235
|
-
|
|
236
|
-
declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
|
|
237
|
-
readonly options: ServerConstructorOptions<T, L>;
|
|
238
|
-
protected readonly stdout: NodeJS.WriteStream;
|
|
239
|
-
protected readonly stderr: NodeJS.WriteStream;
|
|
240
|
-
protected interactiveManager: InteractiveManager | undefined;
|
|
241
|
-
protected readonly interactive: boolean;
|
|
242
|
-
constructor(options: ServerConstructorOptions<T, L>);
|
|
243
|
-
scope<N extends string = T>(...name: string[]): PailServerType<N, L>;
|
|
244
|
-
getInteractiveManager(): InteractiveManager | undefined;
|
|
245
|
-
wrapStd(): void;
|
|
246
|
-
restoreStd(): void;
|
|
247
|
-
wrapAll(): void;
|
|
248
|
-
restoreAll(): void;
|
|
249
|
-
clear(): void;
|
|
250
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
251
|
-
private _wrapStream;
|
|
252
|
-
private _restoreStream;
|
|
253
|
-
}
|
|
254
|
-
type PailServerType<T extends string = string, L extends string = string> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
|
|
255
|
-
|
|
256
|
-
interface Template {
|
|
257
|
-
parts: TemplatePart[];
|
|
258
|
-
tag?: string;
|
|
259
|
-
}
|
|
260
|
-
interface TemplatePart {
|
|
261
|
-
end: number;
|
|
262
|
-
start: number;
|
|
263
|
-
text: string;
|
|
264
|
-
}
|
|
265
|
-
interface Strategy$1<N = unknown> {
|
|
266
|
-
getRootNode: (source: string, fileName?: string) => N;
|
|
267
|
-
getTaggedTemplateTemplate: (node: N) => unknown;
|
|
268
|
-
getTagText: (node: N) => string;
|
|
269
|
-
getTemplateParts: (node: N) => TemplatePart[];
|
|
270
|
-
isTaggedTemplate: (node: N) => boolean;
|
|
271
|
-
isTemplate: (node: N) => boolean;
|
|
272
|
-
walkNodes: (parent: N, visit: (child: N) => void) => void;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
interface ParseLiteralsOptions {
|
|
276
|
-
fileName?: string;
|
|
277
|
-
strategy?: Partial<Strategy$1<unknown>>;
|
|
278
|
-
}
|
|
279
|
-
declare const parseLiterals: (source: string, options?: ParseLiteralsOptions) => Template[];
|
|
280
|
-
|
|
281
|
-
interface Strategy<O = unknown, C = unknown> {
|
|
282
|
-
combineHTMLStrings: (parts: TemplatePart[], placeholder: string) => string;
|
|
283
|
-
getPlaceholder: (parts: TemplatePart[]) => string;
|
|
284
|
-
minifyCSS?: (css: string, options?: C) => string;
|
|
285
|
-
minifyHTML: (html: string, options?: O) => string | Promise<string>;
|
|
286
|
-
splitHTMLByPlaceholder: (html: string, placeholder: string) => string[];
|
|
287
|
-
}
|
|
288
|
-
declare const defaultMinifyOptions: MinifierOptions;
|
|
289
|
-
|
|
290
|
-
type Options = DefaultOptions | CustomOptions<unknown>;
|
|
291
|
-
interface DefaultOptions extends BaseOptions {
|
|
292
|
-
minifyOptions?: Partial<typeof defaultMinifyOptions>;
|
|
293
|
-
}
|
|
294
|
-
interface CustomOptions<S extends Strategy | unknown> extends BaseOptions {
|
|
295
|
-
minifyOptions?: S extends Strategy<infer O> ? Partial<O> : never;
|
|
296
|
-
strategy: S;
|
|
297
|
-
}
|
|
298
|
-
interface BaseOptions {
|
|
299
|
-
fileName?: string;
|
|
300
|
-
generateSourceMap?: ((ms: MagicStringLike, fileName: string) => SourceMap | undefined) | false;
|
|
301
|
-
MagicString?: new (source: string) => MagicStringLike;
|
|
302
|
-
parseLiterals?: typeof parseLiterals;
|
|
303
|
-
parseLiteralsOptions?: Partial<ParseLiteralsOptions>;
|
|
304
|
-
shouldMinify?: (template: Template) => boolean;
|
|
305
|
-
shouldMinifyCSS?: (template: Template) => boolean;
|
|
306
|
-
validate?: Validation | false;
|
|
307
|
-
}
|
|
308
|
-
interface MagicStringLike {
|
|
309
|
-
generateMap: (options?: Partial<SourceMapOptions>) => SourceMap;
|
|
310
|
-
overwrite: (start: number, end: number, content: string) => unknown;
|
|
311
|
-
toString: () => string;
|
|
312
|
-
}
|
|
313
|
-
interface SourceMap {
|
|
314
|
-
file?: string;
|
|
315
|
-
mappings: string;
|
|
316
|
-
names: string[];
|
|
317
|
-
sources: string[];
|
|
318
|
-
sourcesContent?: string[];
|
|
319
|
-
toString: () => string;
|
|
320
|
-
toUrl: () => string;
|
|
321
|
-
version: number;
|
|
322
|
-
}
|
|
323
|
-
interface Validation {
|
|
324
|
-
ensureHTMLPartsValid: (parts: TemplatePart[], htmlParts: string[]) => void;
|
|
325
|
-
ensurePlaceholderValid: (placeholder: unknown) => void;
|
|
326
|
-
}
|
|
327
|
-
interface Result {
|
|
328
|
-
code: string;
|
|
329
|
-
map: SourceMap | undefined;
|
|
330
|
-
}
|
|
331
|
-
declare function minifyHTMLLiterals(source: string, options?: DefaultOptions): Promise<Result | null>;
|
|
332
|
-
declare function minifyHTMLLiterals<S extends Strategy>(source: string, options?: CustomOptions<S>): Promise<Result | null>;
|
|
333
|
-
|
|
334
|
-
interface MinifyHTMLLiteralsOptions {
|
|
335
|
-
exclude?: FilterPattern;
|
|
336
|
-
failOnError?: boolean;
|
|
337
|
-
include?: FilterPattern;
|
|
338
|
-
minifyHTMLLiterals?: typeof minifyHTMLLiterals;
|
|
339
|
-
options?: Partial<Options>;
|
|
340
|
-
}
|
|
341
|
-
declare const minifyHTMLLiteralsPlugin: ({ exclude, failOnError, include, logger, minifyHTMLLiterals, options, }: MinifyHTMLLiteralsOptions & {
|
|
342
|
-
logger: PailServerType;
|
|
343
|
-
}) => Plugin;
|
|
344
|
-
|
|
345
|
-
export { minifyHTMLLiteralsPlugin as m };
|
|
346
|
-
export type { MinifyHTMLLiteralsOptions as M, PailServerType as P };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=Object.defineProperty;var o=(t,r)=>c(t,"name",{value:r,configurable:!0});import u from"@rollup/plugin-json";var i=Object.defineProperty,l=o((t,r)=>i(t,"name",{value:r,configurable:!0}),"n");const n="export default ",m=l(t=>{const r=u(t);return{...r,name:"packem:json",transform(a,s){const e=r.transform?.call(this,a,s);return e&&typeof e!="string"&&"code"in e&&e.code?.startsWith(n)&&(e.code=e.code.replace(n,"module.exports = ")),e}}},"JSONPlugin");export{m as default};
|