@remit/web-client 0.0.5 → 0.0.6
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/harness/build.mjs +15 -3
- package/harness/vite-preset.ts +2 -0
- package/package.json +1 -1
- package/vite.base.ts +15 -1
package/harness/build.mjs
CHANGED
|
@@ -67,15 +67,27 @@ const run = async () => {
|
|
|
67
67
|
cpSync(join(harnessDir, "index.html"), join(root, "index.html"));
|
|
68
68
|
writeFileSync(join(root, "entry.tsx"), entrySource(provider));
|
|
69
69
|
|
|
70
|
+
const preset = webClientPreset();
|
|
70
71
|
try {
|
|
71
72
|
await build({
|
|
73
|
+
...preset,
|
|
72
74
|
root,
|
|
73
75
|
publicDir: join(packageDir, "public"),
|
|
74
|
-
build: {
|
|
75
|
-
|
|
76
|
+
build: {
|
|
77
|
+
...preset.build,
|
|
78
|
+
outDir: resolve(packageDir, out),
|
|
79
|
+
emptyOutDir: true,
|
|
80
|
+
},
|
|
76
81
|
});
|
|
77
82
|
} finally {
|
|
78
|
-
|
|
83
|
+
// Never let cleanup replace the build's own failure. Removing the root is
|
|
84
|
+
// best-effort housekeeping on a throwaway directory; a build error is the
|
|
85
|
+
// thing the caller needs to see.
|
|
86
|
+
try {
|
|
87
|
+
rmSync(root, { recursive: true, force: true });
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.warn(`Could not remove ${root}: ${error.message}`);
|
|
90
|
+
}
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
console.log(`Built web client (auth: ${auth}) to ${resolve(packageDir, out)}`);
|
package/harness/vite-preset.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { fileURLToPath } from "node:url";
|
|
|
2
2
|
import type { UserConfig } from "vite";
|
|
3
3
|
import {
|
|
4
4
|
webClientAlias,
|
|
5
|
+
webClientBuild,
|
|
5
6
|
webClientDefine,
|
|
6
7
|
webClientPlugins,
|
|
7
8
|
} from "../vite.base.ts";
|
|
@@ -26,4 +27,5 @@ export const webClientPreset = (): UserConfig => ({
|
|
|
26
27
|
}),
|
|
27
28
|
resolve: { alias: webClientAlias() },
|
|
28
29
|
define: webClientDefine(),
|
|
30
|
+
build: webClientBuild(),
|
|
29
31
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
|
|
6
6
|
"exports": {
|
package/vite.base.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import tailwindcss from "@tailwindcss/vite";
|
|
4
4
|
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
|
5
5
|
import react from "@vitejs/plugin-react";
|
|
6
|
-
import type { AliasOptions, PluginOption } from "vite";
|
|
6
|
+
import type { AliasOptions, BuildOptions, PluginOption } from "vite";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The one place the web-client build toolchain is described. Both the dev
|
|
@@ -36,6 +36,20 @@ export const webClientDefine = (): Record<string, string> => ({
|
|
|
36
36
|
__APP_BUILD_TIME__: JSON.stringify(new Date().toISOString()),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Rollup keeps up to `maxParallelFileOps` module reads in flight, and each one
|
|
41
|
+
* holds a file descriptor. Its default of 1000 is above the 1024 `RLIMIT_NOFILE`
|
|
42
|
+
* soft limit that container runtimes hand a build step, and the icon barrels this
|
|
43
|
+
* app imports (lucide-react re-exports ~1500 single-icon modules) give rollup
|
|
44
|
+
* enough sibling modules to saturate the ceiling, so the default reliably fails
|
|
45
|
+
* with EMFILE inside an image build while passing on a developer machine.
|
|
46
|
+
* Reading 64 files at a time keeps the build IO-bound without depending on the
|
|
47
|
+
* descriptor budget of whatever runs it.
|
|
48
|
+
*/
|
|
49
|
+
export const webClientBuild = (): BuildOptions => ({
|
|
50
|
+
rollupOptions: { maxParallelFileOps: 64 },
|
|
51
|
+
});
|
|
52
|
+
|
|
39
53
|
export const webClientPlugins = (routes: RouterPaths = {}): PluginOption[] => [
|
|
40
54
|
tanstackRouter({ target: "react", autoCodeSplitting: true, ...routes }),
|
|
41
55
|
react(),
|