refactor: extract seed provision scripts to dedicated directory

Move bootstrap, default, and inform scripts from inline template
strings in lib/init.ts to standalone files under seed/, loaded via
an esbuild text-loader plugin. Add type-checking (provisions.d.ts,
tsconfig.json) and ESLint config for the seed scripts. Set tsconfig
module to Preserve to support import attributes.
This commit is contained in:
Zaid Humaimidi committed 2026-03-13 13:48:45 -07:00
1 parent f39e2ce7cf
commit d445aa03cf
10 files changed
+236 -56

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
interface Timestamps {
path?: number;
object?: number;
writable?: number;
value?: number;
notification?: number;
accessList?: number;
}
interface Values {
path?: number | [number, number];
object?: boolean;
writable?: boolean;
value?: string | number | boolean | [string | number | boolean, string?];
notification?: number;
accessList?: string[];
}
interface ParameterWrapper extends Iterable<ParameterWrapper> {
readonly path: string | undefined;
readonly size: number | undefined;
readonly object: 0 | 1 | undefined;
readonly writable: 0 | 1 | undefined;
readonly value: [string | number | boolean, string] | undefined;
readonly notification: number | undefined;
readonly accessList: string[] | undefined;
}
declare function declare(
path: string,
timestamps?: Timestamps | null,
values?: Values | null,
): ParameterWrapper;
declare function clear(
path: string,
timestamp: number,
attributes?: Timestamps,
): void;
declare function commit(): void;
declare function ext(...args: unknown[]): unknown;
declare function log(msg: string, meta?: Record<string, unknown>): void;
declare const args: unknown[];
interface DateConstructor {
new (): Date;
new (
year: number,
monthIndex?: number,
day?: number,
hours?: number,
minutes?: number,
seconds?: number,
milliseconds?: number,
): Date;
now(intervalOrCron?: number | string, variance?: number): number;
parse(dateString: string): number;
UTC(
year: number,
monthIndex?: number,
day?: number,
hours?: number,
minutes?: number,
seconds?: number,
milliseconds?: number,
): number;
}