emsdk-env 0.10.0 → 0.11.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.
Files changed (41) hide show
  1. package/dist/build-BbwVl0T6.js +1379 -0
  2. package/dist/build-BbwVl0T6.js.map +1 -0
  3. package/dist/build-TpHGBYTu.cjs +1388 -0
  4. package/dist/build-TpHGBYTu.cjs.map +1 -0
  5. package/dist/build.d.ts +22 -0
  6. package/dist/build.d.ts.map +1 -0
  7. package/dist/commands.d.ts +14 -0
  8. package/dist/commands.d.ts.map +1 -0
  9. package/dist/emsdk.d.ts +22 -0
  10. package/dist/emsdk.d.ts.map +1 -0
  11. package/dist/env.d.ts +16 -0
  12. package/dist/env.d.ts.map +1 -0
  13. package/dist/fs-utils.d.ts +13 -0
  14. package/dist/fs-utils.d.ts.map +1 -0
  15. package/dist/generated/packageMetadata.d.ts +18 -0
  16. package/dist/generated/packageMetadata.d.ts.map +1 -0
  17. package/dist/index.cjs +11 -14
  18. package/dist/index.d.ts +17 -338
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.mjs +10 -15
  21. package/dist/logger.d.ts +13 -0
  22. package/dist/logger.d.ts.map +1 -0
  23. package/dist/{vite.d.ts → types.d.ts} +299 -268
  24. package/dist/types.d.ts.map +1 -0
  25. package/dist/vite/index.d.ts +24 -0
  26. package/dist/vite/index.d.ts.map +1 -0
  27. package/dist/vite/logger.d.ts +14 -0
  28. package/dist/vite/logger.d.ts.map +1 -0
  29. package/dist/vite/types.d.ts +17 -0
  30. package/dist/vite/types.d.ts.map +1 -0
  31. package/dist/vite.cjs +735 -712
  32. package/dist/vite.cjs.map +1 -1
  33. package/dist/vite.mjs +729 -712
  34. package/dist/vite.mjs.map +1 -1
  35. package/package.json +22 -21
  36. package/dist/build-BE9Z95iJ.js +0 -1668
  37. package/dist/build-BE9Z95iJ.js.map +0 -1
  38. package/dist/build-BGtsNe6D.cjs +0 -1689
  39. package/dist/build-BGtsNe6D.cjs.map +0 -1
  40. package/dist/index.cjs.map +0 -1
  41. package/dist/index.mjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,16 +1,13 @@
1
1
  /*!
2
- * name: emsdk-env
3
- * version: 0.10.0
4
- * description: Emscripten environment builder
5
- * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
- * license: MIT
7
- * repository.url: https://github.com/kekyo/emsdk-env
8
- * git.commit.hash: 7ee173408d930a3cc7444806156538a24a617b55
9
- */
10
-
11
- "use strict";
2
+ * name: emsdk-env
3
+ * version: 0.11.0
4
+ * description: Emscripten environment builder
5
+ * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
+ * license: MIT
7
+ * repository.url: https://github.com/kekyo/emsdk-env
8
+ * git.commit.hash: 0cf3fec6df406458fa2cf19fe561648e1ad4e369
9
+ */
12
10
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
13
- const build = require("./build-BGtsNe6D.cjs");
14
- exports.buildWasm = build.buildWasm;
15
- exports.prepareEmsdk = build.prepareEmsdk;
16
- //# sourceMappingURL=index.cjs.map
11
+ const require_build = require("./build-TpHGBYTu.cjs");
12
+ exports.buildWasm = require_build.buildWasm;
13
+ exports.prepareEmsdk = require_build.prepareEmsdk;
package/dist/index.d.ts CHANGED
@@ -1,346 +1,25 @@
1
1
  /*!
2
2
  * name: emsdk-env
3
- * version: 0.10.0
3
+ * version: 0.11.0
4
4
  * description: Emscripten environment builder
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/emsdk-env
8
- * git.commit.hash: 7ee173408d930a3cc7444806156538a24a617b55
8
+ * git.commit.hash: 0cf3fec6df406458fa2cf19fe561648e1ad4e369
9
9
  */
10
10
 
11
- /**
12
- * Build WASM binaries (and optional archives) from C/C++ sources using emsdk.
13
- *
14
- * Resolves the SDK via prepareEmsdk, expands build paths, compiles sources,
15
- * links targets, and returns output paths keyed by target name.
16
- *
17
- * @param options - Build options including rule definitions and shared settings.
18
- * @returns Build result with the resolved SDK root and output file paths.
19
- */
20
- export declare const buildWasm: (options: BuildWasmOptions) => Promise<BuildWasmResult>;
21
-
22
- /**
23
- * Common options for building WASM binaries.
24
- */
25
- export declare interface BuildWasmCommonOptions {
26
- /**
27
- * Emscripten SDK setup options (defaults to `targetVersion: 'latest'`).
28
- */
29
- readonly emsdk?: PrepareEmsdkOptions;
30
- /**
31
- * Package imports that provide include/lib directories.
32
- */
33
- readonly imports?: readonly string[];
34
- /**
35
- * Source root directory (defaults to `wasm`).
36
- */
37
- readonly srcDir?: string;
38
- /**
39
- * Default include directory (defaults to `include`).
40
- */
41
- readonly includeDir?: string;
42
- /**
43
- * Output directory for generated WASM files (defaults to `src/wasm`).
44
- */
45
- readonly outDir?: string;
46
- /**
47
- * Output directory for generated archives (defaults to `lib`).
48
- */
49
- readonly libDir?: string;
50
- /**
51
- * Generate a zero-dependency TypeScript loader into the target project.
52
- */
53
- readonly generatedLoader?: GeneratedLoaderOptions;
54
- /**
55
- * Temporary build directory (defaults to OS temp dir).
56
- */
57
- readonly buildDir?: string;
58
- /**
59
- * Remove the build directory after completion. (defaults to true).
60
- */
61
- readonly cleanupBuildDir?: boolean;
62
- /**
63
- * Compile sources in parallel (defaults to true).
64
- */
65
- readonly parallel?: boolean;
66
- }
67
-
68
- /**
69
- * Options for building WASM binaries.
70
- */
71
- export declare interface BuildWasmOptions extends BuildWasmCommonOptions {
72
- /**
73
- * Build rules describing targets and shared options.
74
- */
75
- readonly rule: WasmBuildRule;
76
- /**
77
- * Project root directory (defaults to `process.cwd()`).
78
- */
79
- readonly root?: string;
80
- /**
81
- * Custom logger implementation.
82
- */
83
- readonly logger?: Logger;
84
- }
85
-
86
- /**
87
- * Result of a buildWasm invocation.
88
- */
89
- export declare interface BuildWasmResult {
90
- /**
91
- * Resolved Emscripten SDK root path.
92
- */
93
- readonly emsdkRoot: string;
94
- /**
95
- * Output paths keyed by target name.
96
- */
97
- readonly outFiles: Record<string, string>;
98
- /**
99
- * Generated loader source path, when enabled.
100
- */
101
- readonly generatedLoaderFile?: string;
102
- }
103
-
104
- /**
105
- * Input type for preprocessor defines.
106
- */
107
- export declare type DefineInput = Record<string, DefineValue> | Readonly<Map<string, DefineValue>> | readonly string[];
108
-
109
- /**
110
- * Value type for preprocessor defines.
111
- */
112
- export declare type DefineValue = string | number | boolean | null | undefined;
113
-
114
- /**
115
- * Options for generating a zero-dependency TypeScript WASM loader file.
116
- */
117
- export declare interface GeneratedLoaderOptions {
118
- /**
119
- * Enable generated loader output (defaults to false).
120
- */
121
- readonly enable?: boolean;
122
- /**
123
- * Output file path for the generated loader source (project-root relative by default).
124
- */
125
- readonly outFile?: string;
126
- }
127
-
128
- /**
129
- * Key-value declaration type.
130
- * @deprecated Use `DefineInput` or `LinkDirectiveInput`.
131
- */
132
- export declare type KeyValueInput = DefineInput;
133
-
134
- /**
135
- * Input type for linker directives.
136
- */
137
- export declare type LinkDirectiveInput = Record<string, LinkDirectiveValue> | Readonly<Map<string, LinkDirectiveValue>> | readonly string[];
138
-
139
- /**
140
- * Value type for linker directives.
141
- */
142
- export declare type LinkDirectiveValue = DefineValue | readonly string[];
143
-
144
- /**
145
- * Logger interface
146
- */
147
- export declare interface Logger {
148
- /**
149
- * Log an debug message
150
- * @param msg - The message to log
151
- */
152
- readonly debug: (msg: string) => void;
153
- /**
154
- * Log an info message
155
- * @param msg - The message to log
156
- */
157
- readonly info: (msg: string) => void;
158
- /**
159
- * Log a warning message
160
- * @param msg - The message to log
161
- */
162
- readonly warn: (msg: string) => void;
163
- /**
164
- * Log an error message
165
- * @param msg - The message to log
166
- */
167
- readonly error: (msg: string) => void;
168
- }
169
-
170
- /**
171
- * Prepare the Emscripten SDK in the local cache and return the SDK root path.
172
- *
173
- * Clones the emsdk repository if needed, installs the requested version,
174
- * and activates it in the cache directory.
175
- *
176
- * @param options - SDK preparation options.
177
- * @returns Absolute path to the prepared SDK root.
178
- */
179
- export declare const prepareEmsdk: (options: PrepareEmsdkOptions) => Promise<string>;
180
-
181
- /**
182
- * Options for the emsdk-env preparer.
183
- */
184
- export declare interface PrepareEmsdkOptions {
185
- /**
186
- * Emscripten SDK version to install (e.g. "latest" or a specific tag. defaults to 'latest').
187
- */
188
- readonly targetVersion?: string;
189
- /**
190
- * Cache directory for the Emscripten SDK (defaults to `~/.cache/emsdk-env`).
191
- */
192
- readonly cacheDir?: string;
193
- /**
194
- * Custom Emscripten SDK repository URL (defaults to the official Emscripten SDK GitHub repository).
195
- */
196
- readonly repoUrl?: string;
197
- /**
198
- * Git executable path (defaults to `git`).
199
- */
200
- readonly gitPath?: string;
201
- /**
202
- * Abort signal for cancelling the operation.
203
- */
204
- readonly signal?: AbortSignal;
205
- }
206
-
207
- /**
208
- * Common build options shared across targets.
209
- */
210
- export declare interface WasmBuildCommonOptions {
211
- /**
212
- * Common compile options applied to this target.
213
- */
214
- readonly options?: readonly string[];
215
- /**
216
- * Additional common link options passed to `emcc` during the final link step.
217
- */
218
- readonly linkOptions?: readonly string[];
219
- /**
220
- * Common linker directives mapped to `-s KEY=VALUE`.
221
- */
222
- readonly linkDirectives?: LinkDirectiveInput;
223
- /**
224
- * Common symbols to export (mapped to `-s EXPORTED_FUNCTIONS=...`).
225
- */
226
- readonly exports?: readonly string[];
227
- /**
228
- * Common wasm-opt options applied after linking.
229
- */
230
- readonly wasmOpt?: WasmOptOptions;
231
- /**
232
- * Common include directories added as `-I` flags (defaults to `$includeDir`).
233
- */
234
- readonly includeDirs?: readonly string[];
235
- /**
236
- * Common preprocessor defines applied as `-D` flags.
237
- */
238
- readonly defines?: DefineInput;
239
- }
240
-
241
- /**
242
- * Build rule describing targets and shared options.
243
- */
244
- export declare interface WasmBuildRule {
245
- /**
246
- * Shared build options applied to all targets.
247
- */
248
- readonly common?: WasmBuildCommonOptions;
249
- /**
250
- * Target build configurations keyed by target name.
251
- */
252
- readonly targets: Record<string, WasmBuildTarget>;
253
- }
254
-
255
- /**
256
- * Group of sources compiled with additional options.
257
- */
258
- export declare interface WasmBuildSourceGroup {
259
- /**
260
- * Source file globs for this group (relative to `srcDir` unless absolute).
261
- */
262
- readonly sources: readonly string[];
263
- /**
264
- * Compile options applied to this target for this group.
265
- */
266
- readonly options?: readonly string[];
267
- /**
268
- * Include directories added as `-I` flags for this group.
269
- */
270
- readonly includeDirs?: readonly string[];
271
- /**
272
- * Preprocessor defines applied as `-D` flags for this group.
273
- */
274
- readonly defines?: DefineInput;
275
- }
276
-
277
- /**
278
- * Per-target build configuration.
279
- */
280
- export declare interface WasmBuildTarget {
281
- /**
282
- * Target output type (defaults to 'wasm').
283
- */
284
- readonly type?: WasmBuildTargetType;
285
- /**
286
- * Output file path (relative to `outDir` or `libDir` unless absolute).
287
- */
288
- readonly outFile?: string;
289
- /**
290
- * Source file globs (relative to `srcDir` unless absolute).
291
- */
292
- readonly sources?: readonly string[];
293
- /**
294
- * Source groups compiled with additional options.
295
- */
296
- readonly sourceGroups?: readonly WasmBuildSourceGroup[];
297
- /**
298
- * Compile options applied to this target.
299
- */
300
- readonly options?: readonly string[];
301
- /**
302
- * Additional link options passed to `emcc` during the final link step.
303
- */
304
- readonly linkOptions?: readonly string[];
305
- /**
306
- * Linker directives mapped to `-s KEY=VALUE`.
307
- */
308
- readonly linkDirectives?: LinkDirectiveInput;
309
- /**
310
- * Common symbols to export (mapped to `-s EXPORTED_FUNCTIONS=...`).
311
- */
312
- readonly exports?: readonly string[];
313
- /**
314
- * wasm-opt options applied after linking this target.
315
- */
316
- readonly wasmOpt?: WasmOptOptions;
317
- /**
318
- * Include directories added as `-I` flags.
319
- */
320
- readonly includeDirs?: readonly string[];
321
- /**
322
- * Preprocessor defines applied as `-D` flags.
323
- */
324
- readonly defines?: DefineInput;
325
- }
326
-
327
- /**
328
- * Build target type for WASM or archive outputs.
329
- */
330
- export declare type WasmBuildTargetType = 'wasm' | 'archive';
331
-
332
- /**
333
- * Options for running wasm-opt on the linked output.
334
- */
335
- export declare interface WasmOptOptions {
336
- /**
337
- * Enable wasm-opt for this target (defaults to false).
338
- */
339
- readonly enable?: boolean;
340
- /**
341
- * Additional wasm-opt options.
342
- */
343
- readonly options?: readonly string[];
344
- }
345
-
346
- export { }
11
+ /**
12
+ * Public types for configuring emsdk-env.
13
+ *
14
+ * Re-exported from `./types`.
15
+ */
16
+ export type * from './types.js';
17
+ /**
18
+ * Prepare the Emscripten SDK in the local cache and return the SDK root path.
19
+ */
20
+ export { prepareEmsdk } from './emsdk.js';
21
+ /**
22
+ * Build WASM binaries based on the provided build rule.
23
+ */
24
+ export { buildWasm } from './build.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAKA;;;;GAIG;AACH,mBAAmB,SAAS,CAAC;AAE7B;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,16 +1,11 @@
1
1
  /*!
2
- * name: emsdk-env
3
- * version: 0.10.0
4
- * description: Emscripten environment builder
5
- * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
- * license: MIT
7
- * repository.url: https://github.com/kekyo/emsdk-env
8
- * git.commit.hash: 7ee173408d930a3cc7444806156538a24a617b55
9
- */
10
-
11
- import { b, p } from "./build-BE9Z95iJ.js";
12
- export {
13
- b as buildWasm,
14
- p as prepareEmsdk
15
- };
16
- //# sourceMappingURL=index.mjs.map
2
+ * name: emsdk-env
3
+ * version: 0.11.0
4
+ * description: Emscripten environment builder
5
+ * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
+ * license: MIT
7
+ * repository.url: https://github.com/kekyo/emsdk-env
8
+ * git.commit.hash: 0cf3fec6df406458fa2cf19fe561648e1ad4e369
9
+ */
10
+ import { r as prepareEmsdk, t as buildWasm } from "./build-BbwVl0T6.js";
11
+ export { buildWasm, prepareEmsdk };
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * name: emsdk-env
3
+ * version: 0.11.0
4
+ * description: Emscripten environment builder
5
+ * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
+ * license: MIT
7
+ * repository.url: https://github.com/kekyo/emsdk-env
8
+ * git.commit.hash: 0cf3fec6df406458fa2cf19fe561648e1ad4e369
9
+ */
10
+
11
+ import { Logger } from './types.js';
12
+ export declare const createConsoleLogger: (prefix: string) => Logger;
13
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;;;;;;AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAKjC,eAAO,MAAM,sBAAmB,GAAI,QAAQ,MAAM,KAAG,MAOpD,CAAC"}