@staticbolt/core 1.0.0-beta.3 → 1.0.0-beta.4
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/lib/chunk-C7Uep-_p.mjs +20 -0
- package/lib/cli/index.mjs +1 -1
- package/lib/index.d.mts +298 -291
- package/lib/index.d.mts.map +1 -1
- package/lib/index.mjs +3 -3
- package/lib/index.mjs.map +1 -1
- package/lib/{logger-BuxMGhij.mjs → logger-BfIn1ytK.mjs} +29 -9
- package/lib/logger-BfIn1ytK.mjs.map +1 -0
- package/lib/plugins/index.mjs +23 -17
- package/lib/plugins/index.mjs.map +1 -1
- package/lib/{dependency-tracker-BuZfopIj.mjs → utilities-CZmLMi93.mjs} +45 -45
- package/lib/utilities-CZmLMi93.mjs.map +1 -0
- package/package.json +1 -1
- package/lib/dependency-tracker-BuZfopIj.mjs.map +0 -1
- package/lib/logger-BuxMGhij.mjs.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __exportAll = (all, no_symbols) => {
|
|
6
|
+
let target = {};
|
|
7
|
+
for (var name in all) {
|
|
8
|
+
__defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
if (!no_symbols) {
|
|
14
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
}
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { __exportAll as t };
|
package/lib/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --experimental-vm-modules --no-warnings
|
|
2
|
-
import {
|
|
2
|
+
import { c as join, g as CONFIG_FILE_NAME, h as resolve, o as isAbsolute, t as Log } from "../logger-BfIn1ytK.mjs";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
import { coerce, defineArguments, defineCLI, defineOptions, defineSubcommand } from "@staticbolt/args-parser";
|
package/lib/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { basename, extname, isAbsolute, parse, resolve } from "node:path";
|
|
1
|
+
import { basename, extname, isAbsolute, parse as parse$1, resolve } from "node:path";
|
|
2
2
|
import { Document, HTMLElement, HTMLElement as HTMLElement$1, Node } from "@staticbolt/node-html-parser";
|
|
3
3
|
import postcss, { Node as Node$1, Postcss } from "postcss";
|
|
4
4
|
import { NodePath as NodePath$1 } from "@babel/traverse";
|
|
@@ -1069,6 +1069,199 @@ interface AppConfig {
|
|
|
1069
1069
|
browserslist?: string[];
|
|
1070
1070
|
}
|
|
1071
1071
|
//#endregion
|
|
1072
|
+
//#region src/cli/cli.d.ts
|
|
1073
|
+
declare class CliProgram {
|
|
1074
|
+
#private;
|
|
1075
|
+
program: {
|
|
1076
|
+
cliName: "staticbolt";
|
|
1077
|
+
meta: {
|
|
1078
|
+
description: string;
|
|
1079
|
+
example: string;
|
|
1080
|
+
};
|
|
1081
|
+
options: {
|
|
1082
|
+
help: {
|
|
1083
|
+
aliases: string[];
|
|
1084
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1085
|
+
coerce: {
|
|
1086
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1087
|
+
type: string;
|
|
1088
|
+
};
|
|
1089
|
+
meta: {
|
|
1090
|
+
description: string;
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
version: {
|
|
1094
|
+
aliases: string[];
|
|
1095
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1096
|
+
coerce: {
|
|
1097
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1098
|
+
type: string;
|
|
1099
|
+
};
|
|
1100
|
+
meta: {
|
|
1101
|
+
description: string;
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
};
|
|
1105
|
+
onExecute: (handler: (data: {
|
|
1106
|
+
subcommand: undefined;
|
|
1107
|
+
options: {
|
|
1108
|
+
help?: boolean | undefined;
|
|
1109
|
+
version?: boolean | undefined;
|
|
1110
|
+
};
|
|
1111
|
+
arguments: never;
|
|
1112
|
+
positionals: never;
|
|
1113
|
+
context: {
|
|
1114
|
+
subcommand: undefined;
|
|
1115
|
+
options: {
|
|
1116
|
+
help: _$_staticbolt_args_parser0.OptionContext<z.ZodOptional<z.ZodBoolean>>;
|
|
1117
|
+
version: _$_staticbolt_args_parser0.OptionContext<z.ZodOptional<z.ZodBoolean>>;
|
|
1118
|
+
};
|
|
1119
|
+
arguments: never;
|
|
1120
|
+
positionals: never;
|
|
1121
|
+
};
|
|
1122
|
+
}) => void) => () => void;
|
|
1123
|
+
execute: (input?: {
|
|
1124
|
+
options?: {
|
|
1125
|
+
help?: boolean | undefined;
|
|
1126
|
+
version?: boolean | undefined;
|
|
1127
|
+
} | undefined;
|
|
1128
|
+
arguments?: undefined;
|
|
1129
|
+
positionals?: undefined;
|
|
1130
|
+
} | undefined) => void;
|
|
1131
|
+
executeAsync: (input?: {
|
|
1132
|
+
options?: {
|
|
1133
|
+
help?: boolean | undefined;
|
|
1134
|
+
version?: boolean | undefined;
|
|
1135
|
+
} | undefined;
|
|
1136
|
+
arguments?: undefined;
|
|
1137
|
+
positionals?: undefined;
|
|
1138
|
+
} | undefined) => Promise<void>;
|
|
1139
|
+
generateCliHelpMessage?: ((options?: _$_staticbolt_args_parser0.PrintHelpOptions) => string) | undefined;
|
|
1140
|
+
generateSubcommandHelpMessage?: ((subcommandName: string & {}, options?: _$_staticbolt_args_parser0.PrintHelpOptions) => string) | undefined;
|
|
1141
|
+
run: (input: string | string[]) => _$_staticbolt_args_parser0.CliParseResult<{
|
|
1142
|
+
cliName: "staticbolt";
|
|
1143
|
+
meta: {
|
|
1144
|
+
description: string;
|
|
1145
|
+
example: string;
|
|
1146
|
+
};
|
|
1147
|
+
options: {
|
|
1148
|
+
help: {
|
|
1149
|
+
aliases: string[];
|
|
1150
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1151
|
+
coerce: {
|
|
1152
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1153
|
+
type: string;
|
|
1154
|
+
};
|
|
1155
|
+
meta: {
|
|
1156
|
+
description: string;
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
version: {
|
|
1160
|
+
aliases: string[];
|
|
1161
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1162
|
+
coerce: {
|
|
1163
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1164
|
+
type: string;
|
|
1165
|
+
};
|
|
1166
|
+
meta: {
|
|
1167
|
+
description: string;
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
};
|
|
1171
|
+
}>;
|
|
1172
|
+
runAsync: (input: string | string[]) => Promise<_$_staticbolt_args_parser0.CliParseResult<{
|
|
1173
|
+
cliName: "staticbolt";
|
|
1174
|
+
meta: {
|
|
1175
|
+
description: string;
|
|
1176
|
+
example: string;
|
|
1177
|
+
};
|
|
1178
|
+
options: {
|
|
1179
|
+
help: {
|
|
1180
|
+
aliases: string[];
|
|
1181
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1182
|
+
coerce: {
|
|
1183
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1184
|
+
type: string;
|
|
1185
|
+
};
|
|
1186
|
+
meta: {
|
|
1187
|
+
description: string;
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
version: {
|
|
1191
|
+
aliases: string[];
|
|
1192
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1193
|
+
coerce: {
|
|
1194
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1195
|
+
type: string;
|
|
1196
|
+
};
|
|
1197
|
+
meta: {
|
|
1198
|
+
description: string;
|
|
1199
|
+
};
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1202
|
+
}>>;
|
|
1203
|
+
};
|
|
1204
|
+
constructor();
|
|
1205
|
+
initializePlugins(config: AppConfig$1, configPath: string): Promise<void>;
|
|
1206
|
+
static init(config: AppConfig$1, configPath: string): Promise<CliProgram>;
|
|
1207
|
+
run(cliArguments: string[]): _$_staticbolt_args_parser0.CliParseResult<{
|
|
1208
|
+
cliName: "staticbolt";
|
|
1209
|
+
meta: {
|
|
1210
|
+
description: string;
|
|
1211
|
+
example: string;
|
|
1212
|
+
};
|
|
1213
|
+
options: {
|
|
1214
|
+
help: {
|
|
1215
|
+
aliases: string[];
|
|
1216
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1217
|
+
coerce: {
|
|
1218
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1219
|
+
type: string;
|
|
1220
|
+
};
|
|
1221
|
+
meta: {
|
|
1222
|
+
description: string;
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
version: {
|
|
1226
|
+
aliases: string[];
|
|
1227
|
+
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1228
|
+
coerce: {
|
|
1229
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1230
|
+
type: string;
|
|
1231
|
+
};
|
|
1232
|
+
meta: {
|
|
1233
|
+
description: string;
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1236
|
+
};
|
|
1237
|
+
}>;
|
|
1238
|
+
readonly defineSubcommand: typeof defineSubcommand;
|
|
1239
|
+
readonly defineOptions: typeof defineOptions;
|
|
1240
|
+
readonly defineArguments: typeof defineArguments;
|
|
1241
|
+
readonly coerce: {
|
|
1242
|
+
string: <T extends string | undefined>(terminalInput: string) => T;
|
|
1243
|
+
boolean: {
|
|
1244
|
+
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1245
|
+
type: string;
|
|
1246
|
+
};
|
|
1247
|
+
number: <T extends number | undefined>(terminalInput: string) => T;
|
|
1248
|
+
bigint: <T extends bigint | undefined>(terminalInput: string) => T;
|
|
1249
|
+
object: (options?: _$_staticbolt_args_parser0.ObjectCoerceMethodOptions) => <T extends Record<string, unknown> | undefined>(terminalInput: string) => T;
|
|
1250
|
+
stringArray: (separator: string) => <T extends string[] | undefined>(terminalInput: string) => T;
|
|
1251
|
+
numberArray: (separator: string) => <T extends number[] | undefined>(terminalInput: string) => T;
|
|
1252
|
+
booleanArray: (separator: string) => <T extends boolean[] | undefined>(terminalInput: string) => T;
|
|
1253
|
+
stringSet: (separator: string) => <T extends Set<string> | undefined>(terminalInput: string) => T;
|
|
1254
|
+
numberSet: (separator: string) => <T extends Set<number> | undefined>(terminalInput: string) => T;
|
|
1255
|
+
booleanSet: (separator: string) => <T extends Set<boolean> | undefined>(terminalInput: string) => T;
|
|
1256
|
+
json: <T>(terminalInput: string) => T;
|
|
1257
|
+
};
|
|
1258
|
+
addCommand(newSubcommand: Subcommand): number | undefined;
|
|
1259
|
+
addOptions(newOptions: Record<string, Option>): (Record<string, Option<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Option>) | undefined;
|
|
1260
|
+
addArguments(newArguments: Record<string, Argument>): (Record<string, Argument<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Argument>) | undefined;
|
|
1261
|
+
addOptionsToCommand(commandName: string, newOptions: Record<string, Option>): (Record<string, Option<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Option>) | undefined;
|
|
1262
|
+
addArgumentsToCommand(commandName: string, newArguments: Record<string, Argument>): (Record<string, Argument<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Argument>) | undefined;
|
|
1263
|
+
}
|
|
1264
|
+
//#endregion
|
|
1072
1265
|
//#region src/resolver/resolver.d.ts
|
|
1073
1266
|
type ResolveResult$1 = {
|
|
1074
1267
|
path: string;
|
|
@@ -1178,50 +1371,6 @@ declare class App {
|
|
|
1178
1371
|
filterMetadata<T extends MetadataBase$1>(metadataFilter: Partial<T>): T[];
|
|
1179
1372
|
}
|
|
1180
1373
|
//#endregion
|
|
1181
|
-
//#region src/types/plugin.d.ts
|
|
1182
|
-
type FastifyHandlerParameters = Parameters<onRequestHookHandler>;
|
|
1183
|
-
type ServerReply = FastifyHandlerParameters[1];
|
|
1184
|
-
type ServerRequest = FastifyHandlerParameters[0];
|
|
1185
|
-
interface MetadataSource {
|
|
1186
|
-
get source(): string;
|
|
1187
|
-
set source(value: string);
|
|
1188
|
-
node?: HTMLElement$1 | NodePath$1 | Postcss["AtRule"] | Postcss["Declaration"] | ImageResource | object;
|
|
1189
|
-
}
|
|
1190
|
-
interface ResolveResult {
|
|
1191
|
-
source: string;
|
|
1192
|
-
dependencyID?: string;
|
|
1193
|
-
}
|
|
1194
|
-
interface Plugin {
|
|
1195
|
-
name: string;
|
|
1196
|
-
setup?: (this: App$1) => void | Promise<void>;
|
|
1197
|
-
read?: (this: App$1, absolutePath: string) => string | void | Promise<string | void>;
|
|
1198
|
-
load?: (this: App$1, content: string, relativePath: string, options: {
|
|
1199
|
-
type?: string;
|
|
1200
|
-
}) => MetadataBase$1 | null | void | Promise<MetadataBase$1 | null | void>;
|
|
1201
|
-
resolveSource?: (this: App$1, source: string, filePath: string, parentMetadata: MetadataBase$1) => ResolveResult | void | Promise<ResolveResult | void>;
|
|
1202
|
-
transformSource?: (this: App$1, source: string, filePath: string, parentMetadata: MetadataBase$1) => string | void | Promise<string | void>;
|
|
1203
|
-
preTransform?: (this: App$1) => void | Promise<void>;
|
|
1204
|
-
transform?: (this: App$1, metadata: MetadataBase$1) => void | Promise<void>;
|
|
1205
|
-
postTransform?: (this: App$1) => void | Promise<void>;
|
|
1206
|
-
write?: (this: App$1, metadata: MetadataBase$1) => void | Promise<void>;
|
|
1207
|
-
postBuild?: (this: App$1) => void | Promise<void>;
|
|
1208
|
-
clone?: (this: App$1, metadata: MetadataBase$1) => void | MetadataBase$1;
|
|
1209
|
-
stringify?: (this: App$1, metadata: MetadataBase$1, options: {
|
|
1210
|
-
minify?: boolean;
|
|
1211
|
-
format?: boolean;
|
|
1212
|
-
}) => void | string | Promise<string | void>;
|
|
1213
|
-
sourcesProvider?: (this: App$1, metadata: MetadataBase$1) => MetadataSource[] | void | Promise<MetadataSource[] | void>;
|
|
1214
|
-
rebaseSource?: (this: App$1, source: string, filePath: string, newAbsolutePath: string) => string | void | Promise<string | void>;
|
|
1215
|
-
onMetadataRebase?: (this: App$1, metadata: MetadataBase$1, oldAbsolutePath: string, newAbsolutePath: string) => void | Promise<void>;
|
|
1216
|
-
handleRequest?: (this: App$1, requestPath: string, reply: ServerReply, request: ServerRequest) => boolean | void | Promise<boolean | void>;
|
|
1217
|
-
resolveRequestPath?: (this: App$1, requestPath: string) => string | void | Promise<string | void>;
|
|
1218
|
-
onFileEvent?: (this: App$1, event: "change" | "add" | "unlink", filePath: string) => void | Promise<void>;
|
|
1219
|
-
resolveCompileList?: (this: App$1, compileSet: Set<string>, event: "change" | "add" | "unlink", filePath: string) => void | Promise<void>;
|
|
1220
|
-
cli?: (this: CliProgram$1, config: AppConfig$1, configPath: string) => void | Promise<void>;
|
|
1221
|
-
}
|
|
1222
|
-
type RemoveThis<T> = Required<{ [K in keyof T]: T[K] extends ((this: App$1, ...arguments_: infer A) => infer R) | undefined ? (...arguments_: A) => R : T[K] }>;
|
|
1223
|
-
type BoundPlugin = RemoveThis<Plugin>;
|
|
1224
|
-
//#endregion
|
|
1225
1374
|
//#region src/types/metadata.d.ts
|
|
1226
1375
|
declare const METADATA_TYPES: Readonly<{
|
|
1227
1376
|
Script: "Script";
|
|
@@ -1326,200 +1475,105 @@ interface BinaryAssetMetadata extends MetadataBase {
|
|
|
1326
1475
|
data?: Uint8Array;
|
|
1327
1476
|
}
|
|
1328
1477
|
//#endregion
|
|
1329
|
-
//#region src/
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
options?: {
|
|
1390
|
-
help?: boolean | undefined;
|
|
1391
|
-
version?: boolean | undefined;
|
|
1392
|
-
} | undefined;
|
|
1393
|
-
arguments?: undefined;
|
|
1394
|
-
positionals?: undefined;
|
|
1395
|
-
} | undefined) => Promise<void>;
|
|
1396
|
-
generateCliHelpMessage?: ((options?: _$_staticbolt_args_parser0.PrintHelpOptions) => string) | undefined;
|
|
1397
|
-
generateSubcommandHelpMessage?: ((subcommandName: string & {}, options?: _$_staticbolt_args_parser0.PrintHelpOptions) => string) | undefined;
|
|
1398
|
-
run: (input: string | string[]) => _$_staticbolt_args_parser0.CliParseResult<{
|
|
1399
|
-
cliName: "staticbolt";
|
|
1400
|
-
meta: {
|
|
1401
|
-
description: string;
|
|
1402
|
-
example: string;
|
|
1403
|
-
};
|
|
1404
|
-
options: {
|
|
1405
|
-
help: {
|
|
1406
|
-
aliases: string[];
|
|
1407
|
-
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1408
|
-
coerce: {
|
|
1409
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1410
|
-
type: string;
|
|
1411
|
-
};
|
|
1412
|
-
meta: {
|
|
1413
|
-
description: string;
|
|
1414
|
-
};
|
|
1415
|
-
};
|
|
1416
|
-
version: {
|
|
1417
|
-
aliases: string[];
|
|
1418
|
-
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1419
|
-
coerce: {
|
|
1420
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1421
|
-
type: string;
|
|
1422
|
-
};
|
|
1423
|
-
meta: {
|
|
1424
|
-
description: string;
|
|
1425
|
-
};
|
|
1426
|
-
};
|
|
1427
|
-
};
|
|
1428
|
-
}>;
|
|
1429
|
-
runAsync: (input: string | string[]) => Promise<_$_staticbolt_args_parser0.CliParseResult<{
|
|
1430
|
-
cliName: "staticbolt";
|
|
1431
|
-
meta: {
|
|
1432
|
-
description: string;
|
|
1433
|
-
example: string;
|
|
1434
|
-
};
|
|
1435
|
-
options: {
|
|
1436
|
-
help: {
|
|
1437
|
-
aliases: string[];
|
|
1438
|
-
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1439
|
-
coerce: {
|
|
1440
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1441
|
-
type: string;
|
|
1442
|
-
};
|
|
1443
|
-
meta: {
|
|
1444
|
-
description: string;
|
|
1445
|
-
};
|
|
1446
|
-
};
|
|
1447
|
-
version: {
|
|
1448
|
-
aliases: string[];
|
|
1449
|
-
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1450
|
-
coerce: {
|
|
1451
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1452
|
-
type: string;
|
|
1453
|
-
};
|
|
1454
|
-
meta: {
|
|
1455
|
-
description: string;
|
|
1456
|
-
};
|
|
1457
|
-
};
|
|
1458
|
-
};
|
|
1459
|
-
}>>;
|
|
1460
|
-
};
|
|
1461
|
-
constructor();
|
|
1462
|
-
initializePlugins(config: AppConfig$1, configPath: string): Promise<void>;
|
|
1463
|
-
static init(config: AppConfig$1, configPath: string): Promise<CliProgram>;
|
|
1464
|
-
run(cliArguments: string[]): _$_staticbolt_args_parser0.CliParseResult<{
|
|
1465
|
-
cliName: "staticbolt";
|
|
1466
|
-
meta: {
|
|
1467
|
-
description: string;
|
|
1468
|
-
example: string;
|
|
1469
|
-
};
|
|
1470
|
-
options: {
|
|
1471
|
-
help: {
|
|
1472
|
-
aliases: string[];
|
|
1473
|
-
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1474
|
-
coerce: {
|
|
1475
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1476
|
-
type: string;
|
|
1477
|
-
};
|
|
1478
|
-
meta: {
|
|
1479
|
-
description: string;
|
|
1480
|
-
};
|
|
1481
|
-
};
|
|
1482
|
-
version: {
|
|
1483
|
-
aliases: string[];
|
|
1484
|
-
schema: z.ZodOptional<z.ZodBoolean>;
|
|
1485
|
-
coerce: {
|
|
1486
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1487
|
-
type: string;
|
|
1488
|
-
};
|
|
1489
|
-
meta: {
|
|
1490
|
-
description: string;
|
|
1491
|
-
};
|
|
1492
|
-
};
|
|
1493
|
-
};
|
|
1494
|
-
}>;
|
|
1495
|
-
readonly defineSubcommand: typeof defineSubcommand;
|
|
1496
|
-
readonly defineOptions: typeof defineOptions;
|
|
1497
|
-
readonly defineArguments: typeof defineArguments;
|
|
1498
|
-
readonly coerce: {
|
|
1499
|
-
string: <T extends string | undefined>(terminalInput: string) => T;
|
|
1500
|
-
boolean: {
|
|
1501
|
-
<T extends boolean | undefined>(terminalInput: string): T;
|
|
1502
|
-
type: string;
|
|
1503
|
-
};
|
|
1504
|
-
number: <T extends number | undefined>(terminalInput: string) => T;
|
|
1505
|
-
bigint: <T extends bigint | undefined>(terminalInput: string) => T;
|
|
1506
|
-
object: (options?: _$_staticbolt_args_parser0.ObjectCoerceMethodOptions) => <T extends Record<string, unknown> | undefined>(terminalInput: string) => T;
|
|
1507
|
-
stringArray: (separator: string) => <T extends string[] | undefined>(terminalInput: string) => T;
|
|
1508
|
-
numberArray: (separator: string) => <T extends number[] | undefined>(terminalInput: string) => T;
|
|
1509
|
-
booleanArray: (separator: string) => <T extends boolean[] | undefined>(terminalInput: string) => T;
|
|
1510
|
-
stringSet: (separator: string) => <T extends Set<string> | undefined>(terminalInput: string) => T;
|
|
1511
|
-
numberSet: (separator: string) => <T extends Set<number> | undefined>(terminalInput: string) => T;
|
|
1512
|
-
booleanSet: (separator: string) => <T extends Set<boolean> | undefined>(terminalInput: string) => T;
|
|
1513
|
-
json: <T>(terminalInput: string) => T;
|
|
1514
|
-
};
|
|
1515
|
-
addCommand(newSubcommand: Subcommand): number | undefined;
|
|
1516
|
-
addOptions(newOptions: Record<string, Option>): (Record<string, Option<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Option>) | undefined;
|
|
1517
|
-
addArguments(newArguments: Record<string, Argument>): (Record<string, Argument<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Argument>) | undefined;
|
|
1518
|
-
addOptionsToCommand(commandName: string, newOptions: Record<string, Option>): (Record<string, Option<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Option>) | undefined;
|
|
1519
|
-
addArgumentsToCommand(commandName: string, newArguments: Record<string, Argument>): (Record<string, Argument<_$_staticbolt_args_parser0.SchemaType<unknown>>> & Record<string, Argument>) | undefined;
|
|
1478
|
+
//#region src/types/plugin.d.ts
|
|
1479
|
+
type FastifyHandlerParameters = Parameters<onRequestHookHandler>;
|
|
1480
|
+
type ServerReply = FastifyHandlerParameters[1];
|
|
1481
|
+
type ServerRequest = FastifyHandlerParameters[0];
|
|
1482
|
+
interface MetadataSource {
|
|
1483
|
+
get source(): string;
|
|
1484
|
+
set source(value: string);
|
|
1485
|
+
node?: HTMLElement$1 | NodePath$1 | Postcss["AtRule"] | Postcss["Declaration"] | ImageResource | object;
|
|
1486
|
+
}
|
|
1487
|
+
interface ResolveResult {
|
|
1488
|
+
source: string;
|
|
1489
|
+
dependencyID?: string;
|
|
1490
|
+
}
|
|
1491
|
+
interface Plugin {
|
|
1492
|
+
name: string;
|
|
1493
|
+
setup?: (this: App$1) => void | Promise<void>;
|
|
1494
|
+
read?: (this: App$1, absolutePath: string) => string | void | Promise<string | void>;
|
|
1495
|
+
load?: (this: App$1, content: string, relativePath: string, options: {
|
|
1496
|
+
type?: string;
|
|
1497
|
+
}) => MetadataBase$1 | null | void | Promise<MetadataBase$1 | null | void>;
|
|
1498
|
+
resolveSource?: (this: App$1, source: string, filePath: string, parentMetadata: MetadataBase$1) => ResolveResult | void | Promise<ResolveResult | void>;
|
|
1499
|
+
transformSource?: (this: App$1, source: string, filePath: string, parentMetadata: MetadataBase$1) => string | void | Promise<string | void>;
|
|
1500
|
+
preTransform?: (this: App$1) => void | Promise<void>;
|
|
1501
|
+
transform?: (this: App$1, metadata: MetadataBase$1) => void | Promise<void>;
|
|
1502
|
+
postTransform?: (this: App$1) => void | Promise<void>;
|
|
1503
|
+
write?: (this: App$1, metadata: MetadataBase$1) => void | Promise<void>;
|
|
1504
|
+
postBuild?: (this: App$1) => void | Promise<void>;
|
|
1505
|
+
clone?: (this: App$1, metadata: MetadataBase$1) => void | MetadataBase$1;
|
|
1506
|
+
stringify?: (this: App$1, metadata: MetadataBase$1, options: {
|
|
1507
|
+
minify?: boolean;
|
|
1508
|
+
format?: boolean;
|
|
1509
|
+
}) => void | string | Promise<string | void>;
|
|
1510
|
+
sourcesProvider?: (this: App$1, metadata: MetadataBase$1) => MetadataSource[] | void | Promise<MetadataSource[] | void>;
|
|
1511
|
+
rebaseSource?: (this: App$1, source: string, filePath: string, newAbsolutePath: string) => string | void | Promise<string | void>;
|
|
1512
|
+
onMetadataRebase?: (this: App$1, metadata: MetadataBase$1, oldAbsolutePath: string, newAbsolutePath: string) => void | Promise<void>;
|
|
1513
|
+
handleRequest?: (this: App$1, requestPath: string, reply: ServerReply, request: ServerRequest) => boolean | void | Promise<boolean | void>;
|
|
1514
|
+
resolveRequestPath?: (this: App$1, requestPath: string) => string | void | Promise<string | void>;
|
|
1515
|
+
onFileEvent?: (this: App$1, event: "change" | "add" | "unlink", filePath: string) => void | Promise<void>;
|
|
1516
|
+
resolveCompileList?: (this: App$1, compileSet: Set<string>, event: "change" | "add" | "unlink", filePath: string) => void | Promise<void>;
|
|
1517
|
+
cli?: (this: CliProgram$1, config: AppConfig$1, configPath: string) => void | Promise<void>;
|
|
1518
|
+
}
|
|
1519
|
+
type RemoveThis<T> = Required<{ [K in keyof T]: T[K] extends ((this: App$1, ...arguments_: infer A) => infer R) | undefined ? (...arguments_: A) => R : T[K] }>;
|
|
1520
|
+
type BoundPlugin = RemoveThis<Plugin>;
|
|
1521
|
+
//#endregion
|
|
1522
|
+
//#region src/helpers/dependency-tracker.d.ts
|
|
1523
|
+
/**
|
|
1524
|
+
* Tracks bidirectional dependencies between importers and their sources.\
|
|
1525
|
+
* Handles reconciliation when dependencies change, so stale entries are automatically removed when an importer stops referencing
|
|
1526
|
+
* a source.
|
|
1527
|
+
*/
|
|
1528
|
+
declare class DependencyTracker {
|
|
1529
|
+
#private;
|
|
1530
|
+
/** Updates the full set of sources for a given importer, reconciling any stale entries from previous calls. */
|
|
1531
|
+
update(importer: string, sources: Iterable<string>): void;
|
|
1532
|
+
/** Deletes all dependency data for a given id, whether it's acting as an importer, a source, or both (e.g. on file unlink). */
|
|
1533
|
+
delete(id: string): void;
|
|
1534
|
+
/** Returns all importers that depend on a given source, or an empty set. */
|
|
1535
|
+
getImporters(source: string): ReadonlySet<string>;
|
|
1536
|
+
/** Returns all sources that a given importer depends on, or an empty set. */
|
|
1537
|
+
getSources(importer: string): ReadonlySet<string>;
|
|
1520
1538
|
}
|
|
1521
1539
|
//#endregion
|
|
1522
|
-
//#region src/utilities/
|
|
1540
|
+
//#region src/utilities/metadata-utilities.d.ts
|
|
1541
|
+
declare function isScriptMetadata(metadata: MetadataBase$1 | undefined): metadata is ScriptMetadata$1;
|
|
1542
|
+
declare function isPackageMetadata(metadata: MetadataBase$1 | undefined): metadata is PackageMetadata$1;
|
|
1543
|
+
declare function isHtmlMetadata(metadata: MetadataBase$1 | undefined): metadata is HtmlMetadata$1;
|
|
1544
|
+
declare function isStyleMetadata(metadata: MetadataBase$1 | undefined): metadata is StyleMetadata$1;
|
|
1545
|
+
declare function isSvgMetadata(metadata: MetadataBase$1 | undefined): metadata is SvgMetadata$1;
|
|
1546
|
+
declare function isMarkdownMetadata(metadata: MetadataBase$1 | undefined): metadata is MarkdownMetadata$1;
|
|
1547
|
+
declare function isTextAssetMetadata(metadata: MetadataBase$1 | undefined): metadata is TextAssetMetadata$1;
|
|
1548
|
+
declare function isBinaryAssetMetadata(metadata: MetadataBase$1 | undefined): metadata is BinaryAssetMetadata$1;
|
|
1549
|
+
declare function isWebManifestMetadata(metadata: MetadataBase$1): metadata is WebManifestMetadata$1;
|
|
1550
|
+
/**
|
|
1551
|
+
* Returns script-related metadata entries.
|
|
1552
|
+
*
|
|
1553
|
+
* - If the input is ScriptMetadata, it returns it directly.
|
|
1554
|
+
* - If the input is HtmlMetadata, it scans <script> tags in the AST and resolves their associated ScriptMetadata using the metadata
|
|
1555
|
+
* ID attribute.
|
|
1556
|
+
*/
|
|
1557
|
+
declare function filterScriptMetadata(metadata: MetadataBase$1): {
|
|
1558
|
+
metadata: ScriptMetadata$1;
|
|
1559
|
+
tag?: HTMLElement$2;
|
|
1560
|
+
htmlMetadata?: HtmlMetadata$1;
|
|
1561
|
+
}[];
|
|
1562
|
+
/**
|
|
1563
|
+
* Returns style-related metadata entries.
|
|
1564
|
+
*
|
|
1565
|
+
* - If the input is StyleMetadata, it returns it directly.
|
|
1566
|
+
* - If the input is HtmlMetadata, it scans <style> tags in the AST and resolves their associated StyleMetadata using the metadata
|
|
1567
|
+
* ID attribute.
|
|
1568
|
+
*/
|
|
1569
|
+
declare function filterStyleMetadata(metadata: MetadataBase$1): {
|
|
1570
|
+
metadata: StyleMetadata$1;
|
|
1571
|
+
tag?: HTMLElement$2;
|
|
1572
|
+
htmlMetadata?: HtmlMetadata$1;
|
|
1573
|
+
}[];
|
|
1574
|
+
declare namespace path_d_exports {
|
|
1575
|
+
export { appendForwardSlash, basename, dirname, extname, firstPart, isAbsolute, isSubpath, join, matchPath, normalize, parse$1 as parse, rebaseRelativePath, relative, replaceExtension, resolve, sourceRelativeToRoot, trimDotPrefix };
|
|
1576
|
+
}
|
|
1523
1577
|
declare const join: (...arguments_: string[]) => string;
|
|
1524
1578
|
declare const relative: (from: string, to: string) => string;
|
|
1525
1579
|
declare const dirname: (path: string) => string;
|
|
@@ -1576,41 +1630,6 @@ declare function matchPath(filePath: string, {
|
|
|
1576
1630
|
root
|
|
1577
1631
|
}: MatchPathOptions): boolean;
|
|
1578
1632
|
//#endregion
|
|
1579
|
-
//#region src/utilities/metadata-utilities.d.ts
|
|
1580
|
-
declare function isScriptMetadata(metadata: MetadataBase$1 | undefined): metadata is ScriptMetadata$1;
|
|
1581
|
-
declare function isPackageMetadata(metadata: MetadataBase$1 | undefined): metadata is PackageMetadata$1;
|
|
1582
|
-
declare function isHtmlMetadata(metadata: MetadataBase$1 | undefined): metadata is HtmlMetadata$1;
|
|
1583
|
-
declare function isStyleMetadata(metadata: MetadataBase$1 | undefined): metadata is StyleMetadata$1;
|
|
1584
|
-
declare function isSvgMetadata(metadata: MetadataBase$1 | undefined): metadata is SvgMetadata$1;
|
|
1585
|
-
declare function isMarkdownMetadata(metadata: MetadataBase$1 | undefined): metadata is MarkdownMetadata$1;
|
|
1586
|
-
declare function isTextAssetMetadata(metadata: MetadataBase$1 | undefined): metadata is TextAssetMetadata$1;
|
|
1587
|
-
declare function isBinaryAssetMetadata(metadata: MetadataBase$1 | undefined): metadata is BinaryAssetMetadata$1;
|
|
1588
|
-
declare function isWebManifestMetadata(metadata: MetadataBase$1): metadata is WebManifestMetadata$1;
|
|
1589
|
-
/**
|
|
1590
|
-
* Returns script-related metadata entries.
|
|
1591
|
-
*
|
|
1592
|
-
* - If the input is ScriptMetadata, it returns it directly.
|
|
1593
|
-
* - If the input is HtmlMetadata, it scans <script> tags in the AST and resolves their associated ScriptMetadata using the metadata
|
|
1594
|
-
* ID attribute.
|
|
1595
|
-
*/
|
|
1596
|
-
declare function filterScriptMetadata(metadata: MetadataBase$1): {
|
|
1597
|
-
metadata: ScriptMetadata$1;
|
|
1598
|
-
tag?: HTMLElement$2;
|
|
1599
|
-
htmlMetadata?: HtmlMetadata$1;
|
|
1600
|
-
}[];
|
|
1601
|
-
/**
|
|
1602
|
-
* Returns style-related metadata entries.
|
|
1603
|
-
*
|
|
1604
|
-
* - If the input is StyleMetadata, it returns it directly.
|
|
1605
|
-
* - If the input is HtmlMetadata, it scans <style> tags in the AST and resolves their associated StyleMetadata using the metadata
|
|
1606
|
-
* ID attribute.
|
|
1607
|
-
*/
|
|
1608
|
-
declare function filterStyleMetadata(metadata: MetadataBase$1): {
|
|
1609
|
-
metadata: StyleMetadata$1;
|
|
1610
|
-
tag?: HTMLElement$2;
|
|
1611
|
-
htmlMetadata?: HtmlMetadata$1;
|
|
1612
|
-
}[];
|
|
1613
|
-
//#endregion
|
|
1614
1633
|
//#region src/utilities/print-formatted-error.d.ts
|
|
1615
1634
|
type Node$3 = Node$2 | Node$1 | Node;
|
|
1616
1635
|
interface FormatErrorOptions {
|
|
@@ -1639,6 +1658,12 @@ declare const printFmtError: (...messageAndErrorWithOptions: [...MessageAndError
|
|
|
1639
1658
|
//#endregion
|
|
1640
1659
|
//#region src/utilities/value-or-error.d.ts
|
|
1641
1660
|
type ValueOrError<T> = [T, null] | [null, Error];
|
|
1661
|
+
declare function handleError<T>(error: unknown, functionName?: string): ValueOrError<T>;
|
|
1662
|
+
interface goErrorsI {
|
|
1663
|
+
<T, A extends unknown[]>(function_: (...arguments_: A) => Promise<T>): (...arguments_: A) => Promise<ValueOrError<T>>;
|
|
1664
|
+
<T, A extends unknown[]>(function_: (...arguments_: A) => T): (...arguments_: A) => ValueOrError<T>;
|
|
1665
|
+
}
|
|
1666
|
+
declare const valueOrError: goErrorsI;
|
|
1642
1667
|
//#endregion
|
|
1643
1668
|
//#region src/utilities/read-file.d.ts
|
|
1644
1669
|
declare function safeReadFile(path: PathLike | FileHandle, options?: ({
|
|
@@ -1709,26 +1734,8 @@ declare function cloneObject<T extends object>(object: T): T;
|
|
|
1709
1734
|
declare function hashContent(content: string): string;
|
|
1710
1735
|
declare function escapeHtml(input: string): string;
|
|
1711
1736
|
//#endregion
|
|
1712
|
-
//#region src/helpers/dependency-tracker.d.ts
|
|
1713
|
-
/**
|
|
1714
|
-
* Tracks bidirectional dependencies between importers and their sources.\
|
|
1715
|
-
* Handles reconciliation when dependencies change, so stale entries are automatically removed when an importer stops referencing
|
|
1716
|
-
* a source.
|
|
1717
|
-
*/
|
|
1718
|
-
declare class DependencyTracker {
|
|
1719
|
-
#private;
|
|
1720
|
-
/** Updates the full set of sources for a given importer, reconciling any stale entries from previous calls. */
|
|
1721
|
-
update(importer: string, sources: Iterable<string>): void;
|
|
1722
|
-
/** Deletes all dependency data for a given id, whether it's acting as an importer, a source, or both (e.g. on file unlink). */
|
|
1723
|
-
delete(id: string): void;
|
|
1724
|
-
/** Returns all importers that depend on a given source, or an empty set. */
|
|
1725
|
-
getImporters(source: string): ReadonlySet<string>;
|
|
1726
|
-
/** Returns all sources that a given importer depends on, or an empty set. */
|
|
1727
|
-
getSources(importer: string): ReadonlySet<string>;
|
|
1728
|
-
}
|
|
1729
|
-
//#endregion
|
|
1730
1737
|
//#region src/index.d.ts
|
|
1731
1738
|
declare function defineConfig(config: AppConfig): AppConfig;
|
|
1732
1739
|
//#endregion
|
|
1733
|
-
export { type App, AppConfig, BabelAst, BinaryAssetMetadata, BoundPlugin, CONFIG_FILE_NAME, CUSTOM_ATTRIBUTES, CliProgram, DependencyTracker, type Document, type HTMLElement, HtmlMetadata, METADATA_TYPES, MarkdownAst, MarkdownMetadata, MetadataBase, MetadataSource, MetadataTypes, NodePath, PackageMetadata, Plugin, PostcssAst, PrintFormattedError, ResolveResult, ScriptMetadata, ServerReply, ServerRequest, StyleMetadata, SvgMetadata, TextAssetMetadata,
|
|
1740
|
+
export { type App, AppConfig, BabelAst, BinaryAssetMetadata, BoundPlugin, CONFIG_FILE_NAME, CUSTOM_ATTRIBUTES, CliProgram, DependencyTracker, type Document, type HTMLElement, HtmlMetadata, METADATA_TYPES, MarkdownAst, MarkdownMetadata, MetadataBase, MetadataSource, MetadataTypes, NodePath, PackageMetadata, Plugin, PostcssAst, PrintFormattedError, ResolveResult, ScriptMetadata, ServerReply, ServerRequest, StyleMetadata, SvgMetadata, TextAssetMetadata, ValueOrError, WebManifestMetadata, assign, bytesToKB, camelCaseToKebabCase, capitalize, clamp, clearLn, cloneObject, defineConfig, downloadContent, escapeHtml, filterScriptMetadata, filterStyleMetadata, getLineColumn, handleError, hashContent, humanReadableBytes, isBinaryAssetMetadata, isDefined, isHtmlMetadata, isMarkdownMetadata, isObject, isPackageMetadata, isScriptMetadata, isStyleMetadata, isSvgMetadata, isTextAssetMetadata, isURL, isWebManifestMetadata, kebabToCamelCase, mergeMaps, path_d_exports as path, print, printFmtError, safeReadFile, safeReadFileSync, valueOrError };
|
|
1734
1741
|
//# sourceMappingURL=index.d.mts.map
|