emsdk-env 0.3.0 → 0.5.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.
- package/README.md +21 -4
- package/dist/{build-DdEthYh8.cjs → build-Djw1ummW.cjs} +289 -50
- package/dist/{build-DdEthYh8.cjs.map → build-Djw1ummW.cjs.map} +1 -1
- package/dist/{build-CYHeaOdc.js → build-EqOBCaAv.js} +269 -52
- package/dist/{build-CYHeaOdc.js.map → build-EqOBCaAv.js.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +58 -31
- package/dist/index.mjs +3 -3
- package/dist/vite.cjs +47 -25
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.ts +71 -40
- package/dist/vite.mjs +47 -25
- package/dist/vite.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,51 +1,69 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: emsdk-env
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.5.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:
|
|
8
|
+
* git.commit.hash: f54983861d59656c8f39fd46d984c1b373100dde
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export declare const buildWasm: (options: BuildWasmOptions) => Promise<BuildWasmResult>;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Common options for building WASM binaries.
|
|
15
15
|
*/
|
|
16
|
-
export declare interface
|
|
16
|
+
export declare interface BuildWasmCommonOptions {
|
|
17
17
|
/**
|
|
18
|
-
* Emscripten SDK setup options.
|
|
18
|
+
* Emscripten SDK setup options (defaults to `targetVersion: 'latest'`).
|
|
19
19
|
*/
|
|
20
20
|
readonly emsdk?: PrepareEmsdkOptions;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Package imports that provide include/lib directories.
|
|
23
23
|
*/
|
|
24
|
-
readonly
|
|
25
|
-
/**
|
|
26
|
-
* Project root directory (defaults to `process.cwd()`).
|
|
27
|
-
*/
|
|
28
|
-
readonly root?: string;
|
|
24
|
+
readonly imports?: readonly string[];
|
|
29
25
|
/**
|
|
30
26
|
* Source root directory (defaults to `wasm`).
|
|
31
27
|
*/
|
|
32
28
|
readonly srcDir?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Default include directory (defaults to `include`).
|
|
31
|
+
*/
|
|
32
|
+
readonly includeDir?: string;
|
|
33
33
|
/**
|
|
34
34
|
* Output directory for generated WASM files (defaults to `src/wasm`).
|
|
35
35
|
*/
|
|
36
36
|
readonly outDir?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Output directory for generated archives (defaults to `lib`).
|
|
39
|
+
*/
|
|
40
|
+
readonly libDir?: string;
|
|
37
41
|
/**
|
|
38
42
|
* Temporary build directory (defaults to OS temp dir).
|
|
39
43
|
*/
|
|
40
44
|
readonly buildDir?: string;
|
|
41
45
|
/**
|
|
42
|
-
* Remove the build directory after completion.
|
|
46
|
+
* Remove the build directory after completion. (defaults to true).
|
|
43
47
|
*/
|
|
44
48
|
readonly cleanupBuildDir?: boolean;
|
|
45
49
|
/**
|
|
46
|
-
* Compile sources in parallel.
|
|
50
|
+
* Compile sources in parallel (defaults to true).
|
|
47
51
|
*/
|
|
48
52
|
readonly parallel?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Options for building WASM binaries.
|
|
57
|
+
*/
|
|
58
|
+
export declare interface BuildWasmOptions extends BuildWasmCommonOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Build rules describing targets and shared options.
|
|
61
|
+
*/
|
|
62
|
+
readonly rule: WasmBuildRule;
|
|
63
|
+
/**
|
|
64
|
+
* Project root directory (defaults to `process.cwd()`).
|
|
65
|
+
*/
|
|
66
|
+
readonly root?: string;
|
|
49
67
|
/**
|
|
50
68
|
* Custom logger implementation.
|
|
51
69
|
*/
|
|
@@ -61,7 +79,7 @@ export declare interface BuildWasmResult {
|
|
|
61
79
|
*/
|
|
62
80
|
readonly emsdkRoot: string;
|
|
63
81
|
/**
|
|
64
|
-
* Output
|
|
82
|
+
* Output paths keyed by target name.
|
|
65
83
|
*/
|
|
66
84
|
readonly outFiles: Record<string, string>;
|
|
67
85
|
}
|
|
@@ -104,19 +122,19 @@ export declare const prepareEmsdk: (options: PrepareEmsdkOptions) => Promise<str
|
|
|
104
122
|
*/
|
|
105
123
|
export declare interface PrepareEmsdkOptions {
|
|
106
124
|
/**
|
|
107
|
-
* Emscripten SDK version to install (e.g. "latest" or a specific tag).
|
|
125
|
+
* Emscripten SDK version to install (e.g. "latest" or a specific tag. defaults to 'latest').
|
|
108
126
|
*/
|
|
109
127
|
readonly targetVersion?: string;
|
|
110
128
|
/**
|
|
111
|
-
* Cache directory for the SDK.
|
|
129
|
+
* Cache directory for the Emscripten SDK (defaults to `~/.cache/emsdk-env`).
|
|
112
130
|
*/
|
|
113
131
|
readonly cacheDir?: string;
|
|
114
132
|
/**
|
|
115
|
-
* Custom
|
|
133
|
+
* Custom Emscripten SDK repository URL (defaults to the official Emscripten SDK GitHub repository).
|
|
116
134
|
*/
|
|
117
135
|
readonly repoUrl?: string;
|
|
118
136
|
/**
|
|
119
|
-
* Git executable path.
|
|
137
|
+
* Git executable path (defaults to `git`).
|
|
120
138
|
*/
|
|
121
139
|
readonly gitPath?: string;
|
|
122
140
|
/**
|
|
@@ -130,23 +148,23 @@ export declare interface PrepareEmsdkOptions {
|
|
|
130
148
|
*/
|
|
131
149
|
export declare interface WasmBuildCommonOptions {
|
|
132
150
|
/**
|
|
133
|
-
*
|
|
151
|
+
* Common compile options applied to this target.
|
|
134
152
|
*/
|
|
135
153
|
readonly options?: readonly string[];
|
|
136
154
|
/**
|
|
137
|
-
* Additional link options passed to `emcc` during the final link step.
|
|
155
|
+
* Additional common link options passed to `emcc` during the final link step.
|
|
138
156
|
*/
|
|
139
157
|
readonly linkOptions?: readonly string[];
|
|
140
158
|
/**
|
|
141
|
-
*
|
|
159
|
+
* Common symbols to export (mapped to `-s EXPORTED_FUNCTIONS=...`).
|
|
142
160
|
*/
|
|
143
161
|
readonly exports?: readonly string[];
|
|
144
162
|
/**
|
|
145
|
-
*
|
|
163
|
+
* Common include directories added as `-I` flags (defaults to `$includeDir`).
|
|
146
164
|
*/
|
|
147
165
|
readonly includeDirs?: readonly string[];
|
|
148
166
|
/**
|
|
149
|
-
*
|
|
167
|
+
* Common preprocessor defines applied as `-D` flags.
|
|
150
168
|
*/
|
|
151
169
|
readonly defines?: Record<string, DefineValue>;
|
|
152
170
|
}
|
|
@@ -174,15 +192,15 @@ export declare interface WasmBuildSourceGroup {
|
|
|
174
192
|
*/
|
|
175
193
|
readonly sources: readonly string[];
|
|
176
194
|
/**
|
|
177
|
-
*
|
|
195
|
+
* Compile options applied to this target for this group.
|
|
178
196
|
*/
|
|
179
197
|
readonly options?: readonly string[];
|
|
180
198
|
/**
|
|
181
|
-
* Include directories for this group.
|
|
199
|
+
* Include directories added as `-I` flags for this group.
|
|
182
200
|
*/
|
|
183
201
|
readonly includeDirs?: readonly string[];
|
|
184
202
|
/**
|
|
185
|
-
* Preprocessor defines for this group.
|
|
203
|
+
* Preprocessor defines applied as `-D` flags for this group.
|
|
186
204
|
*/
|
|
187
205
|
readonly defines?: Record<string, DefineValue>;
|
|
188
206
|
}
|
|
@@ -192,7 +210,11 @@ export declare interface WasmBuildSourceGroup {
|
|
|
192
210
|
*/
|
|
193
211
|
export declare interface WasmBuildTarget {
|
|
194
212
|
/**
|
|
195
|
-
*
|
|
213
|
+
* Target output type (defaults to 'wasm').
|
|
214
|
+
*/
|
|
215
|
+
readonly type?: WasmBuildTargetType;
|
|
216
|
+
/**
|
|
217
|
+
* Output file path (relative to `outDir` or `libDir` unless absolute).
|
|
196
218
|
*/
|
|
197
219
|
readonly outFile?: string;
|
|
198
220
|
/**
|
|
@@ -208,21 +230,26 @@ export declare interface WasmBuildTarget {
|
|
|
208
230
|
*/
|
|
209
231
|
readonly options?: readonly string[];
|
|
210
232
|
/**
|
|
211
|
-
*
|
|
233
|
+
* Additional link options passed to `emcc` during the final link step.
|
|
212
234
|
*/
|
|
213
235
|
readonly linkOptions?: readonly string[];
|
|
214
236
|
/**
|
|
215
|
-
*
|
|
237
|
+
* Common symbols to export (mapped to `-s EXPORTED_FUNCTIONS=...`).
|
|
216
238
|
*/
|
|
217
239
|
readonly exports?: readonly string[];
|
|
218
240
|
/**
|
|
219
|
-
* Include directories
|
|
241
|
+
* Include directories added as `-I` flags.
|
|
220
242
|
*/
|
|
221
243
|
readonly includeDirs?: readonly string[];
|
|
222
244
|
/**
|
|
223
|
-
* Preprocessor defines
|
|
245
|
+
* Preprocessor defines applied as `-D` flags.
|
|
224
246
|
*/
|
|
225
247
|
readonly defines?: Record<string, DefineValue>;
|
|
226
248
|
}
|
|
227
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Build target type for WASM or archive outputs.
|
|
252
|
+
*/
|
|
253
|
+
export declare type WasmBuildTargetType = 'wasm' | 'archive';
|
|
254
|
+
|
|
228
255
|
export { }
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: emsdk-env
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.5.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:
|
|
8
|
+
* git.commit.hash: f54983861d59656c8f39fd46d984c1b373100dde
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { b, p } from "./build-
|
|
11
|
+
import { b, p } from "./build-EqOBCaAv.js";
|
|
12
12
|
export {
|
|
13
13
|
b as buildWasm,
|
|
14
14
|
p as prepareEmsdk
|
package/dist/vite.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: emsdk-env
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.5.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:
|
|
8
|
+
* git.commit.hash: f54983861d59656c8f39fd46d984c1b373100dde
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
"use strict";
|
|
12
12
|
const path = require("path");
|
|
13
|
-
const build = require("./build-
|
|
13
|
+
const build = require("./build-Djw1ummW.cjs");
|
|
14
14
|
function getDefaultExportFromCjs(x) {
|
|
15
15
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
16
16
|
}
|
|
@@ -521,7 +521,10 @@ const createViteLoggerAdapter = (viteLogger, logLevel, prefix) => {
|
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
523
|
};
|
|
524
|
+
const version = "0.5.0";
|
|
525
|
+
const git_commit_hash = "f54983861d59656c8f39fd46d984c1b373100dde";
|
|
524
526
|
const DEFAULT_WASM_SRC_DIR = "wasm";
|
|
527
|
+
const DEFAULT_WASM_INCLUDE_DIR = "include";
|
|
525
528
|
const buildRuns = /* @__PURE__ */ new Map();
|
|
526
529
|
const resolvePath = (rootDir, value) => path.isAbsolute(value) ? value : path.resolve(rootDir, value);
|
|
527
530
|
const expandPlaceholders = (value, env, label) => value.replace(/\{([A-Z0-9_]+)\}/g, (_match, key) => {
|
|
@@ -537,16 +540,31 @@ const resolveIncludeDirs = (includeDirs, env, rootDir) => {
|
|
|
537
540
|
return expanded.map((value) => resolvePath(rootDir, value));
|
|
538
541
|
};
|
|
539
542
|
const createBuildOptions = (options, resolvedConfig, logger) => {
|
|
540
|
-
const {
|
|
543
|
+
const {
|
|
544
|
+
emsdk,
|
|
545
|
+
srcDir,
|
|
546
|
+
includeDir,
|
|
547
|
+
imports,
|
|
548
|
+
outDir,
|
|
549
|
+
libDir,
|
|
550
|
+
buildDir,
|
|
551
|
+
cleanupBuildDir,
|
|
552
|
+
parallel,
|
|
553
|
+
...rule
|
|
554
|
+
} = options;
|
|
541
555
|
return {
|
|
542
556
|
rule,
|
|
543
557
|
root: resolvedConfig.root,
|
|
544
558
|
logger,
|
|
545
559
|
...emsdk !== void 0 ? { emsdk } : {},
|
|
546
560
|
...srcDir !== void 0 ? { srcDir } : {},
|
|
561
|
+
...includeDir !== void 0 ? { includeDir } : {},
|
|
562
|
+
...imports !== void 0 ? { imports } : {},
|
|
547
563
|
...outDir !== void 0 ? { outDir } : {},
|
|
564
|
+
...libDir !== void 0 ? { libDir } : {},
|
|
548
565
|
...buildDir !== void 0 ? { buildDir } : {},
|
|
549
|
-
...cleanupBuildDir !== void 0 ? { cleanupBuildDir } : {}
|
|
566
|
+
...cleanupBuildDir !== void 0 ? { cleanupBuildDir } : {},
|
|
567
|
+
...parallel !== void 0 ? { parallel } : {}
|
|
550
568
|
};
|
|
551
569
|
};
|
|
552
570
|
const isSubPath = (parentDir, targetPath) => {
|
|
@@ -557,7 +575,7 @@ const isSubPath = (parentDir, targetPath) => {
|
|
|
557
575
|
return !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
558
576
|
};
|
|
559
577
|
const resolveWatchTargets = (options, resolvedConfig) => {
|
|
560
|
-
var _a, _b;
|
|
578
|
+
var _a, _b, _c;
|
|
561
579
|
const rootDir = resolvedConfig.root;
|
|
562
580
|
const baseEnv = {
|
|
563
581
|
ROOT: rootDir
|
|
@@ -567,10 +585,17 @@ const resolveWatchTargets = (options, resolvedConfig) => {
|
|
|
567
585
|
baseEnv,
|
|
568
586
|
"srcDir"
|
|
569
587
|
);
|
|
588
|
+
const rawIncludeDir = expandPlaceholders(
|
|
589
|
+
(_b = options.includeDir) != null ? _b : DEFAULT_WASM_INCLUDE_DIR,
|
|
590
|
+
baseEnv,
|
|
591
|
+
"includeDir"
|
|
592
|
+
);
|
|
570
593
|
const srcDir = resolvePath(rootDir, rawSrcDir);
|
|
594
|
+
const includeDir = resolvePath(rootDir, rawIncludeDir);
|
|
571
595
|
const envWithDirs = {
|
|
572
596
|
ROOT: rootDir,
|
|
573
|
-
SRC_DIR: srcDir
|
|
597
|
+
SRC_DIR: srcDir,
|
|
598
|
+
INCLUDE_DIR: includeDir
|
|
574
599
|
};
|
|
575
600
|
const patterns = /* @__PURE__ */ new Set();
|
|
576
601
|
const baseDirs = /* @__PURE__ */ new Set();
|
|
@@ -589,7 +614,8 @@ const resolveWatchTargets = (options, resolvedConfig) => {
|
|
|
589
614
|
resolvedIncludeDirs.push(dir);
|
|
590
615
|
}
|
|
591
616
|
};
|
|
592
|
-
|
|
617
|
+
const commonIncludeDirs = ((_c = options.common) == null ? void 0 : _c.includeDirs) === void 0 ? [rawIncludeDir] : options.common.includeDirs;
|
|
618
|
+
addIncludePatterns(commonIncludeDirs, void 0);
|
|
593
619
|
for (const [targetName, target] of Object.entries(options.targets)) {
|
|
594
620
|
addIncludePatterns(target.includeDirs, targetName);
|
|
595
621
|
}
|
|
@@ -600,13 +626,7 @@ const resolveWatchTargets = (options, resolvedConfig) => {
|
|
|
600
626
|
baseDirs: [...baseDirs]
|
|
601
627
|
};
|
|
602
628
|
};
|
|
603
|
-
const setupDevServer = async (server, options, resolvedConfig) => {
|
|
604
|
-
var _a;
|
|
605
|
-
const logger = createViteLoggerAdapter(
|
|
606
|
-
resolvedConfig.logger,
|
|
607
|
-
(_a = resolvedConfig.logLevel) != null ? _a : "info",
|
|
608
|
-
"emsdk-env"
|
|
609
|
-
);
|
|
629
|
+
const setupDevServer = async (server, options, resolvedConfig, logger) => {
|
|
610
630
|
const buildOptions = createBuildOptions(options, resolvedConfig, logger);
|
|
611
631
|
const watchTargets = resolveWatchTargets(options, resolvedConfig);
|
|
612
632
|
logger.debug(`watch root: ${resolvedConfig.root}`);
|
|
@@ -648,25 +668,27 @@ const setupDevServer = async (server, options, resolvedConfig) => {
|
|
|
648
668
|
};
|
|
649
669
|
const emsdkEnv = (options) => {
|
|
650
670
|
let resolvedConfig;
|
|
671
|
+
let logger = build.createConsoleLogger("emsdk-env");
|
|
651
672
|
return {
|
|
652
673
|
name: "emsdkEnv",
|
|
653
674
|
enforce: "pre",
|
|
654
|
-
configResolved(config) {
|
|
675
|
+
configResolved: (config) => {
|
|
676
|
+
var _a;
|
|
655
677
|
resolvedConfig = config;
|
|
678
|
+
logger = createViteLoggerAdapter(
|
|
679
|
+
resolvedConfig.logger,
|
|
680
|
+
(_a = resolvedConfig.logLevel) != null ? _a : "info",
|
|
681
|
+
"emsdk-env"
|
|
682
|
+
);
|
|
683
|
+
logger.info(`${version}-${git_commit_hash}: Started.`);
|
|
656
684
|
},
|
|
657
|
-
async
|
|
658
|
-
var _a;
|
|
685
|
+
buildStart: async () => {
|
|
659
686
|
if (!resolvedConfig) {
|
|
660
687
|
throw new Error("Vite config was not resolved.");
|
|
661
688
|
}
|
|
662
689
|
if (resolvedConfig.command !== "build") {
|
|
663
690
|
return;
|
|
664
691
|
}
|
|
665
|
-
const logger = createViteLoggerAdapter(
|
|
666
|
-
resolvedConfig.logger,
|
|
667
|
-
(_a = resolvedConfig.logLevel) != null ? _a : "info",
|
|
668
|
-
"emsdk-env"
|
|
669
|
-
);
|
|
670
692
|
const buildOptions = createBuildOptions(options, resolvedConfig, logger);
|
|
671
693
|
const buildKey = resolvedConfig.root;
|
|
672
694
|
const existing = buildRuns.get(buildKey);
|
|
@@ -684,14 +706,14 @@ const emsdkEnv = (options) => {
|
|
|
684
706
|
buildRuns.set(buildKey, run);
|
|
685
707
|
await run;
|
|
686
708
|
},
|
|
687
|
-
async
|
|
709
|
+
configureServer: async (server) => {
|
|
688
710
|
if (!resolvedConfig) {
|
|
689
711
|
throw new Error("Vite config was not resolved.");
|
|
690
712
|
}
|
|
691
713
|
if (resolvedConfig.command !== "serve") {
|
|
692
714
|
return;
|
|
693
715
|
}
|
|
694
|
-
await setupDevServer(server, options, resolvedConfig);
|
|
716
|
+
await setupDevServer(server, options, resolvedConfig, logger);
|
|
695
717
|
}
|
|
696
718
|
};
|
|
697
719
|
};
|
package/dist/vite.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.cjs","sources":["../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../src/vite/logger.ts","../src/vite/index.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","// emsdk-env - Emscripten environment builder\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/emsdk-env\n\nimport type { LogLevel, Logger as ViteLogger } from 'vite';\nimport createDebug from 'debug';\n\nimport { Logger } from '../types';\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\n// Vite logger adapter with prefix\nexport const createViteLoggerAdapter = (\n viteLogger: ViteLogger,\n logLevel: LogLevel,\n prefix: string\n): Logger => {\n // Create debug instance with vite:plugin:prettier-max namespace\n const debug = createDebug('vite:plugin:emsdk-vite');\n\n return {\n debug: (msg: string) => {\n // Use debug module for debug level (enabled with vite --debug or DEBUG=vite:*)\n debug(msg);\n },\n info:\n logLevel !== 'silent'\n ? (msg: string) => viteLogger.info(`[${prefix}]: ${msg}`)\n : () => {},\n warn:\n logLevel === 'warn' || logLevel === 'info' || logLevel === 'error'\n ? (msg: string) => viteLogger.warn(`[${prefix}]: ${msg}`)\n : () => {},\n error:\n logLevel !== 'silent'\n ? (msg: string) => viteLogger.error(`[${prefix}]: ${msg}`)\n : () => {},\n };\n};\n","// emsdk-env - Emscripten environment builder\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/emsdk-env\n\nimport { isAbsolute, relative, resolve } from 'path';\nimport type { Plugin, ResolvedConfig, ViteDevServer } from 'vite';\n\nimport type { EmsdkVitePluginOptions } from './types';\nimport { createViteLoggerAdapter } from './logger';\nimport { buildWasm } from '../index';\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\nconst DEFAULT_WASM_SRC_DIR = 'wasm';\nconst buildRuns = new Map<string, Promise<void>>();\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\nconst resolvePath = (rootDir: string, value: string) =>\n isAbsolute(value) ? value : resolve(rootDir, value);\n\nconst expandPlaceholders = (\n value: string,\n env: Record<string, string>,\n label: string\n) =>\n value.replace(/\\{([A-Z0-9_]+)\\}/g, (_match, key: string) => {\n const replacement = env[key];\n if (replacement === undefined) {\n throw new Error(`Unknown placeholder {${key}} in ${label}.`);\n }\n return replacement;\n });\n\nconst expandArray = (\n values: readonly string[],\n env: Record<string, string>,\n label: string\n) => values.map((value) => expandPlaceholders(value, env, label));\n\nconst resolveIncludeDirs = (\n includeDirs: readonly string[],\n env: Record<string, string>,\n rootDir: string\n) => {\n const expanded = expandArray(includeDirs, env, 'includeDirs');\n return expanded.map((value) => resolvePath(rootDir, value));\n};\n\nconst createBuildOptions = (\n options: EmsdkVitePluginOptions,\n resolvedConfig: ResolvedConfig,\n logger: ReturnType<typeof createViteLoggerAdapter>\n) => {\n const { emsdk, srcDir, outDir, buildDir, cleanupBuildDir, ...rule } = options;\n return {\n rule,\n root: resolvedConfig.root,\n logger,\n ...(emsdk !== undefined ? { emsdk } : {}),\n ...(srcDir !== undefined ? { srcDir } : {}),\n ...(outDir !== undefined ? { outDir } : {}),\n ...(buildDir !== undefined ? { buildDir } : {}),\n ...(cleanupBuildDir !== undefined ? { cleanupBuildDir } : {}),\n };\n};\n\nconst isSubPath = (parentDir: string, targetPath: string) => {\n const rel = relative(parentDir, targetPath);\n if (rel === '') {\n return true;\n }\n return !rel.startsWith('..') && !isAbsolute(rel);\n};\n\nconst resolveWatchTargets = (\n options: EmsdkVitePluginOptions,\n resolvedConfig: ResolvedConfig\n) => {\n const rootDir = resolvedConfig.root;\n const baseEnv = {\n ROOT: rootDir,\n };\n const rawSrcDir = expandPlaceholders(\n options.srcDir ?? DEFAULT_WASM_SRC_DIR,\n baseEnv,\n 'srcDir'\n );\n const srcDir = resolvePath(rootDir, rawSrcDir);\n\n const envWithDirs = {\n ROOT: rootDir,\n SRC_DIR: srcDir,\n };\n\n const patterns = new Set<string>();\n const baseDirs = new Set<string>();\n const resolvedIncludeDirs: string[] = [];\n patterns.add(srcDir);\n baseDirs.add(srcDir);\n\n const addIncludePatterns = (\n targetIncludeDirs: readonly string[] | undefined,\n targetName: string | undefined\n ) => {\n if (!targetIncludeDirs || targetIncludeDirs.length === 0) {\n return;\n }\n const env = targetName\n ? { ...envWithDirs, TARGET_NAME: targetName }\n : envWithDirs;\n const resolvedDirs = resolveIncludeDirs(targetIncludeDirs, env, rootDir);\n for (const dir of resolvedDirs) {\n patterns.add(dir);\n baseDirs.add(dir);\n resolvedIncludeDirs.push(dir);\n }\n };\n\n addIncludePatterns(options.common?.includeDirs, undefined);\n for (const [targetName, target] of Object.entries(options.targets)) {\n addIncludePatterns(target.includeDirs, targetName);\n }\n\n return {\n srcDir,\n includeDirs: resolvedIncludeDirs,\n patterns: [...patterns],\n baseDirs: [...baseDirs],\n };\n};\n\nconst setupDevServer = async (\n server: ViteDevServer,\n options: EmsdkVitePluginOptions,\n resolvedConfig: ResolvedConfig\n) => {\n const logger = createViteLoggerAdapter(\n resolvedConfig.logger,\n resolvedConfig.logLevel ?? 'info',\n 'emsdk-env'\n );\n const buildOptions = createBuildOptions(options, resolvedConfig, logger);\n\n const watchTargets = resolveWatchTargets(options, resolvedConfig);\n logger.debug(`watch root: ${resolvedConfig.root}`);\n logger.debug(`watch srcDir: ${watchTargets.srcDir}`);\n logger.debug(\n `watch includeDirs: ${\n watchTargets.includeDirs.length > 0\n ? watchTargets.includeDirs.join(', ')\n : '(none)'\n }`\n );\n logger.debug(`watch patterns: ${watchTargets.patterns.join(', ')}`);\n logger.debug(`watch baseDirs: ${watchTargets.baseDirs.join(', ')}`);\n if (watchTargets.patterns.length > 0) {\n server.watcher.add(watchTargets.patterns);\n }\n\n let buildQueue = Promise.resolve();\n const queueBuild = async (shouldReload: boolean) => {\n buildQueue = buildQueue.then(async () => {\n try {\n await buildWasm(buildOptions);\n if (shouldReload) {\n server.ws.send({ type: 'full-reload' });\n }\n } catch (error) {\n const message =\n error instanceof Error ? error.message : 'Unknown wasm build error.';\n logger.error(`Wasm build failed: ${message}`);\n }\n });\n return buildQueue;\n };\n\n const onWatchEvent = async (eventPath: string) => {\n const resolvedPath = isAbsolute(eventPath)\n ? eventPath\n : resolve(resolvedConfig.root, eventPath);\n if (!watchTargets.baseDirs.some((dir) => isSubPath(dir, resolvedPath))) {\n return;\n }\n await queueBuild(true);\n };\n\n server.watcher.on('add', onWatchEvent);\n server.watcher.on('change', onWatchEvent);\n server.watcher.on('unlink', onWatchEvent);\n\n await queueBuild(false);\n};\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Vite plugin that builds C/C++ sources into WASM using the Emscripten SDK.\n *\n * In dev (`vite serve`), it watches source/include directories and rebuilds on\n * changes. In build (`vite build`), it performs a one-shot build before bundling.\n *\n * @param options - Plugin options including build rules.\n * @returns Vite plugin instance.\n */\nconst emsdkEnv = (options: EmsdkVitePluginOptions): Plugin => {\n let resolvedConfig: ResolvedConfig | undefined;\n return {\n name: 'emsdkEnv',\n enforce: 'pre',\n configResolved(config) {\n resolvedConfig = config;\n },\n async buildStart() {\n if (!resolvedConfig) {\n throw new Error('Vite config was not resolved.');\n }\n if (resolvedConfig.command !== 'build') {\n return;\n }\n const logger = createViteLoggerAdapter(\n resolvedConfig.logger,\n resolvedConfig.logLevel ?? 'info',\n 'emsdk-env'\n );\n const buildOptions = createBuildOptions(options, resolvedConfig, logger);\n const buildKey = resolvedConfig.root;\n const existing = buildRuns.get(buildKey);\n if (existing) {\n await existing;\n return;\n }\n const run = (async () => {\n try {\n await buildWasm(buildOptions);\n } finally {\n buildRuns.delete(buildKey);\n }\n })();\n buildRuns.set(buildKey, run);\n await run;\n },\n async configureServer(server) {\n if (!resolvedConfig) {\n throw new Error('Vite config was not resolved.');\n }\n if (resolvedConfig.command !== 'serve') {\n return;\n }\n await setupDevServer(server, options, resolvedConfig);\n },\n };\n};\n\nexport default emsdkEnv;\n"],"names":["ms","createDebug","require$$0","exports","module","isAbsolute","resolve","relative","buildWasm"],"mappings":";;;;;;;;;;;;AAIA,MAAI,IAAI;AACR,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AAgBZ,OAAiB,SAAU,KAAK,SAAS;AACvC,cAAU,WAAW,CAAA;AACrB,QAAI,OAAO,OAAO;AAClB,QAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,aAAO,MAAM,GAAG;AAAA,IACpB,WAAa,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,aAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,IACrD;AACE,UAAM,IAAI;AAAA,MACR,0DACE,KAAK,UAAU,GAAG;AAAA;EAExB;AAUA,WAAS,MAAM,KAAK;AAClB,UAAM,OAAO,GAAG;AAChB,QAAI,IAAI,SAAS,KAAK;AACpB;AAAA,IACJ;AACE,QAAI,QAAQ,mIAAmI;AAAA,MAC7I;AAAA;AAEF,QAAI,CAAC,OAAO;AACV;AAAA,IACJ;AACE,QAAI,IAAI,WAAW,MAAM,CAAC,CAAC;AAC3B,QAAI,QAAQ,MAAM,CAAC,KAAK,MAAM,YAAW;AACzC,YAAQ,MAAI;AAAA,MACV,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,IAAI;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,IAAI;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eA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YAAY;AACrC,SAAO,QAAQ,GAAG,UAAU,YAAY;AACxC,SAAO,QAAQ,GAAG,UAAU,YAAY;AAExC,QAAM,WAAW,KAAK;AACxB;AAaA,MAAM,WAAW,CAAC,YAA4C;AAC5D,MAAI;AACJ,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,eAAe,QAAQ;AACrB,uBAAiB;AAAA,IACnB;AAAA,IACA,MAAM,aAAa;;AACjB,UAAI,CAAC,gBAAgB;AACnB,cAAM,IAAI,MAAM,+BAA+B;AAAA,MACjD;AACA,UAAI,eAAe,YAAY,SAAS;AACtC;AAAA,MACF;AACA,YAAM,SAAS;AAAA,QACb,eAAe;AAAA,SACf,oBAAe,aAAf,YAA2B;AAAA,QAC3B;AAAA,MAAA;AAEF,YAAM,eAAe,mBAAmB,SAAS,gBAAgB,MAAM;AACvE,YAAM,WAAW,eAAe;AAChC,YAAM,WAAW,UAAU,IAAI,QAAQ;AACvC,UAAI,UAAU;AACZ,cAAM;AACN;AAAA,MACF;AACA,YAAM,OAAO,YAAY;AACvB,YAAI;AACF,gBAAME,MAAAA,UAAU,YAAY;AAAA,QAC9B,UAAA;AACE,oBAAU,OAAO,QAAQ;AAAA,QAC3B;AAAA,MACF,GAAA;AACA,gBAAU,IAAI,UAAU,GAAG;AAC3B,YAAM;AAAA,IACR;AAAA,IACA,MAAM,gBAAgB,QAAQ;AAC5B,UAAI,CAAC,gBAAgB;AACnB,cAAM,IAAI,MAAM,+BAA+B;AAAA,MACjD;AACA,UAAI,eAAe,YAAY,SAAS;AACtC;AAAA,MACF;AACA,YAAM,eAAe,QAAQ,SAAS,cAAc;AAAA,IACtD;AAAA,EAAA;AAEJ;;","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"vite.cjs","sources":["../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../src/vite/logger.ts","../src/generated/packageMetadata.ts","../src/vite/index.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","// emsdk-env - Emscripten environment builder\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/emsdk-env\n\nimport type { LogLevel, Logger as ViteLogger } from 'vite';\nimport createDebug from 'debug';\n\nimport { Logger } from '../types';\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\n// Vite logger adapter with prefix\nexport const createViteLoggerAdapter = (\n viteLogger: ViteLogger,\n logLevel: LogLevel,\n prefix: string\n): Logger => {\n // Create debug instance with vite:plugin:prettier-max namespace\n const debug = createDebug('vite:plugin:emsdk-vite');\n\n return {\n debug: (msg: string) => {\n // Use debug module for debug level (enabled with vite --debug or DEBUG=vite:*)\n debug(msg);\n },\n info:\n logLevel !== 'silent'\n ? (msg: string) => viteLogger.info(`[${prefix}]: ${msg}`)\n : () => {},\n warn:\n logLevel === 'warn' || logLevel === 'info' || logLevel === 'error'\n ? (msg: string) => viteLogger.warn(`[${prefix}]: ${msg}`)\n : () => {},\n error:\n logLevel !== 'silent'\n ? (msg: string) => viteLogger.error(`[${prefix}]: ${msg}`)\n : () => {},\n };\n};\n","// @ts-nocheck\n// This file is auto-generated by screw-up plugin\n// Do not edit manually\n\nexport const name = \"emsdk-env\";\nexport const version = \"0.5.0\";\nexport const description = \"Emscripten environment builder\";\nexport const author = \"Kouji Matsui (@kekyo@mi.kekyo.net)\";\nexport const license = \"MIT\";\nexport const repository_url = \"https://github.com/kekyo/emsdk-env\";\nexport const git_commit_hash = \"f54983861d59656c8f39fd46d984c1b373100dde\";\n","// emsdk-env - Emscripten environment builder\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/emsdk-env\n\nimport { isAbsolute, relative, resolve } from 'path';\nimport type { Plugin, ResolvedConfig, ViteDevServer } from 'vite';\n\nimport type { BuildWasmOptions, Logger } from '../types';\nimport { buildWasm } from '../build';\nimport type { EmsdkVitePluginOptions } from './types';\nimport { createViteLoggerAdapter } from './logger';\nimport { createConsoleLogger } from '../logger';\nimport { git_commit_hash, version } from '../generated/packageMetadata';\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\nconst DEFAULT_WASM_SRC_DIR = 'wasm';\nconst DEFAULT_WASM_INCLUDE_DIR = 'include';\nconst buildRuns = new Map<string, Promise<void>>();\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\nconst resolvePath = (rootDir: string, value: string) =>\n isAbsolute(value) ? value : resolve(rootDir, value);\n\nconst expandPlaceholders = (\n value: string,\n env: Record<string, string>,\n label: string\n) =>\n value.replace(/\\{([A-Z0-9_]+)\\}/g, (_match, key: string) => {\n const replacement = env[key];\n if (replacement === undefined) {\n throw new Error(`Unknown placeholder {${key}} in ${label}.`);\n }\n return replacement;\n });\n\nconst expandArray = (\n values: readonly string[],\n env: Record<string, string>,\n label: string\n) => values.map((value) => expandPlaceholders(value, env, label));\n\nconst resolveIncludeDirs = (\n includeDirs: readonly string[],\n env: Record<string, string>,\n rootDir: string\n) => {\n const expanded = expandArray(includeDirs, env, 'includeDirs');\n return expanded.map((value) => resolvePath(rootDir, value));\n};\n\nconst createBuildOptions = (\n options: EmsdkVitePluginOptions,\n resolvedConfig: ResolvedConfig,\n logger: Logger\n): BuildWasmOptions => {\n const {\n emsdk,\n srcDir,\n includeDir,\n imports,\n outDir,\n libDir,\n buildDir,\n cleanupBuildDir,\n parallel,\n ...rule\n } = options;\n return {\n rule,\n root: resolvedConfig.root,\n logger,\n ...(emsdk !== undefined ? { emsdk } : {}),\n ...(srcDir !== undefined ? { srcDir } : {}),\n ...(includeDir !== undefined ? { includeDir } : {}),\n ...(imports !== undefined ? { imports } : {}),\n ...(outDir !== undefined ? { outDir } : {}),\n ...(libDir !== undefined ? { libDir } : {}),\n ...(buildDir !== undefined ? { buildDir } : {}),\n ...(cleanupBuildDir !== undefined ? { cleanupBuildDir } : {}),\n ...(parallel !== undefined ? { parallel } : {}),\n };\n};\n\nconst isSubPath = (parentDir: string, targetPath: string) => {\n const rel = relative(parentDir, targetPath);\n if (rel === '') {\n return true;\n }\n return !rel.startsWith('..') && !isAbsolute(rel);\n};\n\nconst resolveWatchTargets = (\n options: EmsdkVitePluginOptions,\n resolvedConfig: ResolvedConfig\n) => {\n const rootDir = resolvedConfig.root;\n const baseEnv = {\n ROOT: rootDir,\n };\n const rawSrcDir = expandPlaceholders(\n options.srcDir ?? DEFAULT_WASM_SRC_DIR,\n baseEnv,\n 'srcDir'\n );\n const rawIncludeDir = expandPlaceholders(\n options.includeDir ?? DEFAULT_WASM_INCLUDE_DIR,\n baseEnv,\n 'includeDir'\n );\n const srcDir = resolvePath(rootDir, rawSrcDir);\n const includeDir = resolvePath(rootDir, rawIncludeDir);\n\n const envWithDirs = {\n ROOT: rootDir,\n SRC_DIR: srcDir,\n INCLUDE_DIR: includeDir,\n };\n\n const patterns = new Set<string>();\n const baseDirs = new Set<string>();\n const resolvedIncludeDirs: string[] = [];\n patterns.add(srcDir);\n baseDirs.add(srcDir);\n\n const addIncludePatterns = (\n targetIncludeDirs: readonly string[] | undefined,\n targetName: string | undefined\n ) => {\n if (!targetIncludeDirs || targetIncludeDirs.length === 0) {\n return;\n }\n const env = targetName\n ? { ...envWithDirs, TARGET_NAME: targetName }\n : envWithDirs;\n const resolvedDirs = resolveIncludeDirs(targetIncludeDirs, env, rootDir);\n for (const dir of resolvedDirs) {\n patterns.add(dir);\n baseDirs.add(dir);\n resolvedIncludeDirs.push(dir);\n }\n };\n\n const commonIncludeDirs =\n options.common?.includeDirs === undefined\n ? [rawIncludeDir]\n : options.common.includeDirs;\n addIncludePatterns(commonIncludeDirs, undefined);\n for (const [targetName, target] of Object.entries(options.targets)) {\n addIncludePatterns(target.includeDirs, targetName);\n }\n\n return {\n srcDir,\n includeDirs: resolvedIncludeDirs,\n patterns: [...patterns],\n baseDirs: [...baseDirs],\n };\n};\n\nconst setupDevServer = async (\n server: ViteDevServer,\n options: EmsdkVitePluginOptions,\n resolvedConfig: ResolvedConfig,\n logger: Logger\n) => {\n const buildOptions = createBuildOptions(options, resolvedConfig, logger);\n\n const watchTargets = resolveWatchTargets(options, resolvedConfig);\n logger.debug(`watch root: ${resolvedConfig.root}`);\n logger.debug(`watch srcDir: ${watchTargets.srcDir}`);\n logger.debug(\n `watch includeDirs: ${\n watchTargets.includeDirs.length > 0\n ? watchTargets.includeDirs.join(', ')\n : '(none)'\n }`\n );\n logger.debug(`watch patterns: ${watchTargets.patterns.join(', ')}`);\n logger.debug(`watch baseDirs: ${watchTargets.baseDirs.join(', ')}`);\n if (watchTargets.patterns.length > 0) {\n server.watcher.add(watchTargets.patterns);\n }\n\n let buildQueue = Promise.resolve();\n const queueBuild = async (shouldReload: boolean) => {\n buildQueue = buildQueue.then(async () => {\n try {\n await buildWasm(buildOptions);\n if (shouldReload) {\n server.ws.send({ type: 'full-reload' });\n }\n } catch (error) {\n const message =\n error instanceof Error ? error.message : 'Unknown wasm build error.';\n logger.error(`Wasm build failed: ${message}`);\n }\n });\n return buildQueue;\n };\n\n const onWatchEvent = async (eventPath: string) => {\n const resolvedPath = isAbsolute(eventPath)\n ? eventPath\n : resolve(resolvedConfig.root, eventPath);\n if (!watchTargets.baseDirs.some((dir) => isSubPath(dir, resolvedPath))) {\n return;\n }\n await queueBuild(true);\n };\n\n server.watcher.on('add', onWatchEvent);\n server.watcher.on('change', onWatchEvent);\n server.watcher.on('unlink', onWatchEvent);\n\n await queueBuild(false);\n};\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Vite plugin that builds C/C++ sources into WASM using the Emscripten SDK.\n *\n * In dev (`vite serve`), it watches source/include directories and rebuilds on\n * changes. In build (`vite build`), it performs a one-shot build before bundling.\n *\n * @param options - Plugin options including build rules.\n * @returns Vite plugin instance.\n */\nconst emsdkEnv = (options: EmsdkVitePluginOptions): Plugin => {\n let resolvedConfig: ResolvedConfig | undefined;\n let logger = createConsoleLogger('emsdk-env'); // fallback console logger.\n return {\n name: 'emsdkEnv',\n enforce: 'pre',\n configResolved: (config) => {\n resolvedConfig = config;\n logger = createViteLoggerAdapter(\n resolvedConfig.logger,\n resolvedConfig.logLevel ?? 'info',\n 'emsdk-env'\n );\n logger.info(`${version}-${git_commit_hash}: Started.`);\n },\n buildStart: async () => {\n if (!resolvedConfig) {\n throw new Error('Vite config was not resolved.');\n }\n if (resolvedConfig.command !== 'build') {\n return;\n }\n const buildOptions = createBuildOptions(options, resolvedConfig, logger);\n const buildKey = resolvedConfig.root;\n const existing = buildRuns.get(buildKey);\n if (existing) {\n await existing;\n return;\n }\n const run = (async () => {\n try {\n await buildWasm(buildOptions);\n } finally {\n buildRuns.delete(buildKey);\n }\n })();\n buildRuns.set(buildKey, run);\n await run;\n },\n configureServer: async (server) => {\n if (!resolvedConfig) {\n throw new Error('Vite config was not resolved.');\n }\n if (resolvedConfig.command !== 'serve') {\n return;\n }\n await setupDevServer(server, options, resolvedConfig, logger);\n },\n };\n};\n\nexport default emsdkEnv;\n"],"names":["ms","createDebug","require$$0","exports","module","isAbsolute","resolve","relative","buildWasm","createConsoleLogger"],"mappings":";;;;;;;;;;;;AAIA,MAAI,IAAI;AACR,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AACZ,MAAI,IAAI,IAAI;AAgBZ,OAAiB,SAAU,KAAK,SAAS;AACvC,cAAU,WAAW,CAAA;AACrB,QAAI,OAAO,OAAO;AAClB,QAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,aAAO,MAAM,GAAG;AAAA,IACpB,WAAa,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,aAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,IACrD;AACE,UAAM,IAAI;AAAA,MACR,0DACE,KAAK,UAAU,GAAG;AAAA;EAExB;AAUA,WAAS,MAAM,KAAK;AAClB,UAAM,OAAO,GAAG;AAChB,QAAI,IAAI,SAAS,KAAK;AACpB;AAAA,IACJ;AACE,QAAI,QAAQ,mIAAmI;AAAA,MAC7I;AAAA;AAEF,QA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