@remit/web-client 0.0.38 → 0.0.40
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
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// The chosen provider can also be given via REMIT_AUTH_PROVIDER; the flag wins.
|
|
15
15
|
import { cpSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { rm } from "node:fs/promises";
|
|
16
17
|
import { dirname, join, resolve } from "node:path";
|
|
17
18
|
import { fileURLToPath } from "node:url";
|
|
18
19
|
import { build } from "vite";
|
|
@@ -24,23 +25,45 @@ const harnessDir = dirname(fileURLToPath(import.meta.url));
|
|
|
24
25
|
const packageDir = resolve(harnessDir, "..");
|
|
25
26
|
|
|
26
27
|
const parseArgs = (argv) => {
|
|
27
|
-
const args = {
|
|
28
|
+
const args = {
|
|
29
|
+
auth: process.env.REMIT_AUTH_PROVIDER ?? "combined",
|
|
30
|
+
out: "dist",
|
|
31
|
+
};
|
|
28
32
|
for (let i = 0; i < argv.length; i += 1) {
|
|
29
|
-
if (argv[i] === "--auth")
|
|
30
|
-
|
|
33
|
+
if (argv[i] === "--auth") {
|
|
34
|
+
args.auth = argv[i + 1];
|
|
35
|
+
i += 1;
|
|
36
|
+
} else if (argv[i] === "--out") {
|
|
37
|
+
args.out = argv[i + 1];
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
31
40
|
}
|
|
32
41
|
return args;
|
|
33
42
|
};
|
|
34
43
|
|
|
35
44
|
const PROVIDERS = {
|
|
36
|
-
combined: {
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
combined: {
|
|
46
|
+
specifier: "@remit/web-client/auth/combined",
|
|
47
|
+
name: "combinedAuthProvider",
|
|
48
|
+
cognitoCss: true,
|
|
49
|
+
},
|
|
50
|
+
cognito: {
|
|
51
|
+
specifier: "@remit/web-client/auth/cognito",
|
|
52
|
+
name: "cognitoAuthProvider",
|
|
53
|
+
cognitoCss: true,
|
|
54
|
+
},
|
|
55
|
+
"better-auth": {
|
|
56
|
+
specifier: "@remit/web-client/auth/better-auth",
|
|
57
|
+
name: "betterAuthProvider",
|
|
58
|
+
cognitoCss: false,
|
|
59
|
+
},
|
|
39
60
|
};
|
|
40
61
|
|
|
41
62
|
const entrySource = (provider) =>
|
|
42
63
|
[
|
|
43
|
-
provider.cognitoCss
|
|
64
|
+
provider.cognitoCss
|
|
65
|
+
? 'import "@remit/web-client/styles/cognito.css";'
|
|
66
|
+
: null,
|
|
44
67
|
'import { mountApp } from "@remit/web-client/shell";',
|
|
45
68
|
`import { ${provider.name} } from "${provider.specifier}";`,
|
|
46
69
|
"",
|
|
@@ -54,7 +77,9 @@ const run = async () => {
|
|
|
54
77
|
const { auth, out } = parseArgs(process.argv.slice(2));
|
|
55
78
|
const provider = PROVIDERS[auth];
|
|
56
79
|
if (!provider) {
|
|
57
|
-
console.error(
|
|
80
|
+
console.error(
|
|
81
|
+
`Unknown --auth "${auth}". Expected one of: ${Object.keys(PROVIDERS).join(", ")}.`,
|
|
82
|
+
);
|
|
58
83
|
process.exit(1);
|
|
59
84
|
}
|
|
60
85
|
|
|
@@ -83,14 +108,14 @@ const run = async () => {
|
|
|
83
108
|
// Never let cleanup replace the build's own failure. Removing the root is
|
|
84
109
|
// best-effort housekeeping on a throwaway directory; a build error is the
|
|
85
110
|
// thing the caller needs to see.
|
|
86
|
-
|
|
87
|
-
rmSync(root, { recursive: true, force: true });
|
|
88
|
-
} catch (error) {
|
|
111
|
+
await rm(root, { recursive: true, force: true }).catch((error) => {
|
|
89
112
|
console.warn(`Could not remove ${root}: ${error.message}`);
|
|
90
|
-
}
|
|
113
|
+
});
|
|
91
114
|
}
|
|
92
115
|
|
|
93
|
-
console.log(
|
|
116
|
+
console.log(
|
|
117
|
+
`Built web client (auth: ${auth}) to ${resolve(packageDir, out)}`,
|
|
118
|
+
);
|
|
94
119
|
};
|
|
95
120
|
|
|
96
121
|
run();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
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": {
|
|
@@ -128,6 +128,7 @@ function useSelectedNavId(): string {
|
|
|
128
128
|
const location = useLocation();
|
|
129
129
|
const params = useParams({ strict: false }) as { mailboxId?: string };
|
|
130
130
|
|
|
131
|
+
if (location.pathname.startsWith("/settings")) return "settings";
|
|
131
132
|
if (location.pathname.startsWith("/mail/outbox")) return "outbox";
|
|
132
133
|
if (location.pathname.startsWith("/mail/flagged")) return "flagged";
|
|
133
134
|
if (params.mailboxId) return params.mailboxId;
|
|
@@ -271,6 +272,19 @@ export function MailSidebarAdapter({
|
|
|
271
272
|
</Link>
|
|
272
273
|
);
|
|
273
274
|
}
|
|
275
|
+
if (navId === "settings") {
|
|
276
|
+
return (
|
|
277
|
+
<Link
|
|
278
|
+
to="/settings/accounts"
|
|
279
|
+
onClick={() => onClick?.()}
|
|
280
|
+
className={className}
|
|
281
|
+
aria-label={ariaLabel}
|
|
282
|
+
title={title}
|
|
283
|
+
>
|
|
284
|
+
{children}
|
|
285
|
+
</Link>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
274
288
|
return (
|
|
275
289
|
<Link
|
|
276
290
|
to="/mail/$mailboxId"
|