@hpcc-js/esbuild-plugins 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,182 +1,5 @@
1
- // src/build.ts
2
- import * as process from "process";
3
- import { readFileSync } from "fs";
4
- import * as path from "path";
5
- import * as esbuild from "esbuild";
6
- import { umdWrapper } from "esbuild-plugin-umd-wrapper";
7
- import yargs from "yargs";
8
- import { hideBin } from "yargs/helpers";
9
- import { rebuildLogger, sfxWasm } from "@hpcc-js/esbuild-plugins";
10
- var pkg = JSON.parse(readFileSync(path.join(process.cwd(), "./package.json"), "utf8"));
11
- var NODE_MJS = pkg.type === "module" ? "js" : "mjs";
12
- var NODE_CJS = pkg.type === "module" ? "cjs" : "js";
13
- var myYargs = yargs(hideBin(process.argv));
14
- myYargs.usage("Usage: node esbuild.mjs [options]").demandCommand(0, 0).example("node esbuild.mjs --watch", "Bundle and watch for changes").option("mode", {
15
- alias: "m",
16
- describe: "Build mode",
17
- choices: ["development", "production"],
18
- default: "production"
19
- }).option("w", {
20
- alias: "watch",
21
- describe: "Watch for changes",
22
- type: "boolean"
23
- }).help("h").alias("h", "help").epilog("https://github.com/hpcc-systems/hpcc-js-wasm");
24
- var argv2 = await myYargs.argv;
25
- var isDevelopment = argv2.mode === "development";
26
- var isProduction = !isDevelopment;
27
- var isWatch = argv2.watch;
28
- function build2(config) {
29
- if (isDevelopment && Array.isArray(config.entryPoints)) {
30
- console.log("Start: ", config.entryPoints[0], config.outfile);
31
- }
32
- return esbuild.build({
33
- ...config,
34
- sourcemap: "linked",
35
- plugins: [
36
- ...config.plugins ?? [],
37
- sfxWasm()
38
- ]
39
- }).finally(() => {
40
- if (isDevelopment && Array.isArray(config.entryPoints)) {
41
- console.log("Stop: ", config.entryPoints[0], config.outfile);
42
- }
43
- });
44
- }
45
- async function watch(config) {
46
- await build2(config);
47
- return esbuild.context({
48
- ...config,
49
- sourcemap: "external",
50
- plugins: [
51
- ...config.plugins ?? [],
52
- rebuildLogger(config),
53
- sfxWasm()
54
- ]
55
- }).then((ctx) => {
56
- return ctx.watch();
57
- });
58
- }
59
- function buildWatch(config) {
60
- return isWatch ? watch(config) : build2(config);
61
- }
62
- function browserTpl(input, output, format = "esm", globalName, external = []) {
63
- return buildWatch({
64
- entryPoints: [input],
65
- outfile: `${output}.${format === "esm" ? "js" : "umd.js"}`,
66
- platform: "browser",
67
- target: "es2022",
68
- format,
69
- globalName,
70
- bundle: true,
71
- minify: isProduction,
72
- external,
73
- plugins: format === "umd" ? [umdWrapper()] : []
74
- });
75
- }
76
- function browserBoth(input, output, globalName, external = []) {
77
- return Promise.all([
78
- browserTpl(input, output, "esm", globalName, external),
79
- browserTpl(input, output, "umd", globalName, external)
80
- ]);
81
- }
82
- function nodeTpl(input, output, format = "esm", external = []) {
83
- return buildWatch({
84
- entryPoints: [input],
85
- outfile: `${output}.${format === "esm" ? NODE_MJS : NODE_CJS}`,
86
- platform: "node",
87
- target: "node20",
88
- format,
89
- bundle: true,
90
- minify: isProduction,
91
- external
92
- });
93
- }
94
- function neutralTpl(input, output, format = "esm", globalName, external = []) {
95
- return buildWatch({
96
- entryPoints: [input],
97
- outfile: `${output}.${format === "esm" ? "js" : "umd.js"}`,
98
- platform: "neutral",
99
- target: "es2022",
100
- format,
101
- globalName,
102
- bundle: true,
103
- minify: isProduction,
104
- external,
105
- plugins: format === "umd" ? [umdWrapper()] : []
106
- });
107
- }
108
- function nodeBoth(input, output, external = []) {
109
- return Promise.all([
110
- nodeTpl(input, output, "esm", external),
111
- nodeTpl(input, output, "cjs", external)
112
- ]);
113
- }
114
- function bothTpl(input, output, globalName, external = []) {
115
- return Promise.all([
116
- browserBoth(input, output, globalName, external),
117
- nodeTpl(input, output, "cjs", external)
118
- ]);
119
- }
120
-
121
- // src/exclude-sourcemap.ts
122
- import { readFile } from "fs/promises";
123
- function excludeSourcemap(opts) {
124
- return {
125
- name: "exclude-sourcemap",
126
- setup(build3) {
127
- build3.onLoad({ filter: opts.filter }, async (args) => {
128
- return {
129
- contents: await readFile(args.path, "utf8") + "\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==",
130
- loader: "default"
131
- };
132
- });
133
- }
134
- };
135
- }
136
-
137
- // src/problem-matcher.ts
138
- function problemMatcher() {
139
- return {
140
- name: "problem-matcher",
141
- setup(build3) {
142
- build3.onStart(() => {
143
- console.log("[watch] build started");
144
- });
145
- build3.onEnd((result) => {
146
- result.errors.forEach(({ text, location }) => {
147
- console.error(`\u2718 [ERROR] ${text}`);
148
- console.error(` ${location?.file}:${location?.line}:${location?.column}:`);
149
- });
150
- console.log("[watch] build finished");
151
- });
152
- }
153
- };
154
- }
155
-
156
- // src/rebuild-logger.ts
157
- function rebuildLogger2(opts) {
158
- return {
159
- name: "rebuild-logger",
160
- setup(build3) {
161
- build3.onStart(() => {
162
- console.log("[watch] build started");
163
- });
164
- build3.onEnd(() => {
165
- console.log(`Rebuilt ${opts.outfile ?? "Unknown"}`);
166
- });
167
- }
168
- };
169
- }
170
-
171
- // src/sfx-wrapper.ts
172
- import { readFile as readFile2 } from "fs/promises";
173
- import { existsSync } from "fs";
174
- import { Base91, Zstd } from "@hpcc-js/wasm";
175
- function tpl(wasmJsPath, base91Wasm, base91CompressedWasm) {
176
- const compressed = base91CompressedWasm.length + 8 * 1024 <= base91Wasm.length;
177
- const wasmJsExists = existsSync(wasmJsPath);
178
- return `${compressed ? 'import { decompress } from "fzstd";' : ""}
179
- ${wasmJsExists ? `import wrapper from "${wasmJsPath}";` : ""}
1
+ import*as i from"process";import{readFileSync as E}from"fs";import*as g from"path";import*as s from"esbuild";import{umdWrapper as f}from"esbuild-plugin-umd-wrapper";import F from"yargs";import{hideBin as J}from"yargs/helpers";function d(e){return{name:"rebuild-logger",setup(t){t.onStart(()=>{console.log("[watch] build started")}),t.onEnd(()=>{console.log(`Rebuilt ${e.outfile??"Unknown"}`)})}}}import{readFile as j}from"fs/promises";import{existsSync as $}from"fs";import{Base91 as v}from"@hpcc-js/wasm-base91";import{Zstd as S}from"@hpcc-js/wasm-zstd";function O(e,t,r){let o=r.length+8192<=t.length,n=$(e);return`${o?'import { decompress } from "fzstd";':""}
2
+ ${n?`import wrapper from "${e}";`:""}
180
3
 
181
4
  const table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_\`{|}~"';
182
5
 
@@ -214,22 +37,22 @@ function decode(raw: string): Uint8Array {
214
37
  return new Uint8Array(ret);
215
38
  }
216
39
 
217
- const blobStr = '${compressed ? base91CompressedWasm : base91Wasm}';
40
+ const blobStr = '${o?r:t}';
218
41
 
219
42
  let g_module: Uint8Array | undefined;
220
43
  let g_wasmBinary: Uint8Array | undefined;
221
44
  export default function() {
222
45
  if (!g_wasmBinary) {
223
- g_wasmBinary = ${compressed ? "decompress(decode(blobStr))" : "decode(blobStr)"};
46
+ g_wasmBinary = ${o?"decompress(decode(blobStr))":"decode(blobStr)"};
224
47
  }
225
- ${!wasmJsExists ? ` return g_wasmBinary;
226
- ` : ` if (!g_module) {
48
+ ${n?` if (!g_module) {
227
49
  g_module = wrapper({
228
50
  wasmBinary: g_wasmBinary,
229
51
  locateFile: undefined
230
52
  });
231
53
  }
232
54
  return g_module;
55
+ `:` return g_wasmBinary;
233
56
  `}
234
57
  }
235
58
 
@@ -237,46 +60,6 @@ export function reset() {
237
60
  if (g_module) {
238
61
  g_module = undefined;
239
62
  }
240
- } `.trim();
241
- }
242
- async function wrap(path2) {
243
- const base91 = await Base91.load();
244
- const zstd = await Zstd.load();
245
- const wasm = await readFile2(path2);
246
- path2 = path2.replace(/\.js$/, ".xxx");
247
- const wasmJsPath = path2.replace(/\.wasm$/, ".js");
248
- const base91Wasm = base91.encode(wasm);
249
- const compressedWasm = zstd.compress(wasm);
250
- const base91CompressedWasm = base91.encode(compressedWasm);
251
- return tpl(wasmJsPath, base91Wasm, base91CompressedWasm);
252
- }
253
- function sfxWasm2() {
254
- return {
255
- name: "sfx-wasm",
256
- setup(build3) {
257
- build3.onLoad({ filter: /\.wasm$/ }, async (args) => {
258
- return {
259
- contents: await wrap(args.path),
260
- loader: "ts"
261
- };
262
- });
263
- }
264
- };
265
- }
266
- export {
267
- bothTpl,
268
- browserBoth,
269
- browserTpl,
270
- build2 as build,
271
- buildWatch,
272
- excludeSourcemap,
273
- neutralTpl,
274
- nodeBoth,
275
- nodeTpl,
276
- problemMatcher,
277
- rebuildLogger2 as rebuildLogger,
278
- sfxWasm2 as sfxWasm,
279
- watch,
280
- wrap
281
- };
63
+ } `.trim()}async function _(e){let t=await v.load(),r=await S.load(),o=await j(e);e=e.replace(/\.js$/,".xxx");let n=e.replace(/\.wasm$/,".js"),h=t.encode(o),P=r.compress(o),B=t.encode(P);return O(n,h,B)}function l(){return{name:"sfx-wasm",setup(e){e.onLoad({filter:/\.wasm$/},async t=>({contents:await _(t.path),loader:"ts"}))}}}var b=JSON.parse(E(g.join(i.cwd(),"./package.json"),"utf8")),L=b.type==="module"?"js":"mjs",W=b.type==="module"?"cjs":"js",y=F(J(i.argv));y.usage("Usage: node esbuild.mjs [options]").demandCommand(0,0).example("node esbuild.mjs --watch","Bundle and watch for changes").option("mode",{alias:"m",describe:"Build mode",choices:["development","production"],default:"production"}).option("w",{alias:"watch",describe:"Watch for changes",type:"boolean"}).help("h").alias("h","help").epilog("https://github.com/hpcc-systems/hpcc-js-wasm");var w=await y.argv,a=w.mode==="development",m=!a,A=w.watch;function x(e){return a&&Array.isArray(e.entryPoints)&&console.log("Start: ",e.entryPoints[0],e.outfile),s.build({...e,sourcemap:"linked",plugins:[...e.plugins??[],l()]}).finally(()=>{a&&Array.isArray(e.entryPoints)&&console.log("Stop: ",e.entryPoints[0],e.outfile)})}async function R(e){return await x(e),s.context({...e,sourcemap:"external",plugins:[...e.plugins??[],d(e),l()]}).then(t=>t.watch())}function p(e){return A?R(e):x(e)}function c(e,t,r="esm",o,n=[]){return p({entryPoints:[e],outfile:`${t}.${r==="esm"?"js":"umd.js"}`,platform:"browser",target:"es2022",format:r,globalName:o,bundle:!0,minify:m,external:n,plugins:r==="umd"?[f()]:[]})}function U(e,t,r,o=[]){return Promise.all([c(e,t,"esm",r,o),c(e,t,"umd",r,o)])}function u(e,t,r="esm",o=[]){return p({entryPoints:[e],outfile:`${t}.${r==="esm"?L:W}`,platform:"node",target:"node20",format:r,bundle:!0,minify:m,external:o})}function q(e,t,r="esm",o,n=[]){return p({entryPoints:[e],outfile:`${t}.${r==="esm"?"js":"umd.js"}`,platform:"neutral",target:"es2022",format:r,globalName:o,bundle:!0,minify:m,external:n,plugins:r==="umd"?[f()]:[]})}function G(e,t,r=[]){return Promise.all([u(e,t,"esm",r),u(e,t,"cjs",r)])}function H(e,t,r,o=[]){return Promise.all([U(e,t,r,o),u(e,t,"cjs",o)])}import{readFile as z}from"fs/promises";function te(e){return{name:"exclude-sourcemap",setup(t){t.onLoad({filter:e.filter},async r=>({contents:await z(r.path,"utf8")+`
64
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==`,loader:"default"}))}}}function oe(){return{name:"problem-matcher",setup(e){e.onStart(()=>{console.log("[watch] build started")}),e.onEnd(t=>{t.errors.forEach(({text:r,location:o})=>{console.error(`\u2718 [ERROR] ${r}`),console.error(` ${o?.file}:${o?.line}:${o?.column}:`)}),console.log("[watch] build finished")})}}}export{H as bothTpl,U as browserBoth,c as browserTpl,x as build,p as buildWatch,te as excludeSourcemap,q as neutralTpl,G as nodeBoth,u as nodeTpl,oe as problemMatcher,d as rebuildLogger,l as sfxWasm,R as watch,_ as wrap};
282
65
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/build.ts", "../src/exclude-sourcemap.ts", "../src/problem-matcher.ts", "../src/rebuild-logger.ts", "../src/sfx-wrapper.ts"],
4
- "sourcesContent": ["import * as process from \"process\";\nimport { readFileSync } from \"fs\";\nimport * as path from \"path\";\nimport * as esbuild from \"esbuild\";\nimport type { BuildOptions, Format } from \"esbuild\";\nimport { umdWrapper } from \"esbuild-plugin-umd-wrapper\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { rebuildLogger, sfxWasm } from \"@hpcc-js/esbuild-plugins\";\n\nconst pkg = JSON.parse(readFileSync(path.join(process.cwd(), \"./package.json\"), \"utf8\"));\nconst NODE_MJS = pkg.type === \"module\" ? \"js\" : \"mjs\";\nconst NODE_CJS = pkg.type === \"module\" ? \"cjs\" : \"js\";\n\nconst myYargs = yargs(hideBin(process.argv));\nmyYargs\n .usage(\"Usage: node esbuild.mjs [options]\")\n .demandCommand(0, 0)\n .example(\"node esbuild.mjs --watch\", \"Bundle and watch for changes\")\n .option(\"mode\", {\n alias: \"m\",\n describe: \"Build mode\",\n choices: [\"development\", \"production\"],\n default: \"production\"\n })\n .option(\"w\", {\n alias: \"watch\",\n describe: \"Watch for changes\",\n type: \"boolean\"\n })\n .help(\"h\")\n .alias(\"h\", \"help\")\n .epilog(\"https://github.com/hpcc-systems/hpcc-js-wasm\")\n ;\nconst argv = await myYargs.argv;\nconst isDevelopment = argv.mode === \"development\";\nconst isProduction = !isDevelopment;\nconst isWatch = argv.watch;\n\nexport function build(config: BuildOptions) {\n if (isDevelopment && Array.isArray(config.entryPoints)) {\n console.log(\"Start: \", config.entryPoints[0], config.outfile);\n }\n return esbuild.build({\n ...config,\n sourcemap: \"linked\",\n plugins: [\n ...(config.plugins ?? []),\n sfxWasm()\n ]\n }).finally(() => {\n if (isDevelopment && Array.isArray(config.entryPoints)) {\n console.log(\"Stop: \", config.entryPoints[0], config.outfile);\n }\n });\n}\n\nexport async function watch(config: BuildOptions) {\n await build(config);\n return esbuild.context({\n ...config,\n sourcemap: \"external\",\n plugins: [\n ...(config.plugins ?? []),\n rebuildLogger(config),\n sfxWasm()\n ]\n }).then(ctx => {\n return ctx.watch();\n });\n}\n\nexport function buildWatch(config: BuildOptions) {\n return isWatch ? watch(config) : build(config);\n}\n\nexport function browserTpl(input: string, output: string, format: Format | \"umd\" = \"esm\", globalName?: string, external: string[] = []) {\n return buildWatch({\n entryPoints: [input],\n outfile: `${output}.${format === \"esm\" ? \"js\" : \"umd.js\"}`,\n platform: \"browser\",\n target: \"es2022\",\n format: format as Format,\n globalName,\n bundle: true,\n minify: isProduction,\n external,\n plugins: format === \"umd\" ? [umdWrapper()] : []\n });\n}\n\nexport function browserBoth(input: string, output: string, globalName?: string, external: string[] = []) {\n return Promise.all([\n browserTpl(input, output, \"esm\", globalName, external),\n browserTpl(input, output, \"umd\", globalName, external)\n ]);\n}\n\nexport function nodeTpl(input: string, output: string, format: Format | \"umd\" = \"esm\", external: string[] = []) {\n return buildWatch({\n entryPoints: [input],\n outfile: `${output}.${format === \"esm\" ? NODE_MJS : NODE_CJS}`,\n platform: \"node\",\n target: \"node20\",\n format: format as Format,\n bundle: true,\n minify: isProduction,\n external\n });\n}\n\nexport function neutralTpl(input: string, output: string, format: Format | \"umd\" = \"esm\", globalName?: string, external: string[] = []) {\n return buildWatch({\n entryPoints: [input],\n outfile: `${output}.${format === \"esm\" ? \"js\" : \"umd.js\"}`,\n platform: \"neutral\",\n target: \"es2022\",\n format: format as Format,\n globalName,\n bundle: true,\n minify: isProduction,\n external,\n plugins: format === \"umd\" ? [umdWrapper()] : []\n });\n}\n\nexport function nodeBoth(input: string, output: string, external: string[] = []) {\n return Promise.all([\n nodeTpl(input, output, \"esm\", external),\n nodeTpl(input, output, \"cjs\", external)\n ]);\n}\n\nexport function bothTpl(input: string, output: string, globalName?: string, external: string[] = []) {\n return Promise.all([\n browserBoth(input, output, globalName, external),\n nodeTpl(input, output, \"cjs\", external)\n ]);\n}\n", "import { readFile } from \"fs/promises\";\nimport type { PluginBuild, Plugin } from \"esbuild\";\n\nexport interface ExcludeSourcemapOptions {\n filter: RegExp;\n}\nexport function excludeSourcemap(opts: ExcludeSourcemapOptions): Plugin {\n return {\n name: \"exclude-sourcemap\",\n\n setup(build: PluginBuild) {\n build.onLoad({ filter: opts.filter }, async args => {\n return {\n contents: await readFile(args.path, \"utf8\") + \"\\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==\",\n loader: \"default\",\n };\n });\n },\n };\n}\n", "import type { PluginBuild, Plugin } from \"esbuild\";\n\nexport function problemMatcher(): Plugin {\n return {\n name: \"problem-matcher\",\n\n setup(build: PluginBuild) {\n\n build.onStart(() => {\n console.log(\"[watch] build started\");\n });\n\n build.onEnd((result) => {\n result.errors.forEach(({ text, location }) => {\n console.error(`\u2718 [ERROR] ${text}`);\n console.error(` ${location?.file}:${location?.line}:${location?.column}:`);\n });\n console.log(\"[watch] build finished\");\n });\n }\n };\n}\n", "import type { PluginBuild, Plugin } from \"esbuild\";\n\nexport interface RebuildLoggerOptions {\n outfile?: string;\n}\n\nexport function rebuildLogger(opts: RebuildLoggerOptions): Plugin {\n return {\n name: \"rebuild-logger\",\n\n setup(build: PluginBuild) {\n\n build.onStart(() => {\n console.log(\"[watch] build started\");\n });\n\n build.onEnd(() => {\n console.log(`Rebuilt ${opts.outfile ?? \"Unknown\"}`);\n });\n }\n };\n}\n", "import { readFile } from \"fs/promises\";\nimport { existsSync } from \"fs\";\nimport { Base91, Zstd } from \"@hpcc-js/wasm\";\nimport type { Plugin, PluginBuild } from \"esbuild\";\n\nfunction tpl(wasmJsPath: string, base91Wasm: string, base91CompressedWasm: string) {\n\n const compressed = (base91CompressedWasm.length + 8 * 1024) <= base91Wasm.length;\n const wasmJsExists = existsSync(wasmJsPath);\n\n return `\\\n${compressed ? 'import { decompress } from \"fzstd\";' : ''}\n${wasmJsExists ? `import wrapper from \"${wasmJsPath}\";` : ''}\n\nconst table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_\\`{|}~\"';\n\nfunction decode(raw: string): Uint8Array {\n const len = raw.length;\n const ret: number[] = [];\n\n let b = 0;\n let n = 0;\n let v = -1;\n\n for (let i = 0; i < len; i++) {\n const p = table.indexOf(raw[i]);\n /* istanbul ignore next */\n if (p === -1) continue;\n if (v < 0) {\n v = p;\n } else {\n v += p * 91;\n b |= v << n;\n n += (v & 8191) > 88 ? 13 : 14;\n do {\n ret.push(b & 0xff);\n b >>= 8;\n n -= 8;\n } while (n > 7);\n v = -1;\n }\n }\n\n if (v > -1) {\n ret.push((b | v << n) & 0xff);\n }\n\n return new Uint8Array(ret);\n}\n\nconst blobStr = '${compressed ? base91CompressedWasm : base91Wasm}';\n\nlet g_module: Uint8Array | undefined;\nlet g_wasmBinary: Uint8Array | undefined;\nexport default function() {\n if (!g_wasmBinary) {\n g_wasmBinary = ${compressed ? \"decompress(decode(blobStr))\" : \"decode(blobStr)\"};\n }\n${!wasmJsExists ? `\\\n return g_wasmBinary;\n`: `\\\n if (!g_module) {\n g_module = wrapper({\n wasmBinary: g_wasmBinary,\n locateFile: undefined\n });\n }\n return g_module;\n`}\n}\n\nexport function reset() {\n if (g_module) {\n g_module = undefined;\n }\n} `.trim();\n}\n\nexport async function wrap(path: string) {\n const base91 = await Base91.load();\n const zstd = await Zstd.load();\n\n const wasm = await readFile(path);\n path = path.replace(/\\.js$/, \".xxx\");\n const wasmJsPath = path.replace(/\\.wasm$/, \".js\");\n const base91Wasm = base91.encode(wasm);\n const compressedWasm = zstd.compress(wasm);\n const base91CompressedWasm = base91.encode(compressedWasm);\n\n return tpl(wasmJsPath, base91Wasm, base91CompressedWasm);\n}\n\nexport function sfxWasm(): Plugin {\n return {\n name: \"sfx-wasm\",\n\n setup(build: PluginBuild) {\n\n build.onLoad({ filter: /\\.wasm$/ }, async args => {\n return {\n contents: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A;AAAA;AAAA;AAAA;AAAA,mBAsCzC,aAAa,uBAAuB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAMxC,aAAa,gCAAgC,iBAAiB;AAAA;AAAA,EAErF,CAAC,eAAe;AAAA,IAEf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAQF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOG,KAAK;AACT;AAEA,eAAsB,KAAKC,OAAc;AACrC,QAAM,SAAS,MAAM,OAAO,KAAK;AACjC,QAAM,OAAO,MAAM,KAAK,KAAK;AAE7B,QAAM,OAAO,MAAMD,UAASC,KAAI;AAChC,EAAAA,QAAOA,MAAK,QAAQ,SAAS,MAAM;AACnC,QAAM,aAAaA,MAAK,QAAQ,WAAW,KAAK;AAChD,QAAM,aAAa,OAAO,OAAO,IAAI;AACrC,QAAM,iBAAiB,KAAK,SAAS,IAAI;AACzC,QAAM,uBAAuB,OAAO,OAAO,cAAc;AAEzD,SAAO,IAAI,YAAY,YAAY,oBAAoB;AAC3D;AAEO,SAASC,WAAkB;AAC9B,SAAO;AAAA,IACH,MAAM;AAAA,IAEN,MAAMC,QAAoB;AAEtB,MAAAA,OAAM,OAAO,EAAE,QAAQ,UAAU,GAAG,OAAM,SAAQ;AAC9C,eAAO;AAAA,UACH,UAAU,MAAM,KAAK,KAAK,IAAI;AAAA,UAC9B,QAAQ;AAAA,QACZ;AAAA,MACJ,CAAC;AAAA,IACL;AAAA,EACJ;AACJ;",
6
- "names": ["argv", "build", "build", "build", "rebuildLogger", "build", "readFile", "path", "sfxWasm", "build"]
3
+ "sources": ["../src/build.ts", "../src/rebuild-logger.ts", "../src/sfx-wrapper.ts", "../src/exclude-sourcemap.ts", "../src/problem-matcher.ts"],
4
+ "sourcesContent": ["import * as process from \"process\";\nimport { readFileSync } from \"fs\";\nimport * as path from \"path\";\nimport * as esbuild from \"esbuild\";\nimport type { BuildOptions, Format } from \"esbuild\";\nimport { umdWrapper } from \"esbuild-plugin-umd-wrapper\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { rebuildLogger } from \"./rebuild-logger.ts\";\nimport { sfxWasm } from \"./sfx-wrapper.ts\";\n\nconst pkg = JSON.parse(readFileSync(path.join(process.cwd(), \"./package.json\"), \"utf8\"));\nconst NODE_MJS = pkg.type === \"module\" ? \"js\" : \"mjs\";\nconst NODE_CJS = pkg.type === \"module\" ? \"cjs\" : \"js\";\n\nconst myYargs = yargs(hideBin(process.argv));\nmyYargs\n .usage(\"Usage: node esbuild.mjs [options]\")\n .demandCommand(0, 0)\n .example(\"node esbuild.mjs --watch\", \"Bundle and watch for changes\")\n .option(\"mode\", {\n alias: \"m\",\n describe: \"Build mode\",\n choices: [\"development\", \"production\"],\n default: \"production\"\n })\n .option(\"w\", {\n alias: \"watch\",\n describe: \"Watch for changes\",\n type: \"boolean\"\n })\n .help(\"h\")\n .alias(\"h\", \"help\")\n .epilog(\"https://github.com/hpcc-systems/hpcc-js-wasm\")\n ;\nconst argv = await myYargs.argv;\nconst isDevelopment = argv.mode === \"development\";\nconst isProduction = !isDevelopment;\nconst isWatch = argv.watch;\n\nexport function build(config: BuildOptions) {\n if (isDevelopment && Array.isArray(config.entryPoints)) {\n console.log(\"Start: \", config.entryPoints[0], config.outfile);\n }\n return esbuild.build({\n ...config,\n sourcemap: \"linked\",\n plugins: [\n ...(config.plugins ?? []),\n sfxWasm()\n ]\n }).finally(() => {\n if (isDevelopment && Array.isArray(config.entryPoints)) {\n console.log(\"Stop: \", config.entryPoints[0], config.outfile);\n }\n });\n}\n\nexport async function watch(config: BuildOptions) {\n await build(config);\n return esbuild.context({\n ...config,\n sourcemap: \"external\",\n plugins: [\n ...(config.plugins ?? []),\n rebuildLogger(config),\n sfxWasm()\n ]\n }).then(ctx => {\n return ctx.watch();\n });\n}\n\nexport function buildWatch(config: BuildOptions) {\n return isWatch ? watch(config) : build(config);\n}\n\nexport function browserTpl(input: string, output: string, format: Format | \"umd\" = \"esm\", globalName?: string, external: string[] = []) {\n return buildWatch({\n entryPoints: [input],\n outfile: `${output}.${format === \"esm\" ? \"js\" : \"umd.js\"}`,\n platform: \"browser\",\n target: \"es2022\",\n format: format as Format,\n globalName,\n bundle: true,\n minify: isProduction,\n external,\n plugins: format === \"umd\" ? [umdWrapper()] : []\n });\n}\n\nexport function browserBoth(input: string, output: string, globalName?: string, external: string[] = []) {\n return Promise.all([\n browserTpl(input, output, \"esm\", globalName, external),\n browserTpl(input, output, \"umd\", globalName, external)\n ]);\n}\n\nexport function nodeTpl(input: string, output: string, format: Format | \"umd\" = \"esm\", external: string[] = []) {\n return buildWatch({\n entryPoints: [input],\n outfile: `${output}.${format === \"esm\" ? NODE_MJS : NODE_CJS}`,\n platform: \"node\",\n target: \"node20\",\n format: format as Format,\n bundle: true,\n minify: isProduction,\n external\n });\n}\n\nexport function neutralTpl(input: string, output: string, format: Format | \"umd\" = \"esm\", globalName?: string, external: string[] = []) {\n return buildWatch({\n entryPoints: [input],\n outfile: `${output}.${format === \"esm\" ? \"js\" : \"umd.js\"}`,\n platform: \"neutral\",\n target: \"es2022\",\n format: format as Format,\n globalName,\n bundle: true,\n minify: isProduction,\n external,\n plugins: format === \"umd\" ? [umdWrapper()] : []\n });\n}\n\nexport function nodeBoth(input: string, output: string, external: string[] = []) {\n return Promise.all([\n nodeTpl(input, output, \"esm\", external),\n nodeTpl(input, output, \"cjs\", external)\n ]);\n}\n\nexport function bothTpl(input: string, output: string, globalName?: string, external: string[] = []) {\n return Promise.all([\n browserBoth(input, output, globalName, external),\n nodeTpl(input, output, \"cjs\", external)\n ]);\n}\n", "import type { PluginBuild, Plugin } from \"esbuild\";\n\nexport interface RebuildLoggerOptions {\n outfile?: string;\n}\n\nexport function rebuildLogger(opts: RebuildLoggerOptions): Plugin {\n return {\n name: \"rebuild-logger\",\n\n setup(build: PluginBuild) {\n\n build.onStart(() => {\n console.log(\"[watch] build started\");\n });\n\n build.onEnd(() => {\n console.log(`Rebuilt ${opts.outfile ?? \"Unknown\"}`);\n });\n }\n };\n}\n", "import { readFile } from \"fs/promises\";\nimport { existsSync } from \"fs\";\nimport { Base91 } from \"@hpcc-js/wasm-base91\";\nimport { Zstd } from \"@hpcc-js/wasm-zstd\";\nimport type { Plugin, PluginBuild } from \"esbuild\";\n\nfunction tpl(wasmJsPath: string, base91Wasm: string, base91CompressedWasm: string) {\n\n const compressed = (base91CompressedWasm.length + 8 * 1024) <= base91Wasm.length;\n const wasmJsExists = existsSync(wasmJsPath);\n\n return `\\\n${compressed ? 'import { decompress } from \"fzstd\";' : ''}\n${wasmJsExists ? `import wrapper from \"${wasmJsPath}\";` : ''}\n\nconst table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_\\`{|}~\"';\n\nfunction decode(raw: string): Uint8Array {\n const len = raw.length;\n const ret: number[] = [];\n\n let b = 0;\n let n = 0;\n let v = -1;\n\n for (let i = 0; i < len; i++) {\n const p = table.indexOf(raw[i]);\n /* istanbul ignore next */\n if (p === -1) continue;\n if (v < 0) {\n v = p;\n } else {\n v += p * 91;\n b |= v << n;\n n += (v & 8191) > 88 ? 13 : 14;\n do {\n ret.push(b & 0xff);\n b >>= 8;\n n -= 8;\n } while (n > 7);\n v = -1;\n }\n }\n\n if (v > -1) {\n ret.push((b | v << n) & 0xff);\n }\n\n return new Uint8Array(ret);\n}\n\nconst blobStr = '${compressed ? base91CompressedWasm : base91Wasm}';\n\nlet g_module: Uint8Array | undefined;\nlet g_wasmBinary: Uint8Array | undefined;\nexport default function() {\n if (!g_wasmBinary) {\n g_wasmBinary = ${compressed ? \"decompress(decode(blobStr))\" : \"decode(blobStr)\"};\n }\n${!wasmJsExists ? `\\\n return g_wasmBinary;\n`: `\\\n if (!g_module) {\n g_module = wrapper({\n wasmBinary: g_wasmBinary,\n locateFile: undefined\n });\n }\n return g_module;\n`}\n}\n\nexport function reset() {\n if (g_module) {\n g_module = undefined;\n }\n} `.trim();\n}\n\nexport async function wrap(path: string) {\n const base91 = await Base91.load();\n const zstd = await Zstd.load();\n\n const wasm = await readFile(path);\n path = path.replace(/\\.js$/, \".xxx\");\n const wasmJsPath = path.replace(/\\.wasm$/, \".js\");\n const base91Wasm = base91.encode(wasm);\n const compressedWasm = zstd.compress(wasm);\n const base91CompressedWasm = base91.encode(compressedWasm);\n\n return tpl(wasmJsPath, base91Wasm, base91CompressedWasm);\n}\n\nexport function sfxWasm(): Plugin {\n return {\n name: \"sfx-wasm\",\n\n setup(build: PluginBuild) {\n\n build.onLoad({ filter: /\\.wasm$/ }, async args => {\n return {\n contents: await wrap(args.path),\n loader: \"ts\",\n };\n });\n }\n }\n};\n", "import { readFile } from \"fs/promises\";\nimport type { PluginBuild, Plugin } from \"esbuild\";\n\nexport interface ExcludeSourcemapOptions {\n filter: RegExp;\n}\nexport function excludeSourcemap(opts: ExcludeSourcemapOptions): Plugin {\n return {\n name: \"exclude-sourcemap\",\n\n setup(build: PluginBuild) {\n build.onLoad({ filter: opts.filter }, async args => {\n return {\n contents: await readFile(args.path, \"utf8\") + \"\\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==\",\n loader: \"default\",\n };\n });\n },\n };\n}\n", "import type { PluginBuild, Plugin } from \"esbuild\";\n\nexport function problemMatcher(): Plugin {\n return {\n name: \"problem-matcher\",\n\n setup(build: PluginBuild) {\n\n build.onStart(() => {\n console.log(\"[watch] build started\");\n });\n\n build.onEnd((result) => {\n result.errors.forEach(({ text, location }) => {\n console.error(`\u2718 [ERROR] ${text}`);\n console.error(` ${location?.file}:${location?.line}:${location?.column}:`);\n });\n console.log(\"[watch] build finished\");\n });\n }\n };\n}\n"],
5
+ "mappings": "AAAA,UAAYA,MAAa,UACzB,OAAS,gBAAAC,MAAoB,KAC7B,UAAYC,MAAU,OACtB,UAAYC,MAAa,UAEzB,OA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AAO,OAAO,QAAQ,CAAC,CAAE,KAAAC,EAAM,SAAAC,CAAS,IAAM,CAC1C,QAAQ,MAAM,kBAAaD,CAAI,EAAE,EACjC,QAAQ,MAAM,OAAOC,GAAU,IAAI,IAAIA,GAAU,IAAI,IAAIA,GAAU,MAAM,GAAG,CAChF,CAAC,EACD,QAAQ,IAAI,wBAAwB,CACxC,CAAC,CACL,CACJ,CACJ",
6
+ "names": ["process", "readFileSync", "path", "esbuild", "umdWrapper", "yargs", "hideBin", "rebuildLogger", "opts", "build", "readFile", "existsSync", "Base91", "Zstd", "tpl", "wasmJsPath", "base91Wasm", "base91CompressedWasm", "compressed", "wasmJsExists", "wrap", "path", "base91", "zstd", "wasm", "compressedWasm", "sfxWasm", "build", "args", "pkg", "readFileSync", "NODE_MJS", "NODE_CJS", "myYargs", "yargs", "hideBin", "argv", "isDevelopment", "isProduction", "isWatch", "build", "config", "sfxWasm", "watch", "rebuildLogger", "ctx", "buildWatch", "browserTpl", "input", "output", "format", "globalName", "external", "umdWrapper", "browserBoth", "nodeTpl", "neutralTpl", "nodeBoth", "bothTpl", "readFile", "excludeSourcemap", "opts", "build", "args", "problemMatcher", "build", "result", "text", "location"]
7
7
  }