@c9up/warden 0.1.25 → 0.1.27
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/RedisBlacklistDriver.d.ts.map +1 -1
- package/dist/RedisBlacklistDriver.js +12 -2
- package/dist/RedisBlacklistDriver.js.map +1 -1
- package/dist/WardenProvider.d.ts +2 -0
- package/dist/WardenProvider.d.ts.map +1 -1
- package/dist/WardenProvider.js +29 -3
- package/dist/WardenProvider.js.map +1 -1
- package/dist/augmentations.d.ts +27 -1
- package/dist/augmentations.d.ts.map +1 -1
- package/dist/augmentations.js +9 -1
- package/dist/augmentations.js.map +1 -1
- package/dist/bouncer/Bouncer.d.ts.map +1 -1
- package/dist/bouncer/Bouncer.js +2 -1
- package/dist/bouncer/Bouncer.js.map +1 -1
- package/dist/bouncer/PolicyAuthorizer.d.ts.map +1 -1
- package/dist/bouncer/PolicyAuthorizer.js +2 -1
- package/dist/bouncer/PolicyAuthorizer.js.map +1 -1
- package/dist/bouncer/emitSafely.d.ts +18 -0
- package/dist/bouncer/emitSafely.d.ts.map +1 -0
- package/dist/bouncer/emitSafely.js +22 -0
- package/dist/bouncer/emitSafely.js.map +1 -0
- package/dist/bouncer/types.d.ts +10 -1
- package/dist/bouncer/types.d.ts.map +1 -1
- package/dist/mfa/BackupCodesProvider.js +2 -2
- package/dist/mfa/BackupCodesProvider.js.map +1 -1
- package/dist/mfa/MfaManager.js +1 -1
- package/dist/mfa/MfaManager.js.map +1 -1
- package/dist/mfa/TotpProvider.js +6 -5
- package/dist/mfa/TotpProvider.js.map +1 -1
- package/dist/mfa/base32.js +2 -2
- package/dist/mfa/base32.js.map +1 -1
- package/dist/mfa/webauthn-codec.d.ts.map +1 -1
- package/dist/mfa/webauthn-codec.js +11 -4
- package/dist/mfa/webauthn-codec.js.map +1 -1
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +7 -23
- package/dist/native.js.map +1 -1
- package/dist/quasar.d.ts +6 -9
- package/dist/quasar.d.ts.map +1 -1
- package/dist/quasar.js +17 -47
- package/dist/quasar.js.map +1 -1
- package/dist/services/main.d.ts +10 -0
- package/dist/services/main.d.ts.map +1 -1
- package/dist/services/main.js +12 -0
- package/dist/services/main.js.map +1 -1
- package/dist/vendor/nativeBinary.d.ts +43 -0
- package/dist/vendor/nativeBinary.d.ts.map +1 -0
- package/dist/vendor/nativeBinary.js +99 -0
- package/dist/vendor/nativeBinary.js.map +1 -0
- package/dist/vendor/quasarConnection.d.ts +35 -0
- package/dist/vendor/quasarConnection.d.ts.map +1 -0
- package/dist/vendor/quasarConnection.js +62 -0
- package/dist/vendor/quasarConnection.js.map +1 -0
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +3 -2
- package/scripts/build-napi-types.mjs +4 -3
- package/scripts/generate-napi-types.mjs +9 -6
- package/src/RedisBlacklistDriver.ts +15 -5
- package/src/WardenProvider.ts +31 -5
- package/src/augmentations.ts +28 -1
- package/src/bouncer/Bouncer.ts +2 -1
- package/src/bouncer/PolicyAuthorizer.ts +2 -1
- package/src/bouncer/emitSafely.ts +28 -0
- package/src/bouncer/types.ts +10 -1
- package/src/mfa/BackupCodesProvider.ts +2 -2
- package/src/mfa/MfaManager.ts +1 -1
- package/src/mfa/TotpProvider.ts +6 -6
- package/src/mfa/base32.ts +2 -2
- package/src/mfa/webauthn-codec.ts +11 -4
- package/src/native.ts +7 -25
- package/src/quasar.ts +18 -64
- package/src/services/main.ts +13 -0
- package/src/vendor/nativeBinary.ts +110 -0
- package/src/vendor/quasarConnection.ts +129 -0
|
@@ -45,8 +45,13 @@ export function decodeCbor(buf, start = 0, depth = 0) {
|
|
|
45
45
|
if (start < 0 || start >= buf.length) {
|
|
46
46
|
throw new Error("CBOR: item starts past the end of the buffer");
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
// `start` was bounds-checked against the buffer just above; naming the
|
|
49
|
+
// byte is what carries that check into the reads below.
|
|
50
|
+
const head = buf[start];
|
|
51
|
+
if (head === undefined)
|
|
52
|
+
throw new Error("CBOR: item starts past the end of the buffer");
|
|
53
|
+
const major = head >> 5;
|
|
54
|
+
const info = head & 0x1f;
|
|
50
55
|
let len;
|
|
51
56
|
let p = start + 1;
|
|
52
57
|
if (info < 24) {
|
|
@@ -55,7 +60,7 @@ export function decodeCbor(buf, start = 0, depth = 0) {
|
|
|
55
60
|
else if (info === 24) {
|
|
56
61
|
if (p >= buf.length)
|
|
57
62
|
throw new Error("CBOR: truncated length");
|
|
58
|
-
len = buf
|
|
63
|
+
len = buf.readUInt8(p);
|
|
59
64
|
p += 1;
|
|
60
65
|
}
|
|
61
66
|
else if (info === 25) {
|
|
@@ -154,7 +159,9 @@ export function parseAuthenticatorData(authData) {
|
|
|
154
159
|
if (authData.length < 37) {
|
|
155
160
|
throw new Error("authenticatorData is too short");
|
|
156
161
|
}
|
|
157
|
-
|
|
162
|
+
// The length check above guarantees byte 32; `readUInt8` bounds-checks it
|
|
163
|
+
// again rather than reading it as a byte that might not be there.
|
|
164
|
+
const flagsByte = authData.readUInt8(32);
|
|
158
165
|
const flags = {
|
|
159
166
|
up: (flagsByte & 0x01) !== 0,
|
|
160
167
|
uv: (flagsByte & 0x04) !== 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn-codec.js","sourceRoot":"","sources":["../../src/mfa/webauthn-codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACN,UAAU,EACV,eAAe,EACf,MAAM,IAAI,YAAY,GAGtB,MAAM,aAAa,CAAC;AAYrB,MAAM,UAAU,iBAAiB,CAAC,CAAS;IAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,CAAs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
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,uBAAuB,CAAC,CAAC;AASlE,2CAA2C;AAC3C,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,kFAAkF;AAClF,wBAAgB,YAAY,IAAI,YAAY,GAAG,SAAS,CAEvD"}
|
package/dist/native.js
CHANGED
|
@@ -5,29 +5,13 @@
|
|
|
5
5
|
* other consumer) throws `E_WARDEN_NAPI_REQUIRED` at use time. Password
|
|
6
6
|
* hashing is the sole responsibility of `@c9up/sigil` (story 40.1).
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
"linux-x64": "linux-x64-gnu",
|
|
16
|
-
"linux-arm64": "linux-arm64-gnu",
|
|
17
|
-
"darwin-x64": "darwin-x64",
|
|
18
|
-
"darwin-arm64": "darwin-arm64",
|
|
19
|
-
"win32-x64": "win32-x64-msvc",
|
|
20
|
-
};
|
|
21
|
-
let native;
|
|
22
|
-
try {
|
|
23
|
-
const suffix = platformMap[`${platform}-${arch}`];
|
|
24
|
-
if (suffix) {
|
|
25
|
-
native = nodeRequire(join(currentDir, `../index.${suffix}.node`));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// Binary not available — JwtStrategy will throw E_WARDEN_NAPI_REQUIRED at use time.
|
|
30
|
-
}
|
|
8
|
+
import { loadNativeBinary } from "./vendor/nativeBinary.js";
|
|
9
|
+
// Absent is not an error here: `JwtStrategy` throws E_WARDEN_NAPI_REQUIRED at
|
|
10
|
+
// use time, which names what the caller was trying to do. The loader reports
|
|
11
|
+
// what happened and this decides — the platform table itself is shared, since
|
|
12
|
+
// a package that misses a new target fails only on that platform.
|
|
13
|
+
const attempt = loadNativeBinary();
|
|
14
|
+
const native = attempt.loaded ? attempt.binary : undefined;
|
|
31
15
|
/** Whether the Rust NAPI engine loaded. */
|
|
32
16
|
export function isNativeAvailable() {
|
|
33
17
|
return native !== undefined;
|
package/dist/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAW5D,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,kEAAkE;AAClE,MAAM,OAAO,GAAG,gBAAgB,EAAgB,CAAC;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAE3D,2CAA2C;AAC3C,MAAM,UAAU,iBAAiB;IAChC,OAAO,MAAM,KAAK,SAAS,CAAC;AAC7B,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,YAAY;IAC3B,OAAO,MAAM,CAAC;AACf,CAAC"}
|
package/dist/quasar.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolving a Redis connection by name, from `@c9up/quasar`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The shape is checked before use rather than asserted, the same way warden
|
|
10
|
-
* duck-types its host framework.
|
|
4
|
+
* The loading, the shape check and the messages are the same in every package
|
|
5
|
+
* that offers a Redis-backed option, so they are vendored rather than written
|
|
6
|
+
* again: `src/vendor/quasarConnection.ts`, generated from one source. What is
|
|
7
|
+
* specific to this package — the commands it issues, and what it does with
|
|
8
|
+
* them — stays here, because that is the part a reader needs.
|
|
11
9
|
*/
|
|
12
10
|
import type { RedisLikeClient } from "./RedisBlacklistDriver.js";
|
|
13
11
|
/**
|
|
14
|
-
* A resolver
|
|
15
|
-
* loaded on the first revocation check, not at config time.
|
|
12
|
+
* A resolver — quasar is loaded on first use, not at config time.
|
|
16
13
|
*/
|
|
17
14
|
export declare function quasarConnection(name?: string): () => Promise<RedisLikeClient>;
|
|
18
15
|
//# sourceMappingURL=quasar.d.ts.map
|
package/dist/quasar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quasar.d.ts","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quasar.d.ts","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAOjE;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,CAAC,EAAE,MAAM,GACX,MAAM,OAAO,CAAC,eAAe,CAAC,CAShC"}
|
package/dist/quasar.js
CHANGED
|
@@ -1,56 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolving a Redis connection by name, from `@c9up/quasar`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The shape is checked before use rather than asserted, the same way warden
|
|
10
|
-
* duck-types its host framework.
|
|
4
|
+
* The loading, the shape check and the messages are the same in every package
|
|
5
|
+
* that offers a Redis-backed option, so they are vendored rather than written
|
|
6
|
+
* again: `src/vendor/quasarConnection.ts`, generated from one source. What is
|
|
7
|
+
* specific to this package — the commands it issues, and what it does with
|
|
8
|
+
* them — stays here, because that is the part a reader needs.
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
function isRedisLikeClient(value) {
|
|
18
|
-
if (typeof value !== "object" || value === null)
|
|
19
|
-
return false;
|
|
20
|
-
// The commands this driver actually issues — the whole of `RedisLikeClient`.
|
|
21
|
-
// A connection missing one would fail on the first revocation, far from the
|
|
22
|
-
// cause. Nothing more: the driver documents itself as needing only `set`
|
|
23
|
-
// with an "EX" ttl and `exists`, so demanding sets or key scans here would
|
|
24
|
-
// reject a client that works perfectly well.
|
|
25
|
-
const required = ["set", "exists"];
|
|
26
|
-
return required.every((name) => typeof Reflect.get(value, name) === "function");
|
|
27
|
-
}
|
|
10
|
+
import { quasarConnection as loadQuasarConnection } from "./vendor/quasarConnection.js";
|
|
11
|
+
// Only what the driver documents itself as needing: `set` with an "EX" ttl,
|
|
12
|
+
// and `exists`. Demanding key scans here would reject a client that works.
|
|
13
|
+
const REQUIRED = ["set", "exists"];
|
|
28
14
|
/**
|
|
29
|
-
* A resolver
|
|
30
|
-
* loaded on the first revocation check, not at config time.
|
|
15
|
+
* A resolver — quasar is loaded on first use, not at config time.
|
|
31
16
|
*/
|
|
32
17
|
export function quasarConnection(name) {
|
|
33
|
-
return async () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
throw new Error(`Warden: the "${name ?? "default"}" blacklist asks for a quasar connection, but @c9up/quasar is not installed.\n` +
|
|
41
|
-
" pnpm add @c9up/quasar", { cause });
|
|
42
|
-
}
|
|
43
|
-
const manager = isConnectionSource(loaded)
|
|
44
|
-
? loaded
|
|
45
|
-
: Reflect.get(Object(loaded), "default");
|
|
46
|
-
if (!isConnectionSource(manager)) {
|
|
47
|
-
throw new Error("Warden: @c9up/quasar/services/main did not expose a connection() manager");
|
|
48
|
-
}
|
|
49
|
-
const connection = manager.connection(name);
|
|
50
|
-
if (!isRedisLikeClient(connection)) {
|
|
51
|
-
throw new Error(`Warden: quasar connection "${name ?? "default"}" does not carry the commands this blacklist needs`);
|
|
52
|
-
}
|
|
53
|
-
return connection;
|
|
54
|
-
};
|
|
18
|
+
return async () => loadQuasarConnection({
|
|
19
|
+
pkg: "warden",
|
|
20
|
+
name,
|
|
21
|
+
required: REQUIRED,
|
|
22
|
+
what: "the token blacklist",
|
|
23
|
+
raise: (_reason, message, cause) => new Error(message, { cause }),
|
|
24
|
+
});
|
|
55
25
|
}
|
|
56
26
|
//# sourceMappingURL=quasar.js.map
|
package/dist/quasar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quasar.js","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quasar.js","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAExF,4EAA4E;AAC5E,2EAA2E;AAC3E,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC/B,IAAa;IAEb,OAAO,KAAK,IAAI,EAAE,CACjB,oBAAoB,CAAkB;QACrC,GAAG,EAAE,QAAQ;QACb,IAAI;QACJ,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC;KACjE,CAAC,CAAC;AACL,CAAC"}
|
package/dist/services/main.d.ts
CHANGED
|
@@ -14,6 +14,16 @@ import type { AuthManager } from "../AuthManager.js";
|
|
|
14
14
|
export declare function setAuth(value: AuthManager): void;
|
|
15
15
|
/** @internal Read the singleton (or `undefined` pre-boot). */
|
|
16
16
|
export declare function getAuth(): AuthManager | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* @internal Release the singleton, so a shut-down application does not leave a
|
|
19
|
+
* dead AuthManager reachable through `services/main`.
|
|
20
|
+
*
|
|
21
|
+
* The caller checks ownership first (`getAuth() === mine`). Two applications in
|
|
22
|
+
* one process share this module, and the one shutting down must not clear a
|
|
23
|
+
* manager the other has since installed — for auth, that would leave the
|
|
24
|
+
* survivor authenticating against nothing, or throwing on every guarded route.
|
|
25
|
+
*/
|
|
26
|
+
export declare function clearAuth(): void;
|
|
17
27
|
declare const auth: AuthManager;
|
|
18
28
|
export default auth;
|
|
19
29
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/services/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,+DAA+D;AAC/D,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAEhD;AAED,8DAA8D;AAC9D,wBAAgB,OAAO,IAAI,WAAW,GAAG,SAAS,CAEjD;AAED,QAAA,MAAM,IAAI,EAAE,WAWV,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/services/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,+DAA+D;AAC/D,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAEhD;AAED,8DAA8D;AAC9D,wBAAgB,OAAO,IAAI,WAAW,GAAG,SAAS,CAEjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,QAAA,MAAM,IAAI,EAAE,WAWV,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
package/dist/services/main.js
CHANGED
|
@@ -18,6 +18,18 @@ export function setAuth(value) {
|
|
|
18
18
|
export function getAuth() {
|
|
19
19
|
return instance;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @internal Release the singleton, so a shut-down application does not leave a
|
|
23
|
+
* dead AuthManager reachable through `services/main`.
|
|
24
|
+
*
|
|
25
|
+
* The caller checks ownership first (`getAuth() === mine`). Two applications in
|
|
26
|
+
* one process share this module, and the one shutting down must not clear a
|
|
27
|
+
* manager the other has since installed — for auth, that would leave the
|
|
28
|
+
* survivor authenticating against nothing, or throwing on every guarded route.
|
|
29
|
+
*/
|
|
30
|
+
export function clearAuth() {
|
|
31
|
+
instance = undefined;
|
|
32
|
+
}
|
|
21
33
|
const auth = new Proxy({}, {
|
|
22
34
|
get(_target, prop) {
|
|
23
35
|
if (!instance) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/services/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,IAAI,QAAiC,CAAC;AAEtC,+DAA+D;AAC/D,MAAM,UAAU,OAAO,CAAC,KAAkB;IACzC,QAAQ,GAAG,KAAK,CAAC;AAClB,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,OAAO;IACtB,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,MAAM,IAAI,GAAgB,IAAI,KAAK,CAAC,EAAiB,EAAE;IACtD,GAAG,CAAC,OAAO,EAAE,IAAI;QAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACd,4EAA4E;gBAC3E,2EAA2E,CAC5E,CAAC;QACH,CAAC;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QACpD,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnE,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/services/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,IAAI,QAAiC,CAAC;AAEtC,+DAA+D;AAC/D,MAAM,UAAU,OAAO,CAAC,KAAkB;IACzC,QAAQ,GAAG,KAAK,CAAC;AAClB,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,OAAO;IACtB,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS;IACxB,QAAQ,GAAG,SAAS,CAAC;AACtB,CAAC;AAED,MAAM,IAAI,GAAgB,IAAI,KAAK,CAAC,EAAiB,EAAE;IACtD,GAAG,CAAC,OAAO,EAAE,IAAI;QAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACd,4EAA4E;gBAC3E,2EAA2E,CAC5E,CAAC;QACH,CAAC;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QACpD,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnE,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every `platform-arch` a binary is built for.
|
|
3
|
+
*
|
|
4
|
+
* For the message a package raises when it refuses: "no binary for
|
|
5
|
+
* linux-riscv64" is only actionable next to the list of what there IS.
|
|
6
|
+
*/
|
|
7
|
+
export declare function supportedTargets(): readonly string[];
|
|
8
|
+
/** The suffix a given `platform-arch` builds under, or `undefined`. */
|
|
9
|
+
export declare function nativeTargetSuffix(target: string): string | undefined;
|
|
10
|
+
/** The suffix for THIS platform, or `undefined` where no binary is built. */
|
|
11
|
+
export declare function nativeBinarySuffix(): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Why the binary is not there, phrased for whoever has to fix it.
|
|
14
|
+
*
|
|
15
|
+
* "not found" and "not built for your platform" call for different actions,
|
|
16
|
+
* and a single "unavailable" leaves the reader to guess which one they are
|
|
17
|
+
* looking at.
|
|
18
|
+
*/
|
|
19
|
+
export declare function unavailableReason(cause?: unknown): string;
|
|
20
|
+
/**
|
|
21
|
+
* `musl` builds under a different suffix, and the failure is otherwise
|
|
22
|
+
* baffling: the file is there, and `require` still refuses it. Worth saying so
|
|
23
|
+
* in a message rather than leaving a reader to discover glibc.
|
|
24
|
+
*/
|
|
25
|
+
export declare function muslHint(): string;
|
|
26
|
+
/** What a load attempt did, so the caller can apply its own policy. */
|
|
27
|
+
export type NativeBinaryResult<T> = {
|
|
28
|
+
loaded: true;
|
|
29
|
+
binary: T;
|
|
30
|
+
} | {
|
|
31
|
+
loaded: false;
|
|
32
|
+
suffix: string | undefined;
|
|
33
|
+
cause?: unknown;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Load `<package root>/index.<suffix>.node`.
|
|
37
|
+
*
|
|
38
|
+
* The path is fixed rather than passed: this file is generated into
|
|
39
|
+
* `<package>/src/vendor/`, so the package root is always two levels up, from
|
|
40
|
+
* `src` and from `dist` alike.
|
|
41
|
+
*/
|
|
42
|
+
export declare function loadNativeBinary<T>(): NativeBinaryResult<T>;
|
|
43
|
+
//# sourceMappingURL=nativeBinary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeBinary.d.ts","sourceRoot":"","sources":["../../src/vendor/nativeBinary.ts"],"names":[],"mappings":"AAoCA;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,MAAM,EAAE,CAEpD;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAErE;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAQzD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAIjC;AAED,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAC7B;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,CAAC,CAAA;CAAE,GAC3B;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAa3D"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Generated from scripts/vendor/nativeBinary.ts — do not edit.
|
|
2
|
+
//
|
|
3
|
+
// This package is published and built from its own repository, so the file
|
|
4
|
+
// has to exist here rather than be imported. `pnpm vendor:sync` rewrites it,
|
|
5
|
+
// and `pnpm vendor:check` fails if this copy has drifted from the original.
|
|
6
|
+
/**
|
|
7
|
+
* Finding the NAPI binary a package ships beside itself.
|
|
8
|
+
*
|
|
9
|
+
* Every package with a Rust engine repeats the same table: napi-rs names its
|
|
10
|
+
* artefacts `index.<platform>-<arch>-<abi>.node`, and the mapping from Node's
|
|
11
|
+
* `platform`/`arch` to that suffix is the part that must never differ between
|
|
12
|
+
* packages. Adding a target means adding it everywhere, and a package that
|
|
13
|
+
* missed the edit fails only on that platform — which is exactly the failure
|
|
14
|
+
* nobody reproduces.
|
|
15
|
+
*
|
|
16
|
+
* What is NOT here is the policy. Some packages degrade when the binary is
|
|
17
|
+
* absent and answer `undefined`; others refuse loudly with build instructions.
|
|
18
|
+
* Both are right for their package, so the loader reports what happened and
|
|
19
|
+
* the caller decides.
|
|
20
|
+
*/
|
|
21
|
+
import { createRequire } from "node:module";
|
|
22
|
+
import { dirname, join } from "node:path";
|
|
23
|
+
import { arch, platform } from "node:process";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
/** Node's `platform-arch` → the suffix napi-rs builds under. */
|
|
26
|
+
const TARGETS = {
|
|
27
|
+
"linux-x64": "linux-x64-gnu",
|
|
28
|
+
"linux-arm64": "linux-arm64-gnu",
|
|
29
|
+
"darwin-x64": "darwin-x64",
|
|
30
|
+
"darwin-arm64": "darwin-arm64",
|
|
31
|
+
"win32-x64": "win32-x64-msvc",
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Every `platform-arch` a binary is built for.
|
|
35
|
+
*
|
|
36
|
+
* For the message a package raises when it refuses: "no binary for
|
|
37
|
+
* linux-riscv64" is only actionable next to the list of what there IS.
|
|
38
|
+
*/
|
|
39
|
+
export function supportedTargets() {
|
|
40
|
+
return Object.keys(TARGETS);
|
|
41
|
+
}
|
|
42
|
+
/** The suffix a given `platform-arch` builds under, or `undefined`. */
|
|
43
|
+
export function nativeTargetSuffix(target) {
|
|
44
|
+
return TARGETS[target];
|
|
45
|
+
}
|
|
46
|
+
/** The suffix for THIS platform, or `undefined` where no binary is built. */
|
|
47
|
+
export function nativeBinarySuffix() {
|
|
48
|
+
return nativeTargetSuffix(`${platform}-${arch}`);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Why the binary is not there, phrased for whoever has to fix it.
|
|
52
|
+
*
|
|
53
|
+
* "not found" and "not built for your platform" call for different actions,
|
|
54
|
+
* and a single "unavailable" leaves the reader to guess which one they are
|
|
55
|
+
* looking at.
|
|
56
|
+
*/
|
|
57
|
+
export function unavailableReason(cause) {
|
|
58
|
+
if (cause !== undefined) {
|
|
59
|
+
return `failed to load (${cause instanceof Error ? cause.message : String(cause)})`;
|
|
60
|
+
}
|
|
61
|
+
const target = `${platform}-${arch}`;
|
|
62
|
+
return nativeTargetSuffix(target) !== undefined
|
|
63
|
+
? "binary not found"
|
|
64
|
+
: `no prebuilt binary for ${target}`;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* `musl` builds under a different suffix, and the failure is otherwise
|
|
68
|
+
* baffling: the file is there, and `require` still refuses it. Worth saying so
|
|
69
|
+
* in a message rather than leaving a reader to discover glibc.
|
|
70
|
+
*/
|
|
71
|
+
export function muslHint() {
|
|
72
|
+
return platform === "linux"
|
|
73
|
+
? " On Alpine/musl, the gnu binary will not load — build the musl target."
|
|
74
|
+
: "";
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Load `<package root>/index.<suffix>.node`.
|
|
78
|
+
*
|
|
79
|
+
* The path is fixed rather than passed: this file is generated into
|
|
80
|
+
* `<package>/src/vendor/`, so the package root is always two levels up, from
|
|
81
|
+
* `src` and from `dist` alike.
|
|
82
|
+
*/
|
|
83
|
+
export function loadNativeBinary() {
|
|
84
|
+
const suffix = nativeBinarySuffix();
|
|
85
|
+
if (suffix === undefined)
|
|
86
|
+
return { loaded: false, suffix };
|
|
87
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
88
|
+
try {
|
|
89
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
90
|
+
return {
|
|
91
|
+
loaded: true,
|
|
92
|
+
binary: nodeRequire(join(here, `../../index.${suffix}.node`)),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (cause) {
|
|
96
|
+
return { loaded: false, suffix, cause };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=nativeBinary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeBinary.js","sourceRoot":"","sources":["../../src/vendor/nativeBinary.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAE5E;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,C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C1E,CAAC,CAAC,EAAE,CAAC;AACP,CAAC;AAOD;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB;IAC/B,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC;QACJ,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO;YACN,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,MAAM,OAAO,CAAC,CAAM;SAClE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACzC,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface QuasarConnectionRequest {
|
|
2
|
+
/** The package asking. It prefixes every message this can raise. */
|
|
3
|
+
pkg: string;
|
|
4
|
+
/**
|
|
5
|
+
* How this package builds an error.
|
|
6
|
+
*
|
|
7
|
+
* Not optional, and not `new Error` by default: a package with its own
|
|
8
|
+
* error type carries codes (`E_<PKG>_<REASON>`) that a caller catches on,
|
|
9
|
+
* and a shared helper throwing a bare Error would silently drop them. The
|
|
10
|
+
* two reasons are distinguished so the codes can be too.
|
|
11
|
+
*/
|
|
12
|
+
raise: (reason: "quasar-missing" | "incomplete-connection", message: string, cause?: unknown) => Error;
|
|
13
|
+
/** Connection name, or `undefined` for quasar's default. */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** The commands the caller will actually issue. */
|
|
16
|
+
required: readonly string[];
|
|
17
|
+
/** What the caller does with them, for the message that names a gap. */
|
|
18
|
+
what: string;
|
|
19
|
+
/**
|
|
20
|
+
* A second way out, when this package has one.
|
|
21
|
+
*
|
|
22
|
+
* Several of them accept a client object directly, so "pass a client
|
|
23
|
+
* instead of a connection name" is actionable — and it was in each
|
|
24
|
+
* package's own message before this was shared. Dropping it to unify the
|
|
25
|
+
* wording would have made the error strictly less useful.
|
|
26
|
+
*/
|
|
27
|
+
alternative?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The named connection, checked for the commands the caller needs BEFORE it is
|
|
31
|
+
* handed over — a connection missing one would otherwise fail on the first
|
|
32
|
+
* command, far from the line that asked for it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function quasarConnection<T>(request: QuasarConnectionRequest): Promise<T>;
|
|
35
|
+
//# sourceMappingURL=quasarConnection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quasarConnection.d.ts","sourceRoot":"","sources":["../../src/vendor/quasarConnection.ts"],"names":[],"mappings":"AAiDA,MAAM,WAAW,uBAAuB;IACvC,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;OAOG;IACH,KAAK,EAAE,CACN,MAAM,EAAE,gBAAgB,GAAG,uBAAuB,EAClD,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,KACX,KAAK,CAAC;IACX,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,CAAC,CAAC,CAuCZ"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Generated from scripts/vendor/quasarConnection.ts — do not edit.
|
|
2
|
+
//
|
|
3
|
+
// This package is published and built from its own repository, so the file
|
|
4
|
+
// has to exist here rather than be imported. `pnpm vendor:sync` rewrites it,
|
|
5
|
+
// and `pnpm vendor:check` fails if this copy has drifted from the original.
|
|
6
|
+
/**
|
|
7
|
+
* Read a member without assuming how the object answers.
|
|
8
|
+
*
|
|
9
|
+
* Two shapes have to work, and they disagree about `in`. Quasar's accessor is
|
|
10
|
+
* a Proxy over an empty null-prototype object with only a `get` trap, so
|
|
11
|
+
* `"connection" in manager` is FALSE while reading it returns the function —
|
|
12
|
+
* gating on `in` rejected the real manager. And a module namespace under a
|
|
13
|
+
* test double RAISES for an export it does not have, rather than answering
|
|
14
|
+
* undefined, so a bare read fails on the mock. Reading through a catch is what
|
|
15
|
+
* satisfies both.
|
|
16
|
+
*/
|
|
17
|
+
function readMember(value, name) {
|
|
18
|
+
if (typeof value !== "object" || value === null)
|
|
19
|
+
return undefined;
|
|
20
|
+
try {
|
|
21
|
+
return Reflect.get(value, name);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function isConnectionSource(value) {
|
|
28
|
+
return typeof readMember(value, "connection") === "function";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The named connection, checked for the commands the caller needs BEFORE it is
|
|
32
|
+
* handed over — a connection missing one would otherwise fail on the first
|
|
33
|
+
* command, far from the line that asked for it.
|
|
34
|
+
*/
|
|
35
|
+
export async function quasarConnection(request) {
|
|
36
|
+
const { pkg, name, required, what, raise, alternative } = request;
|
|
37
|
+
const specifier = "@c9up/quasar/services/main";
|
|
38
|
+
let loaded;
|
|
39
|
+
try {
|
|
40
|
+
loaded = await import(/* @vite-ignore */ specifier);
|
|
41
|
+
}
|
|
42
|
+
catch (cause) {
|
|
43
|
+
throw raise("quasar-missing", `[${pkg}] ${what} asks for the quasar connection "${name ?? "default"}", but @c9up/quasar is not installed.\n` +
|
|
44
|
+
` pnpm add @c9up/quasar${alternative ? `, ${alternative}` : ""}`, cause);
|
|
45
|
+
}
|
|
46
|
+
const manager = isConnectionSource(loaded)
|
|
47
|
+
? loaded
|
|
48
|
+
: Reflect.get(Object(loaded), "default");
|
|
49
|
+
if (!isConnectionSource(manager)) {
|
|
50
|
+
throw raise("quasar-missing", `[${pkg}] @c9up/quasar/services/main did not expose a connection() manager`);
|
|
51
|
+
}
|
|
52
|
+
const connection = manager.connection(name);
|
|
53
|
+
const missing = required.filter((command) => typeof readMember(connection, command) !== "function");
|
|
54
|
+
if (missing.length > 0) {
|
|
55
|
+
throw raise("incomplete-connection", `[${pkg}] the quasar connection${name ? ` '${name}'` : ""} is missing ${missing.join(", ")}, which ${what} issues`);
|
|
56
|
+
}
|
|
57
|
+
// Load-bearing: every member of `required` has just been checked to be a
|
|
58
|
+
// function on this object. The caller names the type it needs because only
|
|
59
|
+
// the caller knows which commands it asked for.
|
|
60
|
+
return connection;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=quasarConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quasarConnection.js","sourceRoot":"","sources":["../../src/vendor/quasarConnection.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAqB5E;;;;;;;;;;GAUG;AACH,SAAS,UAAU,CAAC,KAAc,EAAE,IAAY;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,IAAI,CAAC;QACJ,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACzC,OAAO,OAAO,UAAU,CAAC,KAAK,EAA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,EACvB,IAAI,GAAG,0BAA0B,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,eAAe,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,SAAS,CAClH,CAAC;IACH,CAAC;IACD,yEAAyE;IACzE,2EAA2E;IAC3E,gDAAgD;IAChD,OAAO,UAAe,CAAC;AACxB,CAAC"}
|
package/index.darwin-arm64.node
CHANGED
|
Binary file
|
package/index.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
package/index.linux-x64-gnu.node
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c9up/warden",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "Warden — Authentication & authorization for the Ream framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"@biomejs/biome": "^2.4.10",
|
|
66
66
|
"@c9up/quasar": "^0.1.0",
|
|
67
67
|
"@types/node": "^22.19.15",
|
|
68
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
68
69
|
"reflect-metadata": "^0.2.2",
|
|
69
70
|
"typescript": "^6.0.2",
|
|
70
71
|
"vitest": "^4.1.2"
|
|
@@ -86,7 +87,7 @@
|
|
|
86
87
|
"build:napi-types": "node scripts/build-napi-types.mjs",
|
|
87
88
|
"test": "vitest run",
|
|
88
89
|
"test:rust": "cargo test -p warden-engine",
|
|
89
|
-
"lint": "biome check src/",
|
|
90
|
+
"lint": "biome check src/ tests/",
|
|
90
91
|
"test:coverage": "vitest run --coverage",
|
|
91
92
|
"typecheck": "tsc --noEmit",
|
|
92
93
|
"test:integration": "vitest run -c vitest.integration.config.ts"
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* cargo a `/tmp/...` path the native proc-macro cannot write to, so the
|
|
8
8
|
* type-def file comes back empty and the build fails for no visible reason.
|
|
9
9
|
*
|
|
10
|
-
* One crate at a time on purpose: napi-derive
|
|
10
|
+
* One crate at a time on purpose: with napi-derive 2 the writes all went to a
|
|
11
|
+
* single `TYPE_DEF_TMP_PATH` and a parallel build interleaved them
|
|
11
12
|
* while cargo compiles, and a parallel build interleaves the writes —
|
|
12
13
|
* definitions go missing, silently, and the generated file comes out short.
|
|
13
14
|
*/
|
|
@@ -28,11 +29,11 @@ const scratch = mkdtempSync(join(tmpdir(), 'napi-types-'))
|
|
|
28
29
|
try {
|
|
29
30
|
const lines = []
|
|
30
31
|
for (const crate of CRATES) {
|
|
31
|
-
const perCrate = join(scratch,
|
|
32
|
+
const perCrate = join(scratch, crate)
|
|
32
33
|
writeFileSync(perCrate, '')
|
|
33
34
|
execFileSync('cargo', ['build', '-p', crate], {
|
|
34
35
|
cwd: packageRoot,
|
|
35
|
-
env: { ...process.env,
|
|
36
|
+
env: { ...process.env, NAPI_TYPE_DEF_TMP_FOLDER: scratch },
|
|
36
37
|
stdio: ['ignore', 'ignore', 'inherit'],
|
|
37
38
|
})
|
|
38
39
|
const emitted = readFileSync(perCrate, 'utf8').split('\n').filter(Boolean)
|