@hpcc-js/esbuild-plugins 1.8.5 → 1.8.7
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/LICENSE +43 -43
- package/README.md +45 -45
- package/dist/index.js.map +1 -1
- package/dist/sfx-wrapper.js.map +1 -1
- package/package.json +5 -4
- package/src/build.ts +177 -177
- package/src/exclude-sourcemap.ts +20 -20
- package/src/index.ts +8 -8
- package/src/inline-css.ts +44 -44
- package/src/package-version-plugin.ts +87 -87
- package/src/problem-matcher.ts +24 -24
- package/src/rebuild-logger.ts +24 -24
- package/src/remove-strict.ts +21 -21
- package/src/sfx-wrapper.ts +152 -152
- package/src/vite-utils.ts +259 -259
package/LICENSE
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
See the License for the specific language governing permissions and
|
|
13
|
-
limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Intersection Algorithms Provided by Kevin Lindsey
|
|
17
|
-
Copyright (c) 2000-2011, Kevin Lindsey
|
|
18
|
-
All rights reserved.
|
|
19
|
-
|
|
20
|
-
Redistribution and use in source and binary forms, with or without
|
|
21
|
-
modification, are permitted provided that the following conditions are met:
|
|
22
|
-
|
|
23
|
-
- Redistributions of source code must retain the above copyright notice,
|
|
24
|
-
this list of conditions and the following disclaimer.
|
|
25
|
-
|
|
26
|
-
- Redistributions in binary form must reproduce the above copyright
|
|
27
|
-
notice, this list of conditions and the following disclaimer in the
|
|
28
|
-
documentation and/or other materials provided with the distribution.
|
|
29
|
-
|
|
30
|
-
- Neither the name of this software nor the names of its contributors
|
|
31
|
-
may be used to endorse or promote products derived from this software
|
|
32
|
-
without specific prior written permission.
|
|
33
|
-
|
|
34
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
35
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
36
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
37
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
38
|
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
39
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
40
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
41
|
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
42
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
43
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Intersection Algorithms Provided by Kevin Lindsey
|
|
17
|
+
Copyright (c) 2000-2011, Kevin Lindsey
|
|
18
|
+
All rights reserved.
|
|
19
|
+
|
|
20
|
+
Redistribution and use in source and binary forms, with or without
|
|
21
|
+
modification, are permitted provided that the following conditions are met:
|
|
22
|
+
|
|
23
|
+
- Redistributions of source code must retain the above copyright notice,
|
|
24
|
+
this list of conditions and the following disclaimer.
|
|
25
|
+
|
|
26
|
+
- Redistributions in binary form must reproduce the above copyright
|
|
27
|
+
notice, this list of conditions and the following disclaimer in the
|
|
28
|
+
documentation and/or other materials provided with the distribution.
|
|
29
|
+
|
|
30
|
+
- Neither the name of this software nor the names of its contributors
|
|
31
|
+
may be used to endorse or promote products derived from this software
|
|
32
|
+
without specific prior written permission.
|
|
33
|
+
|
|
34
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
35
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
36
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
37
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
38
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
39
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
40
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
41
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
42
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
43
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
# esbuild-plugin-sfx-wasm
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
With npm:
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm i -D esbuild-plugin-sfx-wasm
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Use-cases
|
|
12
|
-
|
|
13
|
-
**The primary motivation for this plugin is to simplify the bundling and distribution of web assembly modules**
|
|
14
|
-
|
|
15
|
-
- Compresses the wasm module using Zstd
|
|
16
|
-
- Encodes the compressed wasm module as a base91 string
|
|
17
|
-
- Generates a standalone module that decodes and instantiates the wasm module on demand
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
### Build Config
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import esbuild from "esbuild";
|
|
25
|
-
import sfxWasm from "esbuild-plugin-sfx-wasm";
|
|
26
|
-
|
|
27
|
-
esbuild.build({
|
|
28
|
-
/* ... */
|
|
29
|
-
plugins: [
|
|
30
|
-
sfxWasm()
|
|
31
|
-
],
|
|
32
|
-
/* ... */
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Usage in your code
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
import loadCalculator from "../build/calculator.wasm";
|
|
40
|
-
|
|
41
|
-
async function add(a, b) {
|
|
42
|
-
const calc = await loadCalculator();
|
|
43
|
-
return calc.add(1, 2);
|
|
44
|
-
}
|
|
45
|
-
```
|
|
1
|
+
# esbuild-plugin-sfx-wasm
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
With npm:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i -D esbuild-plugin-sfx-wasm
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use-cases
|
|
12
|
+
|
|
13
|
+
**The primary motivation for this plugin is to simplify the bundling and distribution of web assembly modules**
|
|
14
|
+
|
|
15
|
+
- Compresses the wasm module using Zstd
|
|
16
|
+
- Encodes the compressed wasm module as a base91 string
|
|
17
|
+
- Generates a standalone module that decodes and instantiates the wasm module on demand
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Build Config
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import esbuild from "esbuild";
|
|
25
|
+
import sfxWasm from "esbuild-plugin-sfx-wasm";
|
|
26
|
+
|
|
27
|
+
esbuild.build({
|
|
28
|
+
/* ... */
|
|
29
|
+
plugins: [
|
|
30
|
+
sfxWasm()
|
|
31
|
+
],
|
|
32
|
+
/* ... */
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Usage in your code
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
import loadCalculator from "../build/calculator.wasm";
|
|
40
|
+
|
|
41
|
+
async function add(a, b) {
|
|
42
|
+
const calc = await loadCalculator();
|
|
43
|
+
return calc.add(1, 2);
|
|
44
|
+
}
|
|
45
|
+
```
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/build.ts", "../src/inline-css.ts", "../src/rebuild-logger.ts", "../src/exclude-sourcemap.ts", "../src/problem-matcher.ts", "../src/remove-strict.ts", "../src/vite-utils.ts", "../src/package-version-plugin.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, Loader, Plugin } from \"esbuild\";\nimport { umdWrapper } from \"esbuild-plugin-umd-wrapper\";\nimport * as copyStaticFiles from \"esbuild-copy-static-files\";\nimport { inlineCSS } from \"./inline-css.ts\";\nimport { rebuildLogger } from \"./rebuild-logger.ts\";\n\nexport { copyStaticFiles };\n\nexport const pkg = JSON.parse(readFileSync(path.join(process.cwd(), \"./package.json\"), \"utf8\"));\nexport const NODE_MJS = pkg.type === \"module\" ? \"js\" : \"mjs\";\nexport const NODE_CJS = pkg.type === \"module\" ? \"cjs\" : \"js\";\n\ninterface BuildOptionsEx extends Omit<BuildOptions, \"format\"> {\n format?: Format | \"umd\";\n}\n\nexport async function buildWatch(inputs: string[] | Record<string, string> | { in: string, out: string }[], config: BuildOptionsEx): Promise<void> {\n const isDevelopment = process.argv.includes(\"--development\");\n const isWatch = process.argv.includes(\"--watch\");\n const isProduction = !isDevelopment;\n\n config = {\n entryPoints: inputs,\n format: config.format ?? \"esm\",\n bundle: true,\n minify: isProduction,\n sourcemap: true,\n external: [\n ...config.external ?? []\n ],\n ...config,\n loader: {\n ...config.loader\n },\n outExtension: {\n ...config.outExtension\n },\n banner: {\n ...config.banner\n },\n footer: {\n ...config.footer\n },\n plugins: [\n ...(isWatch ? [rebuildLogger(config)] : []),\n ...config.plugins ?? [],\n inlineCSS()\n ],\n nodePaths: [\n ...config.nodePaths ?? []\n ]\n };\n const ctx = await esbuild.context(config as BuildOptions);\n\n if (isWatch) {\n await ctx.watch();\n } else {\n if (isDevelopment && Array.isArray(config.entryPoints)) {\n // eslint-disable-next-line no-console\n console.log(\"Start: \", config.entryPoints[0], config.outfile);\n }\n await ctx.rebuild();\n await ctx.dispose();\n if (isDevelopment && Array.isArray(config.entryPoints)) {\n // eslint-disable-next-line no-console\n console.log(\"Stop: \", config.entryPoints[0], config.outfile);\n }\n }\n}\n\nexport type TplOptions = {\n format?: Format | \"umd\";\n globalName?: string;\n libraryName?: string;\n keepNames?: boolean;\n external?: string[];\n plugins?: Plugin[];\n loader?: { [ext: string]: Loader };\n supported?: Record<string, boolean>;\n alias?: Record<string, string>;\n define?: { [key: string]: string };\n packages?: \"bundle\" | \"external\" | \"auto\";\n};\n\nfunction autoExternal(external?: string[]): string[] {\n return [\n ...pkg.dependencies ? Object.keys(pkg.dependencies) : [], ...pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],\n ...external ?? []\n ];\n}\n\nexport function browserTpl(input: string, output: string, options: TplOptions = {}) {\n options.format = options.format ?? \"esm\";\n\n return buildWatch([input], {\n format: options.format,\n external: options.external ?? [],\n outfile: `${output}.${options.format === \"esm\" ? \"js\" : `${options.format}.js`}`,\n platform: \"browser\",\n target: \"es2022\",\n globalName: options.globalName,\n keepNames: options.keepNames,\n plugins: options.format === \"umd\" ? [umdWrapper({ libraryName: options.libraryName }) as Plugin, ...options.plugins ?? []] : options.plugins,\n alias: options.alias,\n define: options.define,\n loader: options.loader,\n supported: options.supported,\n });\n}\n\nexport function nodeTpl(input: string, output: string, options: TplOptions = {}) {\n options.format = options.format ?? \"esm\";\n options.packages = options.packages ?? \"external\";\n if (options.packages === \"auto\") {\n options.external = autoExternal(options.external);\n }\n\n return buildWatch([input], {\n format: options.format,\n external: options.external ?? [],\n outfile: `${output}.${options.format === \"esm\" ? NODE_MJS : NODE_CJS}`,\n platform: \"node\",\n target: \"node22\",\n packages: options.packages === \"auto\" ? \"bundle\" : options.packages,\n globalName: options.globalName,\n keepNames: options.keepNames,\n plugins: options.plugins,\n alias: options.alias,\n define: options.define,\n loader: options.loader,\n supported: options.supported,\n });\n}\n\nexport function neutralTpl(input: string, output: string, options: TplOptions = {}) {\n options.format = options.format ?? \"esm\";\n\n return buildWatch([input], {\n format: options.format,\n external: options.external ?? [],\n outfile: `${output}.${options.format === \"esm\" ? \"js\" : `${options.format}.js`}`,\n platform: \"neutral\",\n target: \"es2022\",\n globalName: options.globalName,\n keepNames: options.keepNames,\n plugins: options.format === \"umd\" ? [umdWrapper({ libraryName: options.libraryName }) as Plugin, ...options.plugins ?? []] : options.plugins,\n alias: options.alias,\n define: options.define,\n loader: options.loader,\n supported: options.supported,\n });\n}\n\nexport function browserBoth(input: string, output: string, options: TplOptions = {}) {\n return Promise.all([\n browserTpl(input, output, { format: \"esm\", ...options }),\n browserTpl(input, output, { format: \"umd\", ...options })\n ]);\n}\n\nexport function nodeBoth(input: string, output: string, options: TplOptions = {}) {\n return Promise.all([\n nodeTpl(input, output, { format: \"esm\", ...options }),\n nodeTpl(input, output, { format: \"cjs\", ...options })\n ]);\n}\n\nexport function bothTpl(input: string, output: string, options: TplOptions = {}) {\n return Promise.all([\n browserBoth(input, output, { ...options }),\n nodeTpl(input, output, { format: \"cjs\", ...options })\n ]);\n}\n", "import type { PluginBuild, Plugin } from \"esbuild\";\nimport path from \"path\";\nimport crypto from \"crypto\";\nimport { readFile } from \"fs/promises\";\n\nexport function inlineCSS(options = {}) {\n return {\n name: \"inline-css\",\n\n setup(build: PluginBuild) {\n\n build.onLoad({ filter: /\\.(css)$/ }, async (args) => {\n if (build.initialOptions.platform === \"browser\") {\n const sourcePath = path.resolve(args.path);\n const sourceJS = await generateInjectCSS(sourcePath);\n return {\n contents: sourceJS,\n loader: \"js\"\n };\n }\n });\n },\n };\n}\n\nasync function generateInjectCSS(sourcePath: string) {\n const styleID = sha256(sourcePath);\n const sourceCSS = await readFile(sourcePath, \"utf8\");\n\n return `(function(){\n if (!document.getElementById('${styleID}')) {\n var e = document.createElement('style');\n e.id = '${styleID}';\n e.textContent = \\`${sourceCSS.split(\"\\\\25\").join(\"\\\\x15\")}\\`;\n document.head.appendChild(e);\n }\n })();`;\n}\n\nfunction sha256(sourcePath: string) {\n const hash = crypto.createHash(\"sha256\").update(sourcePath).digest(\"hex\");\n return hash.slice(0, 8); // Use the first 8 characters of the hash\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 // eslint-disable-next-line no-console\n console.log(\"[watch] build started\");\n });\n\n build.onEnd(() => {\n // eslint-disable-next-line no-console\n console.log(`Rebuilt ${opts.outfile ?? \"Unknown\"}`);\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 // eslint-disable-next-line no-console\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 // eslint-disable-next-line no-console\n console.log(\"[watch] build finished\");\n });\n }\n };\n}\n", "import { writeFileSync } from \"node:fs\";\nimport type { PluginBuild, Plugin } from \"esbuild\";\n\nexport function removeStrict(): Plugin {\n return {\n name: \"remove-strict\",\n setup(build: PluginBuild) {\n build.initialOptions.write = false;\n build.onEnd((result) => {\n result?.outputFiles?.forEach(file => {\n if (file.path.endsWith(\".js\")) {\n const contents = file.text.replace(/\"use strict\";/g, \"\");\n writeFileSync(file.path, contents, { encoding: \"utf8\" });\n } else {\n writeFileSync(file.path, file.contents, { encoding: \"binary\" });\n }\n });\n });\n }\n };\n}\n", "import { configDefaults, defineConfig, ViteUserConfig } from \"vitest/config\";\nimport cssInjectedByJsPlugin from \"vite-plugin-css-injected-by-js\";\nimport { viteStaticCopy } from \"vite-plugin-static-copy\";\nimport { packageVersionPlugin } from \"./package-version-plugin.ts\";\nimport { readFileSync } from \"fs\";\nimport { resolve, dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst alias = {\n \"d3-array\": \"@hpcc-js/common\",\n \"d3-brush\": \"@hpcc-js/common\",\n \"d3-collection\": \"@hpcc-js/common\",\n \"d3-color\": \"@hpcc-js/common\",\n \"d3-dispatch\": \"@hpcc-js/common\",\n \"d3-drag\": \"@hpcc-js/common\",\n \"d3-dsv\": \"@hpcc-js/common\",\n \"d3-ease\": \"@hpcc-js/common\",\n \"d3-format\": \"@hpcc-js/common\",\n \"d3-interpolate\": \"@hpcc-js/common\",\n \"d3-scale\": \"@hpcc-js/common\",\n \"d3-selection\": \"@hpcc-js/common\",\n \"d3-time-format\": \"@hpcc-js/common\",\n \"d3-transition\": \"@hpcc-js/common\",\n \"d3-zoom\": \"@hpcc-js/common\"\n};\n\n/**\n * Find and read the root package.json (monorepo root)\n * Walks up the directory tree looking for a package.json with \"workspaces\"\n */\nfunction getRootPackageVersion(): string {\n try {\n // Try to find root package.json by walking up from current file\n let currentDir = dirname(fileURLToPath(import.meta.url));\n let attempts = 0;\n const maxAttempts = 10;\n\n while (attempts < maxAttempts) {\n try {\n const pkgPath = resolve(currentDir, \"package.json\");\n const pkgContent = readFileSync(pkgPath, \"utf-8\");\n const pkg = JSON.parse(pkgContent);\n\n // Check if this is the root by looking for workspaces\n if (pkg.workspaces) {\n return pkg.version;\n }\n } catch {\n // File doesn't exist or couldn't be read, continue up\n }\n\n const parentDir = dirname(currentDir);\n if (parentDir === currentDir) {\n // Reached filesystem root\n break;\n }\n currentDir = parentDir;\n attempts++;\n }\n } catch (error) {\n console.warn(\"Could not read root package.json, using package version as build version:\", error);\n }\n\n return \"\";\n}\n\nexport function hpccBundleNames(pkg: any) {\n const external: string[] = [];\n const globals: { [id: string]: string } = {};\n for (const dep in pkg.dependencies ?? {}) {\n external.push(dep);\n globals[dep] = dep;\n }\n for (const dep in pkg.peerDependencies ?? {}) {\n external.push(dep);\n globals[dep] = dep;\n }\n return { alias: (pkg.name !== \"@hpcc-js/common\" && pkg.dependencies?.[\"@hpcc-js/common\"]) ? alias : {}, external, globals };\n}\n\nconst commonCoverageConfig = {\n reporter: [\"text\", \"json\", \"html\"],\n exclude: [\n ...configDefaults.coverage.exclude || [],\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/tests/**\",\n \"**/dist/**\",\n \"**/lib-*/**\",\n \"**/types/**\",\n ]\n};\n\nexport interface ViteHpccConfigOptions {\n /**\n * Additional external items\n */\n external?: string[];\n /**\n * Additional plugins to include in the configuration\n */\n plugins?: any[];\n /**\n * Whether to include font-awesome static copy (used by @hpcc-js/common)\n */\n includeFontAwesome?: boolean;\n /**\n * Custom entry point (defaults to \"src/index.ts\")\n */\n entry?: string;\n /**\n * Additional vite config options to merge\n */\n configOverrides?: Partial<ViteUserConfig>;\n}\n\nexport const nodeConfig = defineConfig({\n test: {\n name: \"node\",\n\n exclude: [\n ...configDefaults.exclude,\n \"**/*.browser.spec.{ts,js}\",\n \"**/node_modules/**\",\n \"**/.nx/**\",\n \"**/apps/**\",\n \"**/components/**\",\n \"**/demos/**\",\n ],\n environment: \"node\",\n setupFiles: [],\n coverage: {\n provider: \"v8\",\n ...commonCoverageConfig\n }\n }\n});\n\nexport const browserConfig = defineConfig({\n test: {\n exclude: [\n ...configDefaults.exclude,\n \"@hpcc-js/dgrid-shim\",\n \"**/*.node.spec.{ts,js}\",\n \"**/node_modules/**\",\n \"**/.nx/**\",\n \"**/apps/**\",\n \"**/components/**\",\n \"**/demos/**\",\n \"**/src/**\",\n ],\n browser: {\n enabled: true,\n provider: \"playwright\",\n instances: [{\n name: \"chromium\",\n browser: \"chromium\",\n headless: true,\n //@ts-expect-error\n launch: {\n args: [\"--disable-web-security\"],\n }\n }],\n screenshotFailures: false,\n },\n setupFiles: [],\n coverage: {\n provider: \"istanbul\",\n ...commonCoverageConfig\n }\n }\n});\n\nexport function createHpccViteConfig(pkg: any, options: ViteHpccConfigOptions = {}): ViteUserConfig {\n const {\n external: additionalExternal = [],\n plugins: additionalPlugins = [],\n includeFontAwesome = false,\n entry = \"src/index.ts\",\n configOverrides = {},\n } = options;\n\n const { alias, external, globals } = hpccBundleNames(pkg);\n const allExternals = [...external, ...additionalExternal];\n\n // Get build version from root package.json\n const buildVersion = getRootPackageVersion() || pkg.version;\n\n const allPlugins = [\n packageVersionPlugin({ pkg, buildVersion }),\n cssInjectedByJsPlugin({\n topExecutionPriority: false\n }),\n ...additionalPlugins\n ];\n\n if (includeFontAwesome) {\n allPlugins.push(\n viteStaticCopy({\n targets: [\n {\n src: \"../../node_modules/font-awesome/fonts\",\n dest: \"../font-awesome\"\n }, {\n src: \"../../node_modules/font-awesome/css\",\n dest: \"../font-awesome\",\n }\n ]\n })\n );\n }\n\n const defaultLibConfig = {\n entry,\n name: pkg.name,\n fileName: \"index\",\n };\n\n const config: ViteUserConfig = {\n build: {\n lib: {\n ...defaultLibConfig,\n ...(configOverrides.build?.lib || {})\n },\n rollupOptions: {\n external: allExternals,\n output: {\n globals,\n },\n ...(configOverrides.build?.rollupOptions || {})\n },\n // Preserve class names and function names in minified output\n minify: \"terser\",\n terserOptions: {\n keep_classnames: true,\n mangle: {\n keep_classnames: true,\n }\n },\n sourcemap: true,\n ...(configOverrides.build ? Object.fromEntries(Object.entries(configOverrides.build).filter(([key]) => key !== \"lib\" && key !== \"rollupOptions\")) : {})\n },\n resolve: {\n alias,\n ...(configOverrides.resolve || {})\n },\n esbuild: {\n keepNames: true,\n ...(configOverrides.esbuild || {})\n },\n plugins: allPlugins,\n test: {\n projects: [nodeConfig, browserConfig],\n ...(configOverrides.test || {})\n },\n ...Object.fromEntries(Object.entries(configOverrides).filter(([key]) => ![\"build\", \"resolve\", \"esbuild\", \"plugins\"].includes(key)))\n };\n\n return defineConfig(config);\n}", "import type { Plugin } from \"vite\";\n\nexport interface PackageVersionPluginOptions {\n /**\n * Package.json object containing name and version\n */\n pkg: {\n name: string;\n version: string;\n };\n /**\n * Build version (typically from root package.json)\n * If not provided, defaults to pkg.version\n */\n buildVersion?: string;\n /**\n * Placeholder for package name (default: \"__PACKAGE_NAME__\")\n */\n namePlaceholder?: string;\n /**\n * Placeholder for package version (default: \"__PACKAGE_VERSION__\")\n */\n versionPlaceholder?: string;\n /**\n * Placeholder for build version (default: \"__BUILD_VERSION__\")\n */\n buildVersionPlaceholder?: string;\n}\n\n/**\n * Vite plugin to replace package version placeholders during build\n * This allows keeping version information in source files as placeholders\n * that get replaced with actual values from package.json during the build\n */\nexport function packageVersionPlugin(options: PackageVersionPluginOptions): Plugin {\n const {\n pkg,\n buildVersion = pkg.version,\n namePlaceholder = \"__PACKAGE_NAME__\",\n versionPlaceholder = \"__PACKAGE_VERSION__\",\n buildVersionPlaceholder = \"__BUILD_VERSION__\"\n } = options;\n\n return {\n name: \"hpcc-package-version-plugin\",\n enforce: \"pre\",\n transform(code: string, id: string) {\n // Only process TypeScript/JavaScript files\n if (!id.endsWith(\".ts\") && !id.endsWith(\".js\")) {\n return null;\n }\n\n // Check if the file contains any placeholders\n if (!code.includes(namePlaceholder) &&\n !code.includes(versionPlaceholder) &&\n !code.includes(buildVersionPlaceholder)) {\n return null;\n }\n\n // Replace placeholders with actual values\n let transformedCode = code;\n if (code.includes(namePlaceholder)) {\n transformedCode = transformedCode.replace(\n new RegExp(namePlaceholder, \"g\"),\n pkg.name\n );\n }\n if (code.includes(versionPlaceholder)) {\n transformedCode = transformedCode.replace(\n new RegExp(versionPlaceholder, \"g\"),\n pkg.version\n );\n }\n if (code.includes(buildVersionPlaceholder)) {\n transformedCode = transformedCode.replace(\n new RegExp(buildVersionPlaceholder, \"g\"),\n buildVersion\n );\n }\n\n return {\n code: transformedCode,\n map: null // Could generate source map if needed\n };\n }\n };\n}\n"],
|
|
4
|
+
"sourcesContent": ["import * as process from \"process\";\r\nimport { readFileSync } from \"fs\";\r\nimport * as path from \"path\";\r\nimport * as esbuild from \"esbuild\";\r\nimport type { BuildOptions, Format, Loader, Plugin } from \"esbuild\";\r\nimport { umdWrapper } from \"esbuild-plugin-umd-wrapper\";\r\nimport * as copyStaticFiles from \"esbuild-copy-static-files\";\r\nimport { inlineCSS } from \"./inline-css.ts\";\r\nimport { rebuildLogger } from \"./rebuild-logger.ts\";\r\n\r\nexport { copyStaticFiles };\r\n\r\nexport const pkg = JSON.parse(readFileSync(path.join(process.cwd(), \"./package.json\"), \"utf8\"));\r\nexport const NODE_MJS = pkg.type === \"module\" ? \"js\" : \"mjs\";\r\nexport const NODE_CJS = pkg.type === \"module\" ? \"cjs\" : \"js\";\r\n\r\ninterface BuildOptionsEx extends Omit<BuildOptions, \"format\"> {\r\n format?: Format | \"umd\";\r\n}\r\n\r\nexport async function buildWatch(inputs: string[] | Record<string, string> | { in: string, out: string }[], config: BuildOptionsEx): Promise<void> {\r\n const isDevelopment = process.argv.includes(\"--development\");\r\n const isWatch = process.argv.includes(\"--watch\");\r\n const isProduction = !isDevelopment;\r\n\r\n config = {\r\n entryPoints: inputs,\r\n format: config.format ?? \"esm\",\r\n bundle: true,\r\n minify: isProduction,\r\n sourcemap: true,\r\n external: [\r\n ...config.external ?? []\r\n ],\r\n ...config,\r\n loader: {\r\n ...config.loader\r\n },\r\n outExtension: {\r\n ...config.outExtension\r\n },\r\n banner: {\r\n ...config.banner\r\n },\r\n footer: {\r\n ...config.footer\r\n },\r\n plugins: [\r\n ...(isWatch ? [rebuildLogger(config)] : []),\r\n ...config.plugins ?? [],\r\n inlineCSS()\r\n ],\r\n nodePaths: [\r\n ...config.nodePaths ?? []\r\n ]\r\n };\r\n const ctx = await esbuild.context(config as BuildOptions);\r\n\r\n if (isWatch) {\r\n await ctx.watch();\r\n } else {\r\n if (isDevelopment && Array.isArray(config.entryPoints)) {\r\n // eslint-disable-next-line no-console\r\n console.log(\"Start: \", config.entryPoints[0], config.outfile);\r\n }\r\n await ctx.rebuild();\r\n await ctx.dispose();\r\n if (isDevelopment && Array.isArray(config.entryPoints)) {\r\n // eslint-disable-next-line no-console\r\n console.log(\"Stop: \", config.entryPoints[0], config.outfile);\r\n }\r\n }\r\n}\r\n\r\nexport type TplOptions = {\r\n format?: Format | \"umd\";\r\n globalName?: string;\r\n libraryName?: string;\r\n keepNames?: boolean;\r\n external?: string[];\r\n plugins?: Plugin[];\r\n loader?: { [ext: string]: Loader };\r\n supported?: Record<string, boolean>;\r\n alias?: Record<string, string>;\r\n define?: { [key: string]: string };\r\n packages?: \"bundle\" | \"external\" | \"auto\";\r\n};\r\n\r\nfunction autoExternal(external?: string[]): string[] {\r\n return [\r\n ...pkg.dependencies ? Object.keys(pkg.dependencies) : [], ...pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],\r\n ...external ?? []\r\n ];\r\n}\r\n\r\nexport function browserTpl(input: string, output: string, options: TplOptions = {}) {\r\n options.format = options.format ?? \"esm\";\r\n\r\n return buildWatch([input], {\r\n format: options.format,\r\n external: options.external ?? [],\r\n outfile: `${output}.${options.format === \"esm\" ? \"js\" : `${options.format}.js`}`,\r\n platform: \"browser\",\r\n target: \"es2022\",\r\n globalName: options.globalName,\r\n keepNames: options.keepNames,\r\n plugins: options.format === \"umd\" ? [umdWrapper({ libraryName: options.libraryName }) as Plugin, ...options.plugins ?? []] : options.plugins,\r\n alias: options.alias,\r\n define: options.define,\r\n loader: options.loader,\r\n supported: options.supported,\r\n });\r\n}\r\n\r\nexport function nodeTpl(input: string, output: string, options: TplOptions = {}) {\r\n options.format = options.format ?? \"esm\";\r\n options.packages = options.packages ?? \"external\";\r\n if (options.packages === \"auto\") {\r\n options.external = autoExternal(options.external);\r\n }\r\n\r\n return buildWatch([input], {\r\n format: options.format,\r\n external: options.external ?? [],\r\n outfile: `${output}.${options.format === \"esm\" ? NODE_MJS : NODE_CJS}`,\r\n platform: \"node\",\r\n target: \"node22\",\r\n packages: options.packages === \"auto\" ? \"bundle\" : options.packages,\r\n globalName: options.globalName,\r\n keepNames: options.keepNames,\r\n plugins: options.plugins,\r\n alias: options.alias,\r\n define: options.define,\r\n loader: options.loader,\r\n supported: options.supported,\r\n });\r\n}\r\n\r\nexport function neutralTpl(input: string, output: string, options: TplOptions = {}) {\r\n options.format = options.format ?? \"esm\";\r\n\r\n return buildWatch([input], {\r\n format: options.format,\r\n external: options.external ?? [],\r\n outfile: `${output}.${options.format === \"esm\" ? \"js\" : `${options.format}.js`}`,\r\n platform: \"neutral\",\r\n target: \"es2022\",\r\n globalName: options.globalName,\r\n keepNames: options.keepNames,\r\n plugins: options.format === \"umd\" ? [umdWrapper({ libraryName: options.libraryName }) as Plugin, ...options.plugins ?? []] : options.plugins,\r\n alias: options.alias,\r\n define: options.define,\r\n loader: options.loader,\r\n supported: options.supported,\r\n });\r\n}\r\n\r\nexport function browserBoth(input: string, output: string, options: TplOptions = {}) {\r\n return Promise.all([\r\n browserTpl(input, output, { format: \"esm\", ...options }),\r\n browserTpl(input, output, { format: \"umd\", ...options })\r\n ]);\r\n}\r\n\r\nexport function nodeBoth(input: string, output: string, options: TplOptions = {}) {\r\n return Promise.all([\r\n nodeTpl(input, output, { format: \"esm\", ...options }),\r\n nodeTpl(input, output, { format: \"cjs\", ...options })\r\n ]);\r\n}\r\n\r\nexport function bothTpl(input: string, output: string, options: TplOptions = {}) {\r\n return Promise.all([\r\n browserBoth(input, output, { ...options }),\r\n nodeTpl(input, output, { format: \"cjs\", ...options })\r\n ]);\r\n}\r\n", "import type { PluginBuild, Plugin } from \"esbuild\";\r\nimport path from \"path\";\r\nimport crypto from \"crypto\";\r\nimport { readFile } from \"fs/promises\";\r\n\r\nexport function inlineCSS(options = {}) {\r\n return {\r\n name: \"inline-css\",\r\n\r\n setup(build: PluginBuild) {\r\n\r\n build.onLoad({ filter: /\\.(css)$/ }, async (args) => {\r\n if (build.initialOptions.platform === \"browser\") {\r\n const sourcePath = path.resolve(args.path);\r\n const sourceJS = await generateInjectCSS(sourcePath);\r\n return {\r\n contents: sourceJS,\r\n loader: \"js\"\r\n };\r\n }\r\n });\r\n },\r\n };\r\n}\r\n\r\nasync function generateInjectCSS(sourcePath: string) {\r\n const styleID = sha256(sourcePath);\r\n const sourceCSS = await readFile(sourcePath, \"utf8\");\r\n\r\n return `(function(){\r\n if (!document.getElementById('${styleID}')) {\r\n var e = document.createElement('style');\r\n e.id = '${styleID}';\r\n e.textContent = \\`${sourceCSS.split(\"\\\\25\").join(\"\\\\x15\")}\\`;\r\n document.head.appendChild(e);\r\n }\r\n })();`;\r\n}\r\n\r\nfunction sha256(sourcePath: string) {\r\n const hash = crypto.createHash(\"sha256\").update(sourcePath).digest(\"hex\");\r\n return hash.slice(0, 8); // Use the first 8 characters of the hash\r\n}\r\n\r\n", "import type { PluginBuild, Plugin } from \"esbuild\";\r\n\r\nexport interface RebuildLoggerOptions {\r\n outfile?: string;\r\n}\r\n\r\nexport function rebuildLogger(opts: RebuildLoggerOptions): Plugin {\r\n return {\r\n name: \"rebuild-logger\",\r\n\r\n setup(build: PluginBuild) {\r\n\r\n build.onStart(() => {\r\n // eslint-disable-next-line no-console\r\n console.log(\"[watch] build started\");\r\n });\r\n\r\n build.onEnd(() => {\r\n // eslint-disable-next-line no-console\r\n console.log(`Rebuilt ${opts.outfile ?? \"Unknown\"}`);\r\n });\r\n }\r\n };\r\n}\r\n", "import { readFile } from \"fs/promises\";\r\nimport type { PluginBuild, Plugin } from \"esbuild\";\r\n\r\nexport interface ExcludeSourcemapOptions {\r\n filter: RegExp;\r\n}\r\nexport function excludeSourcemap(opts: ExcludeSourcemapOptions): Plugin {\r\n return {\r\n name: \"exclude-sourcemap\",\r\n\r\n setup(build: PluginBuild) {\r\n build.onLoad({ filter: opts.filter }, async args => {\r\n return {\r\n contents: await readFile(args.path, \"utf8\") + \"\\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==\",\r\n loader: \"default\",\r\n };\r\n });\r\n },\r\n };\r\n}\r\n", "import type { PluginBuild, Plugin } from \"esbuild\";\r\n\r\nexport function problemMatcher(): Plugin {\r\n return {\r\n name: \"problem-matcher\",\r\n\r\n setup(build: PluginBuild) {\r\n\r\n build.onStart(() => {\r\n // eslint-disable-next-line no-console\r\n console.log(\"[watch] build started\");\r\n });\r\n\r\n build.onEnd((result) => {\r\n result.errors.forEach(({ text, location }) => {\r\n console.error(`\u2718 [ERROR] ${text}`);\r\n console.error(` ${location?.file}:${location?.line}:${location?.column}:`);\r\n });\r\n // eslint-disable-next-line no-console\r\n console.log(\"[watch] build finished\");\r\n });\r\n }\r\n };\r\n}\r\n", "import { writeFileSync } from \"node:fs\";\r\nimport type { PluginBuild, Plugin } from \"esbuild\";\r\n\r\nexport function removeStrict(): Plugin {\r\n return {\r\n name: \"remove-strict\",\r\n setup(build: PluginBuild) {\r\n build.initialOptions.write = false;\r\n build.onEnd((result) => {\r\n result?.outputFiles?.forEach(file => {\r\n if (file.path.endsWith(\".js\")) {\r\n const contents = file.text.replace(/\"use strict\";/g, \"\");\r\n writeFileSync(file.path, contents, { encoding: \"utf8\" });\r\n } else {\r\n writeFileSync(file.path, file.contents, { encoding: \"binary\" });\r\n }\r\n });\r\n });\r\n }\r\n };\r\n}\r\n", "import { configDefaults, defineConfig, ViteUserConfig } from \"vitest/config\";\r\nimport cssInjectedByJsPlugin from \"vite-plugin-css-injected-by-js\";\r\nimport { viteStaticCopy } from \"vite-plugin-static-copy\";\r\nimport { packageVersionPlugin } from \"./package-version-plugin.ts\";\r\nimport { readFileSync } from \"fs\";\r\nimport { resolve, dirname } from \"path\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst alias = {\r\n \"d3-array\": \"@hpcc-js/common\",\r\n \"d3-brush\": \"@hpcc-js/common\",\r\n \"d3-collection\": \"@hpcc-js/common\",\r\n \"d3-color\": \"@hpcc-js/common\",\r\n \"d3-dispatch\": \"@hpcc-js/common\",\r\n \"d3-drag\": \"@hpcc-js/common\",\r\n \"d3-dsv\": \"@hpcc-js/common\",\r\n \"d3-ease\": \"@hpcc-js/common\",\r\n \"d3-format\": \"@hpcc-js/common\",\r\n \"d3-interpolate\": \"@hpcc-js/common\",\r\n \"d3-scale\": \"@hpcc-js/common\",\r\n \"d3-selection\": \"@hpcc-js/common\",\r\n \"d3-time-format\": \"@hpcc-js/common\",\r\n \"d3-transition\": \"@hpcc-js/common\",\r\n \"d3-zoom\": \"@hpcc-js/common\"\r\n};\r\n\r\n/**\r\n * Find and read the root package.json (monorepo root)\r\n * Walks up the directory tree looking for a package.json with \"workspaces\"\r\n */\r\nfunction getRootPackageVersion(): string {\r\n try {\r\n // Try to find root package.json by walking up from current file\r\n let currentDir = dirname(fileURLToPath(import.meta.url));\r\n let attempts = 0;\r\n const maxAttempts = 10;\r\n\r\n while (attempts < maxAttempts) {\r\n try {\r\n const pkgPath = resolve(currentDir, \"package.json\");\r\n const pkgContent = readFileSync(pkgPath, \"utf-8\");\r\n const pkg = JSON.parse(pkgContent);\r\n\r\n // Check if this is the root by looking for workspaces\r\n if (pkg.workspaces) {\r\n return pkg.version;\r\n }\r\n } catch {\r\n // File doesn't exist or couldn't be read, continue up\r\n }\r\n\r\n const parentDir = dirname(currentDir);\r\n if (parentDir === currentDir) {\r\n // Reached filesystem root\r\n break;\r\n }\r\n currentDir = parentDir;\r\n attempts++;\r\n }\r\n } catch (error) {\r\n console.warn(\"Could not read root package.json, using package version as build version:\", error);\r\n }\r\n\r\n return \"\";\r\n}\r\n\r\nexport function hpccBundleNames(pkg: any) {\r\n const external: string[] = [];\r\n const globals: { [id: string]: string } = {};\r\n for (const dep in pkg.dependencies ?? {}) {\r\n external.push(dep);\r\n globals[dep] = dep;\r\n }\r\n for (const dep in pkg.peerDependencies ?? {}) {\r\n external.push(dep);\r\n globals[dep] = dep;\r\n }\r\n return { alias: (pkg.name !== \"@hpcc-js/common\" && pkg.dependencies?.[\"@hpcc-js/common\"]) ? alias : {}, external, globals };\r\n}\r\n\r\nconst commonCoverageConfig = {\r\n reporter: [\"text\", \"json\", \"html\"],\r\n exclude: [\r\n ...configDefaults.coverage.exclude || [],\r\n \"**/*.spec.ts\",\r\n \"**/*.test.ts\",\r\n \"**/tests/**\",\r\n \"**/dist/**\",\r\n \"**/lib-*/**\",\r\n \"**/types/**\",\r\n ]\r\n};\r\n\r\nexport interface ViteHpccConfigOptions {\r\n /**\r\n * Additional external items\r\n */\r\n external?: string[];\r\n /**\r\n * Additional plugins to include in the configuration\r\n */\r\n plugins?: any[];\r\n /**\r\n * Whether to include font-awesome static copy (used by @hpcc-js/common)\r\n */\r\n includeFontAwesome?: boolean;\r\n /**\r\n * Custom entry point (defaults to \"src/index.ts\")\r\n */\r\n entry?: string;\r\n /**\r\n * Additional vite config options to merge\r\n */\r\n configOverrides?: Partial<ViteUserConfig>;\r\n}\r\n\r\nexport const nodeConfig = defineConfig({\r\n test: {\r\n name: \"node\",\r\n\r\n exclude: [\r\n ...configDefaults.exclude,\r\n \"**/*.browser.spec.{ts,js}\",\r\n \"**/node_modules/**\",\r\n \"**/.nx/**\",\r\n \"**/apps/**\",\r\n \"**/components/**\",\r\n \"**/demos/**\",\r\n ],\r\n environment: \"node\",\r\n setupFiles: [],\r\n coverage: {\r\n provider: \"v8\",\r\n ...commonCoverageConfig\r\n }\r\n }\r\n});\r\n\r\nexport const browserConfig = defineConfig({\r\n test: {\r\n exclude: [\r\n ...configDefaults.exclude,\r\n \"@hpcc-js/dgrid-shim\",\r\n \"**/*.node.spec.{ts,js}\",\r\n \"**/node_modules/**\",\r\n \"**/.nx/**\",\r\n \"**/apps/**\",\r\n \"**/components/**\",\r\n \"**/demos/**\",\r\n \"**/src/**\",\r\n ],\r\n browser: {\r\n enabled: true,\r\n provider: \"playwright\",\r\n instances: [{\r\n name: \"chromium\",\r\n browser: \"chromium\",\r\n headless: true,\r\n //@ts-expect-error\r\n launch: {\r\n args: [\"--disable-web-security\"],\r\n }\r\n }],\r\n screenshotFailures: false,\r\n },\r\n setupFiles: [],\r\n coverage: {\r\n provider: \"istanbul\",\r\n ...commonCoverageConfig\r\n }\r\n }\r\n});\r\n\r\nexport function createHpccViteConfig(pkg: any, options: ViteHpccConfigOptions = {}): ViteUserConfig {\r\n const {\r\n external: additionalExternal = [],\r\n plugins: additionalPlugins = [],\r\n includeFontAwesome = false,\r\n entry = \"src/index.ts\",\r\n configOverrides = {},\r\n } = options;\r\n\r\n const { alias, external, globals } = hpccBundleNames(pkg);\r\n const allExternals = [...external, ...additionalExternal];\r\n\r\n // Get build version from root package.json\r\n const buildVersion = getRootPackageVersion() || pkg.version;\r\n\r\n const allPlugins = [\r\n packageVersionPlugin({ pkg, buildVersion }),\r\n cssInjectedByJsPlugin({\r\n topExecutionPriority: false\r\n }),\r\n ...additionalPlugins\r\n ];\r\n\r\n if (includeFontAwesome) {\r\n allPlugins.push(\r\n viteStaticCopy({\r\n targets: [\r\n {\r\n src: \"../../node_modules/font-awesome/fonts\",\r\n dest: \"../font-awesome\"\r\n }, {\r\n src: \"../../node_modules/font-awesome/css\",\r\n dest: \"../font-awesome\",\r\n }\r\n ]\r\n })\r\n );\r\n }\r\n\r\n const defaultLibConfig = {\r\n entry,\r\n name: pkg.name,\r\n fileName: \"index\",\r\n };\r\n\r\n const config: ViteUserConfig = {\r\n build: {\r\n lib: {\r\n ...defaultLibConfig,\r\n ...(configOverrides.build?.lib || {})\r\n },\r\n rollupOptions: {\r\n external: allExternals,\r\n output: {\r\n globals,\r\n },\r\n ...(configOverrides.build?.rollupOptions || {})\r\n },\r\n // Preserve class names and function names in minified output\r\n minify: \"terser\",\r\n terserOptions: {\r\n keep_classnames: true,\r\n mangle: {\r\n keep_classnames: true,\r\n }\r\n },\r\n sourcemap: true,\r\n ...(configOverrides.build ? Object.fromEntries(Object.entries(configOverrides.build).filter(([key]) => key !== \"lib\" && key !== \"rollupOptions\")) : {})\r\n },\r\n resolve: {\r\n alias,\r\n ...(configOverrides.resolve || {})\r\n },\r\n esbuild: {\r\n keepNames: true,\r\n ...(configOverrides.esbuild || {})\r\n },\r\n plugins: allPlugins,\r\n test: {\r\n projects: [nodeConfig, browserConfig],\r\n ...(configOverrides.test || {})\r\n },\r\n ...Object.fromEntries(Object.entries(configOverrides).filter(([key]) => ![\"build\", \"resolve\", \"esbuild\", \"plugins\"].includes(key)))\r\n };\r\n\r\n return defineConfig(config);\r\n}", "import type { Plugin } from \"vite\";\r\n\r\nexport interface PackageVersionPluginOptions {\r\n /**\r\n * Package.json object containing name and version\r\n */\r\n pkg: {\r\n name: string;\r\n version: string;\r\n };\r\n /**\r\n * Build version (typically from root package.json)\r\n * If not provided, defaults to pkg.version\r\n */\r\n buildVersion?: string;\r\n /**\r\n * Placeholder for package name (default: \"__PACKAGE_NAME__\")\r\n */\r\n namePlaceholder?: string;\r\n /**\r\n * Placeholder for package version (default: \"__PACKAGE_VERSION__\")\r\n */\r\n versionPlaceholder?: string;\r\n /**\r\n * Placeholder for build version (default: \"__BUILD_VERSION__\")\r\n */\r\n buildVersionPlaceholder?: string;\r\n}\r\n\r\n/**\r\n * Vite plugin to replace package version placeholders during build\r\n * This allows keeping version information in source files as placeholders\r\n * that get replaced with actual values from package.json during the build\r\n */\r\nexport function packageVersionPlugin(options: PackageVersionPluginOptions): Plugin {\r\n const {\r\n pkg,\r\n buildVersion = pkg.version,\r\n namePlaceholder = \"__PACKAGE_NAME__\",\r\n versionPlaceholder = \"__PACKAGE_VERSION__\",\r\n buildVersionPlaceholder = \"__BUILD_VERSION__\"\r\n } = options;\r\n\r\n return {\r\n name: \"hpcc-package-version-plugin\",\r\n enforce: \"pre\",\r\n transform(code: string, id: string) {\r\n // Only process TypeScript/JavaScript files\r\n if (!id.endsWith(\".ts\") && !id.endsWith(\".js\")) {\r\n return null;\r\n }\r\n\r\n // Check if the file contains any placeholders\r\n if (!code.includes(namePlaceholder) &&\r\n !code.includes(versionPlaceholder) &&\r\n !code.includes(buildVersionPlaceholder)) {\r\n return null;\r\n }\r\n\r\n // Replace placeholders with actual values\r\n let transformedCode = code;\r\n if (code.includes(namePlaceholder)) {\r\n transformedCode = transformedCode.replace(\r\n new RegExp(namePlaceholder, \"g\"),\r\n pkg.name\r\n );\r\n }\r\n if (code.includes(versionPlaceholder)) {\r\n transformedCode = transformedCode.replace(\r\n new RegExp(versionPlaceholder, \"g\"),\r\n pkg.version\r\n );\r\n }\r\n if (code.includes(buildVersionPlaceholder)) {\r\n transformedCode = transformedCode.replace(\r\n new RegExp(buildVersionPlaceholder, \"g\"),\r\n buildVersion\r\n );\r\n }\r\n\r\n return {\r\n code: transformedCode,\r\n map: null // Could generate source map if needed\r\n };\r\n }\r\n };\r\n}\r\n"],
|
|
5
5
|
"mappings": "AAAA,UAAYA,MAAa,UACzB,OAAS,gBAAAC,MAAoB,KAC7B,UAAYC,MAAU,OACtB,UAAYC,MAAa,UAEzB,OAAS,cAAAC,MAAkB,6BAC3B,UAAYC,OAAqB,4BCLjC,OAAOC,MAAU,OACjB,OAAOC,MAAY,SACnB,OAAS,YAAAC,MAAgB,cAElB,SAASC,EAAUC,EAAU,CAAC,EAAG,CACpC,MAAO,CACH,KAAM,aAEN,MAAMC,EAAoB,CAEtBA,EAAM,OAAO,CAAE,OAAQ,UAAW,EAAG,MAAOC,GAAS,CACjD,GAAID,EAAM,eAAe,WAAa,UAAW,CAC7C,IAAME,EAAaP,EAAK,QAAQM,EAAK,IAAI,EAEzC,MAAO,CACH,SAFa,MAAME,EAAkBD,CAAU,EAG/C,OAAQ,IACZ,CACJ,CACJ,CAAC,CACL,CACJ,CACJ,CAEA,eAAeC,EAAkBD,EAAoB,CACjD,IAAME,EAAUC,EAAOH,CAAU,EAC3BI,EAAY,MAAMT,EAASK,EAAY,MAAM,EAEnD,MAAO;AAAA,wCAC6BE,CAAO;AAAA;AAAA,sBAEzBA,CAAO;AAAA,gCACGE,EAAU,MAAM,MAAM,EAAE,KAAK,OAAO,CAAC;AAAA;AAAA;AAAA,U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AAK,CACD,GATa,CACrB,MAAAR,EACA,KAAMjB,EAAI,KACV,SAAU,OACd,EAMY,GAAIkB,EAAgB,OAAO,KAAO,CAAC,CACvC,EACA,cAAe,CACX,SAAUC,EACV,OAAQ,CACJ,QAAAd,CACJ,EACA,GAAIa,EAAgB,OAAO,eAAiB,CAAC,CACjD,EAEA,OAAQ,SACR,cAAe,CACX,gBAAiB,GACjB,OAAQ,CACJ,gBAAiB,EACrB,CACJ,EACA,UAAW,GACX,GAAIA,EAAgB,MAAQ,OAAO,YAAY,OAAO,QAAQA,EAAgB,KAAK,EAAE,OAAO,CAAC,CAACQ,CAAG,IAAMA,IAAQ,OAASA,IAAQ,eAAe,CAAC,EAAI,CAAC,CACzJ,EACA,QAAS,CACL,MAAAjC,EACA,GAAIyB,EAAgB,SAAW,CAAC,CACpC,EACA,QAAS,CACL,UAAW,GACX,GAAIA,EAAgB,SAAW,CAAC,CACpC,EACA,QAASG,EACT,KAAM,CACF,SAAU,CAACZ,EAAYE,CAAa,EACpC,GAAIO,EAAgB,MAAQ,CAAC,CACjC,EACA,GAAG,OAAO,YAAY,OAAO,QAAQA,CAAe,EAAE,OAAO,CAAC,CAACQ,CAAG,IAAM,CAAC,CAAC,QAAS,UAAW,UAAW,SAAS,EAAE,SAASA,CAAG,CAAC,CAAC,CACtI,EAEA,OAAOhB,EAAae,CAAM,CAC9B",
|
|
6
6
|
"names": ["process", "readFileSync", "path", "esbuild", "umdWrapper", "copyStaticFiles", "path", "crypto", "readFile", "inlineCSS", "options", "build", "args", "sourcePath", "generateInjectCSS", "styleID", "sha256", "sourceCSS", "rebuildLogger", "opts", "build", "pkg", "readFileSync", "NODE_MJS", "NODE_CJS", "buildWatch", "inputs", "config", "isDevelopment", "isWatch", "isProduction", "rebuildLogger", "inlineCSS", "ctx", "autoExternal", "external", "browserTpl", "input", "output", "options", "umdWrapper", "nodeTpl", "neutralTpl", "browserBoth", "nodeBoth", "bothTpl", "readFile", "excludeSourcemap", "opts", "build", "args", "problemMatcher", "build", "result", "text", "location", "writeFileSync", "removeStrict", "build", "result", "file", "contents", "configDefaults", "defineConfig", "cssInjectedByJsPlugin", "viteStaticCopy", "packageVersionPlugin", "options", "pkg", "buildVersion", "namePlaceholder", "versionPlaceholder", "buildVersionPlaceholder", "code", "id", "transformedCode", "readFileSync", "resolve", "dirname", "fileURLToPath", "alias", "getRootPackageVersion", "currentDir", "attempts", "maxAttempts", "pkgPath", "pkgContent", "pkg", "parentDir", "error", "hpccBundleNames", "external", "globals", "dep", "commonCoverageConfig", "configDefaults", "nodeConfig", "defineConfig", "browserConfig", "createHpccViteConfig", "options", "additionalExternal", "additionalPlugins", "includeFontAwesome", "entry", "configOverrides", "allExternals", "buildVersion", "allPlugins", "packageVersionPlugin", "cssInjectedByJsPlugin", "viteStaticCopy", "config", "key"]
|
|
7
7
|
}
|