@remit/web-client 0.0.4 → 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 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: { outDir: resolve(packageDir, out), emptyOutDir: true },
75
- ...webClientPreset(),
76
+ build: {
77
+ ...preset.build,
78
+ outDir: resolve(packageDir, out),
79
+ emptyOutDir: true,
80
+ },
76
81
  });
77
82
  } finally {
78
- rmSync(root, { recursive: true, force: true });
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)}`);
@@ -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.4",
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": {
@@ -30,24 +30,7 @@
30
30
  "preview": "vite preview",
31
31
  "test:typecheck": "npm run generate:routes && tsgo --noEmit",
32
32
  "test:run": "node --import tsx --import ./test-support/register.mjs --test 'src/**/*.test.ts'",
33
- "test": "npm run test:typecheck && npm run test:run",
34
- "test:smoke": "npx playwright test --config playwright.smoke.config.ts",
35
- "test:smoke:pg": "npx playwright test --config playwright.smoke.pg.config.ts",
36
- "test:smoke:ui": "npx playwright test --config playwright.smoke.config.ts --ui",
37
- "test:e2e": "npx playwright test --config playwright.e2e.config.ts",
38
- "test:e2e:pg": "npx playwright test --config playwright.e2e.pg.config.ts",
39
- "test:e2e:ui": "npx playwright test --config playwright.e2e.config.ts --ui",
40
- "test:visual:fetch": "bash scripts/visual-baselines.sh fetch",
41
- "test:visual:publish": "bash scripts/visual-baselines.sh publish",
42
- "test:visual:status": "bash scripts/visual-baselines.sh status",
43
- "test:visual": "npm run test:visual:fetch && npx playwright test --config playwright.visual.config.ts",
44
- "test:visual:ui": "npm run test:visual:fetch && npx playwright test --config playwright.visual.config.ts --ui",
45
- "test:visual:update": "npm run test:visual:fetch && npx playwright test --config playwright.visual.config.ts --update-snapshots=all && echo '\\nBaselines updated locally. Run: npm run test:visual:publish -w packages/web-client'",
46
- "playwright:install": "npx playwright install chromium",
47
- "parity:montage": "node --import tsx visual-regression/parity/montage.ts",
48
- "parity:capture": "node --import tsx visual-regression/parity/capture-parity.ts",
49
- "parity:capture:dev": "PARITY_TARGET=dev node --import tsx visual-regression/parity/capture-parity-dev.ts",
50
- "parity:report": "node --import tsx visual-regression/parity/report.scaffold.ts"
33
+ "test": "npm run test:typecheck && npm run test:run"
51
34
  },
52
35
  "peerDependencies": {
53
36
  "react": "^19",
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(),