@tetherto/wdk-worklet-bundler 1.0.0-beta.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/README.md +185 -0
- package/bin/wdk-worklet-bundler.js +2 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1320 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +758 -0
- package/package.json +62 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration types for wdk-worklet-bundler
|
|
3
|
+
*/
|
|
4
|
+
interface WdkBundleConfig {
|
|
5
|
+
/** Module definitions: key -> package path */
|
|
6
|
+
networks: {
|
|
7
|
+
[networkName: string]: {
|
|
8
|
+
package: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/** Protocol definitions: key -> package path */
|
|
12
|
+
protocols?: {
|
|
13
|
+
[protocolName: string]: {
|
|
14
|
+
package: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/** Modules to preload (native addons like spark-frost-bare-addon) */
|
|
19
|
+
preloadModules?: string[];
|
|
20
|
+
/** Output paths */
|
|
21
|
+
output?: {
|
|
22
|
+
bundle?: string;
|
|
23
|
+
types?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Build options */
|
|
26
|
+
options?: {
|
|
27
|
+
minify?: boolean;
|
|
28
|
+
sourceMaps?: boolean;
|
|
29
|
+
targets?: string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface ResolvedConfig extends WdkBundleConfig {
|
|
33
|
+
/** Absolute path to config file */
|
|
34
|
+
configPath: string;
|
|
35
|
+
/** Absolute path to project root */
|
|
36
|
+
projectRoot: string;
|
|
37
|
+
/** Resolved output paths (absolute) */
|
|
38
|
+
resolvedOutput: {
|
|
39
|
+
bundle: string;
|
|
40
|
+
types: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Configuration loader
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
declare function loadConfig(configPath?: string): Promise<ResolvedConfig>;
|
|
49
|
+
|
|
50
|
+
interface ModuleInfo {
|
|
51
|
+
name: string;
|
|
52
|
+
path: string;
|
|
53
|
+
version: string;
|
|
54
|
+
isLocal: boolean;
|
|
55
|
+
}
|
|
56
|
+
interface ValidationResult {
|
|
57
|
+
valid: boolean;
|
|
58
|
+
installed: ModuleInfo[];
|
|
59
|
+
missing: string[];
|
|
60
|
+
}
|
|
61
|
+
declare function validateDependencies(modules: string[], projectRoot: string): ValidationResult;
|
|
62
|
+
declare function detectPackageManager(projectRoot: string): 'npm' | 'yarn' | 'pnpm';
|
|
63
|
+
declare function generateInstallCommand(missing: string[], packageManager?: 'npm' | 'yarn' | 'pnpm'): string;
|
|
64
|
+
interface InstallResult {
|
|
65
|
+
success: boolean;
|
|
66
|
+
command: string;
|
|
67
|
+
installed: string[];
|
|
68
|
+
failed: string[];
|
|
69
|
+
error?: string;
|
|
70
|
+
}
|
|
71
|
+
interface UninstallResult {
|
|
72
|
+
success: boolean;
|
|
73
|
+
command: string;
|
|
74
|
+
removed: string[];
|
|
75
|
+
failed: string[];
|
|
76
|
+
error?: string;
|
|
77
|
+
}
|
|
78
|
+
declare function installDependencies(missing: string[], projectRoot: string, options?: {
|
|
79
|
+
verbose?: boolean;
|
|
80
|
+
}): InstallResult;
|
|
81
|
+
declare function generateUninstallCommand(packages: string[], packageManager?: 'npm' | 'yarn' | 'pnpm'): string;
|
|
82
|
+
declare function uninstallDependencies(packages: string[], projectRoot: string, options?: {
|
|
83
|
+
verbose?: boolean;
|
|
84
|
+
}): UninstallResult;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Bundle generator
|
|
88
|
+
* Orchestrates the full bundle generation process
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
interface GenerateBundleOptions {
|
|
92
|
+
dryRun?: boolean;
|
|
93
|
+
verbose?: boolean;
|
|
94
|
+
silent?: boolean;
|
|
95
|
+
skipTypes?: boolean;
|
|
96
|
+
skipGeneration?: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface GenerateBundleResult {
|
|
99
|
+
success: boolean;
|
|
100
|
+
bundlePath: string;
|
|
101
|
+
typesPath: string;
|
|
102
|
+
bundleSize: number;
|
|
103
|
+
duration: number;
|
|
104
|
+
error?: string;
|
|
105
|
+
missingModule?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Generate WDK bundle from configuration
|
|
109
|
+
*/
|
|
110
|
+
declare function generateBundle(config: ResolvedConfig, options?: GenerateBundleOptions): Promise<GenerateBundleResult>;
|
|
111
|
+
/**
|
|
112
|
+
* Generate only the entry point
|
|
113
|
+
* Useful for debugging or custom bundling workflows
|
|
114
|
+
*/
|
|
115
|
+
declare function generateSourceFiles(config: ResolvedConfig, options?: {
|
|
116
|
+
verbose?: boolean;
|
|
117
|
+
}): Promise<{
|
|
118
|
+
entryPath: string;
|
|
119
|
+
}>;
|
|
120
|
+
|
|
121
|
+
declare function generateEntryPoint(config: ResolvedConfig, outputDir: string): Promise<string>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Wallet modules code generator
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Generate wallet modules code section
|
|
129
|
+
*/
|
|
130
|
+
declare function generateWalletModulesCode(config: ResolvedConfig): string;
|
|
131
|
+
|
|
132
|
+
export { type GenerateBundleOptions, type GenerateBundleResult, type InstallResult, type ModuleInfo, type ResolvedConfig, type UninstallResult, type ValidationResult, type WdkBundleConfig, detectPackageManager, generateBundle, generateEntryPoint, generateInstallCommand, generateSourceFiles, generateUninstallCommand, generateWalletModulesCode, installDependencies, loadConfig, uninstallDependencies, validateDependencies };
|