@procedures/client 0.2.3 → 0.4.0
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/CHANGELOG.md +94 -0
- package/README.md +77 -44
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapters/http/client/transport.d.ts.map +1 -1
- package/dist/adapters/http/client/transport.js +35 -3
- package/dist/adapters/http/client/transport.js.map +1 -1
- package/dist/adapters/http/client/types.d.ts +3 -2
- package/dist/adapters/http/client/types.d.ts.map +1 -1
- package/dist/adapters/http/server/transport.d.ts +2 -2
- package/dist/adapters/http/server/transport.d.ts.map +1 -1
- package/dist/adapters/http/server/transport.js +54 -22
- package/dist/adapters/http/server/transport.js.map +1 -1
- package/dist/adapters/http/shared/headers.d.ts +1 -1
- package/dist/adapters/http/shared/headers.d.ts.map +1 -1
- package/dist/adapters/http/shared/headers.js +7 -6
- package/dist/adapters/http/shared/headers.js.map +1 -1
- package/dist/adapters/local/client/transport.d.ts +3 -0
- package/dist/adapters/local/client/transport.d.ts.map +1 -1
- package/dist/adapters/local/client/transport.js +67 -6
- package/dist/adapters/local/client/transport.js.map +1 -1
- package/dist/adapters/local/client/types.d.ts +15 -0
- package/dist/adapters/local/client/types.d.ts.map +1 -1
- package/dist/adapters/local/client/types.js.map +1 -1
- package/dist/adapters/mock/client/transport.d.ts +3 -2
- package/dist/adapters/mock/client/transport.d.ts.map +1 -1
- package/dist/adapters/mock/client/transport.js +8 -5
- package/dist/adapters/mock/client/transport.js.map +1 -1
- package/dist/adapters/mock/client/types.d.ts +7 -6
- package/dist/adapters/mock/client/types.d.ts.map +1 -1
- package/dist/adapters/port/transport.d.ts +62 -0
- package/dist/adapters/port/transport.d.ts.map +1 -0
- package/dist/adapters/port/transport.js +94 -0
- package/dist/adapters/port/transport.js.map +1 -0
- package/dist/adapters/websocket/client/index.d.ts +1 -1
- package/dist/adapters/websocket/client/index.d.ts.map +1 -1
- package/dist/adapters/websocket/client/index.js.map +1 -1
- package/dist/adapters/websocket/client/node.d.ts +30 -0
- package/dist/adapters/websocket/client/node.d.ts.map +1 -0
- package/dist/adapters/websocket/client/node.js +32 -0
- package/dist/adapters/websocket/client/node.js.map +1 -0
- package/dist/adapters/websocket/client/transport.d.ts +47 -7
- package/dist/adapters/websocket/client/transport.d.ts.map +1 -1
- package/dist/adapters/websocket/client/transport.js +229 -75
- package/dist/adapters/websocket/client/transport.js.map +1 -1
- package/dist/adapters/websocket/client/types.d.ts +71 -21
- package/dist/adapters/websocket/client/types.d.ts.map +1 -1
- package/dist/adapters/websocket/client/types.js.map +1 -1
- package/dist/adapters/websocket/server/transport.d.ts +65 -24
- package/dist/adapters/websocket/server/transport.d.ts.map +1 -1
- package/dist/adapters/websocket/server/transport.js +192 -263
- package/dist/adapters/websocket/server/transport.js.map +1 -1
- package/dist/adapters/websocket/server/types.d.ts +20 -1
- package/dist/adapters/websocket/server/types.d.ts.map +1 -1
- package/dist/adapters/websocket/shared/rpc.d.ts +129 -0
- package/dist/adapters/websocket/shared/rpc.d.ts.map +1 -0
- package/dist/adapters/websocket/shared/rpc.js +425 -0
- package/dist/adapters/websocket/shared/rpc.js.map +1 -0
- package/dist/browser.d.ts +29 -7
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +26 -3
- package/dist/browser.js.map +1 -1
- package/dist/client/call-types.d.ts +10 -10
- package/dist/client/call-types.d.ts.map +1 -1
- package/dist/client/call-types.js +1 -6
- package/dist/client/call-types.js.map +1 -1
- package/dist/client/client.d.ts +6 -1
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +23 -9
- package/dist/client/client.js.map +1 -1
- package/dist/client/deadline.d.ts +38 -0
- package/dist/client/deadline.d.ts.map +1 -0
- package/dist/client/deadline.js +60 -0
- package/dist/client/deadline.js.map +1 -0
- package/dist/client/errors/factory.d.ts.map +1 -1
- package/dist/client/errors/factory.js +11 -7
- package/dist/client/errors/factory.js.map +1 -1
- package/dist/client/errors/http-errors.d.ts.map +1 -1
- package/dist/client/errors/http-errors.js +6 -0
- package/dist/client/errors/http-errors.js.map +1 -1
- package/dist/client/errors/index.d.ts +1 -1
- package/dist/client/errors/index.js +1 -1
- package/dist/client/errors/registry.d.ts +2 -1
- package/dist/client/errors/registry.d.ts.map +1 -1
- package/dist/client/errors/registry.js +72 -22
- package/dist/client/errors/registry.js.map +1 -1
- package/dist/client/index.d.ts +9 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +8 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/middleware/cache.d.ts +19 -5
- package/dist/client/middleware/cache.d.ts.map +1 -1
- package/dist/client/middleware/cache.js +106 -18
- package/dist/client/middleware/cache.js.map +1 -1
- package/dist/client/middleware/circuit-breaker.d.ts +28 -10
- package/dist/client/middleware/circuit-breaker.d.ts.map +1 -1
- package/dist/client/middleware/circuit-breaker.js +35 -24
- package/dist/client/middleware/circuit-breaker.js.map +1 -1
- package/dist/client/middleware/contexts.d.ts +16 -10
- package/dist/client/middleware/contexts.d.ts.map +1 -1
- package/dist/client/middleware/contexts.js.map +1 -1
- package/dist/client/middleware/items.d.ts +31 -2
- package/dist/client/middleware/items.d.ts.map +1 -1
- package/dist/client/middleware/items.js +86 -6
- package/dist/client/middleware/items.js.map +1 -1
- package/dist/client/middleware/lru.d.ts +2 -0
- package/dist/client/middleware/lru.d.ts.map +1 -1
- package/dist/client/middleware/lru.js +11 -0
- package/dist/client/middleware/lru.js.map +1 -1
- package/dist/client/middleware/rate-limit.d.ts +7 -6
- package/dist/client/middleware/rate-limit.d.ts.map +1 -1
- package/dist/client/middleware/rate-limit.js +9 -7
- package/dist/client/middleware/rate-limit.js.map +1 -1
- package/dist/client/middleware/resilience.d.ts +61 -0
- package/dist/client/middleware/resilience.d.ts.map +1 -0
- package/dist/client/middleware/resilience.js +59 -0
- package/dist/client/middleware/resilience.js.map +1 -0
- package/dist/client/middleware/retry.d.ts +45 -11
- package/dist/client/middleware/retry.d.ts.map +1 -1
- package/dist/client/middleware/retry.js +102 -22
- package/dist/client/middleware/retry.js.map +1 -1
- package/dist/client/middleware/timeout.d.ts +15 -12
- package/dist/client/middleware/timeout.d.ts.map +1 -1
- package/dist/client/middleware/timeout.js +48 -46
- package/dist/client/middleware/timeout.js.map +1 -1
- package/dist/client/middleware/tracing.d.ts.map +1 -1
- package/dist/client/middleware/tracing.js +11 -3
- package/dist/client/middleware/tracing.js.map +1 -1
- package/dist/client/types.d.ts +9 -1
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/clock.d.ts +19 -0
- package/dist/clock.d.ts.map +1 -0
- package/dist/clock.js +18 -0
- package/dist/clock.js.map +1 -0
- package/dist/duration.d.ts +37 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/duration.js +44 -0
- package/dist/duration.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/machines.d.ts +90 -0
- package/dist/machines.d.ts.map +1 -0
- package/dist/machines.js +127 -0
- package/dist/machines.js.map +1 -0
- package/dist/node.d.ts +11 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +10 -0
- package/dist/node.js.map +1 -0
- package/dist/procedures/capability.d.ts +3 -6
- package/dist/procedures/capability.d.ts.map +1 -1
- package/dist/procedures/capability.js +7 -8
- package/dist/procedures/capability.js.map +1 -1
- package/dist/procedures/collection/index.d.ts +3 -3
- package/dist/procedures/collection/index.d.ts.map +1 -1
- package/dist/procedures/collection/index.js +1 -1
- package/dist/procedures/collection/index.js.map +1 -1
- package/dist/procedures/collection/procedures.d.ts.map +1 -1
- package/dist/procedures/collection/procedures.js +49 -1
- package/dist/procedures/collection/procedures.js.map +1 -1
- package/dist/procedures/collection/schemas.d.ts +33 -0
- package/dist/procedures/collection/schemas.d.ts.map +1 -1
- package/dist/procedures/collection/schemas.js +68 -0
- package/dist/procedures/collection/schemas.js.map +1 -1
- package/dist/procedures/collection/storage.d.ts +37 -0
- package/dist/procedures/collection/storage.d.ts.map +1 -1
- package/dist/procedures/core/array.d.ts +1 -1
- package/dist/procedures/core/array.d.ts.map +1 -1
- package/dist/procedures/core/array.js +81 -29
- package/dist/procedures/core/array.js.map +1 -1
- package/dist/procedures/core/index.d.ts.map +1 -1
- package/dist/procedures/core/index.js +17 -2
- package/dist/procedures/core/index.js.map +1 -1
- package/dist/procedures/core/logic.js +1 -1
- package/dist/procedures/core/logic.js.map +1 -1
- package/dist/procedures/core/math.d.ts.map +1 -1
- package/dist/procedures/core/math.js +5 -1
- package/dist/procedures/core/math.js.map +1 -1
- package/dist/procedures/core/meta.d.ts.map +1 -1
- package/dist/procedures/core/meta.js +43 -8
- package/dist/procedures/core/meta.js.map +1 -1
- package/dist/procedures/core/object.d.ts.map +1 -1
- package/dist/procedures/core/object.js +42 -13
- package/dist/procedures/core/object.js.map +1 -1
- package/dist/procedures/core/operands.d.ts.map +1 -1
- package/dist/procedures/core/operands.js +6 -1
- package/dist/procedures/core/operands.js.map +1 -1
- package/dist/procedures/core/string.d.ts.map +1 -1
- package/dist/procedures/core/string.js +4 -2
- package/dist/procedures/core/string.js.map +1 -1
- package/dist/procedures/core/type.d.ts.map +1 -1
- package/dist/procedures/core/type.js +4 -2
- package/dist/procedures/core/type.js.map +1 -1
- package/dist/procedures/define-procedure.d.ts +19 -7
- package/dist/procedures/define-procedure.d.ts.map +1 -1
- package/dist/procedures/define-procedure.js +57 -17
- package/dist/procedures/define-procedure.js.map +1 -1
- package/dist/procedures/discovery.d.ts +4 -6
- package/dist/procedures/discovery.d.ts.map +1 -1
- package/dist/procedures/discovery.js +4 -6
- package/dist/procedures/discovery.js.map +1 -1
- package/dist/procedures/effects.d.ts +16 -0
- package/dist/procedures/effects.d.ts.map +1 -1
- package/dist/procedures/effects.js +33 -0
- package/dist/procedures/effects.js.map +1 -1
- package/dist/procedures/idempotency.d.ts +73 -0
- package/dist/procedures/idempotency.d.ts.map +1 -0
- package/dist/procedures/idempotency.js +131 -0
- package/dist/procedures/idempotency.js.map +1 -0
- package/dist/procedures/index.d.ts +7 -3
- package/dist/procedures/index.d.ts.map +1 -1
- package/dist/procedures/index.js +6 -2
- package/dist/procedures/index.js.map +1 -1
- package/dist/procedures/interceptors.d.ts +17 -4
- package/dist/procedures/interceptors.d.ts.map +1 -1
- package/dist/procedures/interceptors.js +18 -7
- package/dist/procedures/interceptors.js.map +1 -1
- package/dist/procedures/invoke.d.ts +15 -3
- package/dist/procedures/invoke.d.ts.map +1 -1
- package/dist/procedures/invoke.js +8 -3
- package/dist/procedures/invoke.js.map +1 -1
- package/dist/procedures/manifest.d.ts +83 -0
- package/dist/procedures/manifest.d.ts.map +1 -0
- package/dist/procedures/manifest.js +90 -0
- package/dist/procedures/manifest.js.map +1 -0
- package/dist/procedures/ref.d.ts +4 -2
- package/dist/procedures/ref.d.ts.map +1 -1
- package/dist/procedures/ref.js +2 -1
- package/dist/procedures/ref.js.map +1 -1
- package/dist/procedures/runtime-programs.d.ts +19 -0
- package/dist/procedures/runtime-programs.d.ts.map +1 -0
- package/dist/procedures/runtime-programs.js +24 -0
- package/dist/procedures/runtime-programs.js.map +1 -0
- package/dist/procedures/types.d.ts +16 -0
- package/dist/procedures/types.d.ts.map +1 -1
- package/dist/procedures/types.js.map +1 -1
- package/dist/protocol.d.ts +47 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +68 -0
- package/dist/protocol.js.map +1 -0
- package/dist/server/host-policy.d.ts +4 -3
- package/dist/server/host-policy.d.ts.map +1 -1
- package/dist/server/host-policy.js +6 -3
- package/dist/server/host-policy.js.map +1 -1
- package/dist/server/host-procedures.d.ts +31 -0
- package/dist/server/host-procedures.d.ts.map +1 -0
- package/dist/server/host-procedures.js +75 -0
- package/dist/server/host-procedures.js.map +1 -0
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/procedure-server.d.ts +112 -5
- package/dist/server/procedure-server.d.ts.map +1 -1
- package/dist/server/procedure-server.js +273 -19
- package/dist/server/procedure-server.js.map +1 -1
- package/dist/server/request-auth.d.ts +19 -0
- package/dist/server/request-auth.d.ts.map +1 -0
- package/dist/server/request-auth.js +32 -0
- package/dist/server/request-auth.js.map +1 -0
- package/dist/server/types.d.ts +32 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js.map +1 -1
- package/dist/timers.d.ts +60 -0
- package/dist/timers.d.ts.map +1 -0
- package/dist/timers.js +33 -0
- package/dist/timers.js.map +1 -0
- package/dist/tracing/traceparent.d.ts +26 -0
- package/dist/tracing/traceparent.d.ts.map +1 -0
- package/dist/tracing/traceparent.js +53 -0
- package/dist/tracing/traceparent.js.map +1 -0
- package/package.json +11 -4
- package/src/adapters/http/client/transport.ts +31 -3
- package/src/adapters/http/client/types.ts +3 -2
- package/src/adapters/http/server/transport.ts +61 -26
- package/src/adapters/http/shared/headers.ts +7 -6
- package/src/adapters/local/client/transport.ts +74 -7
- package/src/adapters/local/client/types.ts +18 -0
- package/src/adapters/mock/client/transport.ts +9 -6
- package/src/adapters/mock/client/types.ts +7 -6
- package/src/adapters/port/transport.ts +124 -0
- package/src/adapters/websocket/client/index.ts +1 -0
- package/src/adapters/websocket/client/node.ts +34 -0
- package/src/adapters/websocket/client/transport.ts +251 -81
- package/src/adapters/websocket/client/types.ts +81 -21
- package/src/adapters/websocket/server/transport.ts +199 -301
- package/src/adapters/websocket/server/types.ts +20 -1
- package/src/adapters/websocket/shared/rpc.ts +453 -0
- package/src/browser.ts +51 -3
- package/src/client/call-types.ts +10 -14
- package/src/client/client.ts +28 -9
- package/src/client/deadline.ts +64 -0
- package/src/client/errors/README.md +2 -0
- package/src/client/errors/factory.ts +12 -8
- package/src/client/errors/http-errors.ts +5 -0
- package/src/client/errors/index.ts +1 -1
- package/src/client/errors/registry.ts +79 -22
- package/src/client/index.ts +21 -3
- package/src/client/middleware/cache.ts +120 -23
- package/src/client/middleware/circuit-breaker.ts +65 -35
- package/src/client/middleware/contexts.ts +17 -10
- package/src/client/middleware/items.ts +101 -6
- package/src/client/middleware/lru.ts +12 -0
- package/src/client/middleware/rate-limit.ts +9 -9
- package/src/client/middleware/resilience.ts +81 -0
- package/src/client/middleware/retry.ts +146 -34
- package/src/client/middleware/timeout.ts +57 -55
- package/src/client/middleware/tracing.ts +13 -4
- package/src/client/types.ts +9 -1
- package/src/clock.ts +21 -0
- package/src/duration.ts +56 -0
- package/src/index.ts +4 -0
- package/src/machines.ts +186 -0
- package/src/node.ts +11 -0
- package/src/procedures/capability.ts +7 -8
- package/src/procedures/collection/index.ts +9 -1
- package/src/procedures/collection/procedures.ts +57 -0
- package/src/procedures/collection/schemas.ts +110 -0
- package/src/procedures/collection/storage.ts +38 -0
- package/src/procedures/core/array.ts +79 -31
- package/src/procedures/core/index.ts +17 -2
- package/src/procedures/core/logic.ts +1 -1
- package/src/procedures/core/math.ts +5 -1
- package/src/procedures/core/meta.ts +45 -8
- package/src/procedures/core/object.ts +48 -14
- package/src/procedures/core/operands.ts +7 -0
- package/src/procedures/core/string.ts +4 -2
- package/src/procedures/core/type.ts +4 -2
- package/src/procedures/define-procedure.ts +73 -20
- package/src/procedures/discovery.ts +4 -6
- package/src/procedures/effects.ts +35 -0
- package/src/procedures/idempotency.ts +152 -0
- package/src/procedures/index.ts +18 -2
- package/src/procedures/interceptors.ts +28 -11
- package/src/procedures/invoke.ts +19 -5
- package/src/procedures/manifest.ts +158 -0
- package/src/procedures/ref.ts +4 -2
- package/src/procedures/runtime-programs.ts +27 -0
- package/src/procedures/types.ts +16 -0
- package/src/protocol.ts +108 -0
- package/src/server/host-policy.ts +8 -5
- package/src/server/host-procedures.ts +102 -0
- package/src/server/index.ts +5 -2
- package/src/server/procedure-server.ts +328 -12
- package/src/server/request-auth.ts +35 -0
- package/src/server/types.ts +37 -0
- package/src/timers.ts +82 -0
- package/src/tracing/traceparent.ts +61 -0
- package/dist/procedures/cli/announce.d.ts +0 -67
- package/dist/procedures/cli/announce.d.ts.map +0 -1
- package/dist/procedures/cli/announce.js +0 -392
- package/dist/procedures/cli/announce.js.map +0 -1
- package/dist/procedures/cli/discover.d.ts +0 -66
- package/dist/procedures/cli/discover.d.ts.map +0 -1
- package/dist/procedures/cli/discover.js +0 -310
- package/dist/procedures/cli/discover.js.map +0 -1
- package/dist/procedures/cli/index.d.ts +0 -13
- package/dist/procedures/cli/index.d.ts.map +0 -1
- package/dist/procedures/cli/index.js +0 -203
- package/dist/procedures/cli/index.js.map +0 -1
- package/dist/procedures/cli/init.d.ts +0 -17
- package/dist/procedures/cli/init.d.ts.map +0 -1
- package/dist/procedures/cli/init.js +0 -336
- package/dist/procedures/cli/init.js.map +0 -1
- package/src/procedures/cli/announce.ts +0 -470
- package/src/procedures/cli/discover.ts +0 -390
- package/src/procedures/cli/index.ts +0 -231
- package/src/procedures/cli/init.ts +0 -370
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Procedure Announcement (Self-Registration)
|
|
3
|
-
*
|
|
4
|
-
* When a package with procedures is installed, it "announces" itself
|
|
5
|
-
* by writing to a registry file at the root of the project.
|
|
6
|
-
*
|
|
7
|
-
* This enables true bottom-up propagation:
|
|
8
|
-
* - Each package with procedures has `"postinstall": "client-registry announce"`
|
|
9
|
-
* - On install, it walks up to find the root and registers itself
|
|
10
|
-
* - `client-registry discover` reads this registry instead of scanning
|
|
11
|
-
*
|
|
12
|
-
* The registry file (.client-registry.json) accumulates entries from
|
|
13
|
-
* all packages as they're installed, making discovery instant.
|
|
14
|
-
*/
|
|
15
|
-
export interface AnnounceOptions {
|
|
16
|
-
/** Be verbose about what's happening */
|
|
17
|
-
verbose: boolean;
|
|
18
|
-
/** The folder to start from (default: the current folder) */
|
|
19
|
-
cwd?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Add `client-registry announce` to the postinstall script of the package that depends on this one.
|
|
22
|
-
* This edits a package.json that belongs to the consumer, so it happens only when asked
|
|
23
|
-
* (`client-registry announce --propagate`). Default: false.
|
|
24
|
-
*/
|
|
25
|
-
propagate?: boolean | undefined;
|
|
26
|
-
}
|
|
27
|
-
interface RegistryEntry {
|
|
28
|
-
/** Path to procedures file relative to package */
|
|
29
|
-
proceduresPath: string;
|
|
30
|
-
/** When this entry was added */
|
|
31
|
-
registeredAt: string;
|
|
32
|
-
/** Package version */
|
|
33
|
-
version?: string;
|
|
34
|
-
}
|
|
35
|
-
interface Registry {
|
|
36
|
-
/** Schema version for future compatibility */
|
|
37
|
-
schemaVersion: 1;
|
|
38
|
-
/** Map of package name to registry entry */
|
|
39
|
-
packages: Record<string, RegistryEntry>;
|
|
40
|
-
}
|
|
41
|
-
declare const REGISTRY_FILENAME = ".client-registry.json";
|
|
42
|
-
/**
|
|
43
|
-
* Announce this package's procedures to the project registry.
|
|
44
|
-
*
|
|
45
|
-
* Called from a package's postinstall script to register its procedures.
|
|
46
|
-
*
|
|
47
|
-
* With `propagate: true` (`client-registry announce --propagate`), it also adds the postinstall script
|
|
48
|
-
* to the package that depends on this one, for transitive discovery:
|
|
49
|
-
* - When client is installed in package D, client's postinstall adds postinstall to D
|
|
50
|
-
* - When D is installed in C, D's postinstall adds postinstall to C
|
|
51
|
-
* - When C is installed in B, C's postinstall adds postinstall to B
|
|
52
|
-
*
|
|
53
|
-
* The propagation edits the package.json of the consumer, so it happens only when asked.
|
|
54
|
-
* Without it, each package that has its own postinstall script still registers itself.
|
|
55
|
-
*/
|
|
56
|
-
export declare function announce(options: AnnounceOptions): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Remove this package from the registry (for uninstall).
|
|
59
|
-
*/
|
|
60
|
-
export declare function unannounce(options: AnnounceOptions): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Get the registry for use by discover command.
|
|
63
|
-
*/
|
|
64
|
-
export declare function getRegistry(rootDir: string): Promise<Registry>;
|
|
65
|
-
export { REGISTRY_FILENAME };
|
|
66
|
-
export type { Registry, RegistryEntry };
|
|
67
|
-
//# sourceMappingURL=announce.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"announce.d.ts","sourceRoot":"","sources":["../../../src/procedures/cli/announce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACjC;AAED,UAAU,aAAa;IACrB,kDAAkD;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,QAAQ;IAChB,8CAA8C;IAC9C,aAAa,EAAE,CAAC,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACzC;AAkFD,QAAA,MAAM,iBAAiB,0BAA0B,CAAC;AA0GlD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BtE;AAiKD;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEpE;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Procedure Announcement (Self-Registration)
|
|
3
|
-
*
|
|
4
|
-
* When a package with procedures is installed, it "announces" itself
|
|
5
|
-
* by writing to a registry file at the root of the project.
|
|
6
|
-
*
|
|
7
|
-
* This enables true bottom-up propagation:
|
|
8
|
-
* - Each package with procedures has `"postinstall": "client-registry announce"`
|
|
9
|
-
* - On install, it walks up to find the root and registers itself
|
|
10
|
-
* - `client-registry discover` reads this registry instead of scanning
|
|
11
|
-
*
|
|
12
|
-
* The registry file (.client-registry.json) accumulates entries from
|
|
13
|
-
* all packages as they're installed, making discovery instant.
|
|
14
|
-
*/
|
|
15
|
-
import * as fs from "node:fs/promises";
|
|
16
|
-
import * as path from "node:path";
|
|
17
|
-
// =============================================================================
|
|
18
|
-
// Path Utilities
|
|
19
|
-
// =============================================================================
|
|
20
|
-
/**
|
|
21
|
-
* Find the root of the project (topmost directory with package.json that isn't in node_modules).
|
|
22
|
-
*/
|
|
23
|
-
async function findProjectRoot(startDir) {
|
|
24
|
-
let current = path.resolve(startDir);
|
|
25
|
-
let lastValidRoot = null;
|
|
26
|
-
while (true) {
|
|
27
|
-
const pkgPath = path.join(current, "package.json");
|
|
28
|
-
try {
|
|
29
|
-
await fs.access(pkgPath);
|
|
30
|
-
// Check if we're inside node_modules
|
|
31
|
-
const isInNodeModules = current.includes("node_modules");
|
|
32
|
-
if (!isInNodeModules) {
|
|
33
|
-
// This is a valid root candidate
|
|
34
|
-
lastValidRoot = current;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
// No package.json here
|
|
39
|
-
}
|
|
40
|
-
const parent = path.dirname(current);
|
|
41
|
-
if (parent === current) {
|
|
42
|
-
// Reached filesystem root
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
current = parent;
|
|
46
|
-
}
|
|
47
|
-
return lastValidRoot;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Find the package that contains the current directory.
|
|
51
|
-
* This is the package that depends on client and is being installed.
|
|
52
|
-
*/
|
|
53
|
-
async function findContainingPackage(startDir) {
|
|
54
|
-
let current = path.resolve(startDir);
|
|
55
|
-
while (true) {
|
|
56
|
-
const pkgPath = path.join(current, "package.json");
|
|
57
|
-
try {
|
|
58
|
-
const content = await fs.readFile(pkgPath, "utf-8");
|
|
59
|
-
const pkg = JSON.parse(content);
|
|
60
|
-
return { dir: current, pkg };
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
// No package.json here, go up
|
|
64
|
-
}
|
|
65
|
-
const parent = path.dirname(current);
|
|
66
|
-
if (parent === current) {
|
|
67
|
-
// Reached filesystem root
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
current = parent;
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
// =============================================================================
|
|
75
|
-
// Registry Operations
|
|
76
|
-
// =============================================================================
|
|
77
|
-
const REGISTRY_FILENAME = ".client-registry.json";
|
|
78
|
-
/**
|
|
79
|
-
* Read the registry file, or return an empty registry if the file does not exist.
|
|
80
|
-
*
|
|
81
|
-
* Any other failure is an error. Before, every failure gave an empty registry, so a read that
|
|
82
|
-
* failed (a corrupt file, a file that Windows held for a moment) made the next write remove
|
|
83
|
-
* every entry.
|
|
84
|
-
*/
|
|
85
|
-
async function readRegistry(rootDir) {
|
|
86
|
-
const registryPath = path.join(rootDir, REGISTRY_FILENAME);
|
|
87
|
-
let content;
|
|
88
|
-
try {
|
|
89
|
-
content = await retryOnWindowsContention(() => fs.readFile(registryPath, "utf-8"));
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
if (error.code === "ENOENT") {
|
|
93
|
-
return { schemaVersion: 1, packages: {} };
|
|
94
|
-
}
|
|
95
|
-
throw error;
|
|
96
|
-
}
|
|
97
|
-
return JSON.parse(content);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Run a file operation again when Windows reports that another process holds the file for a
|
|
101
|
-
* moment (EPERM, EACCES, EBUSY): a rename over a file that a reader has open fails that way.
|
|
102
|
-
*/
|
|
103
|
-
async function retryOnWindowsContention(operation) {
|
|
104
|
-
for (let attempt = 1;; attempt++) {
|
|
105
|
-
try {
|
|
106
|
-
return await operation();
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
if (attempt >= 20 || !isLockContention(error) || error.code === "EEXIST")
|
|
110
|
-
throw error;
|
|
111
|
-
await new Promise((resolve) => setTimeout(resolve, 10 * attempt));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Write the registry file: to a temporary file, then a rename, so a reader never sees a part.
|
|
117
|
-
*/
|
|
118
|
-
async function writeRegistry(rootDir, registry) {
|
|
119
|
-
const registryPath = path.join(rootDir, REGISTRY_FILENAME);
|
|
120
|
-
const content = JSON.stringify(registry, null, 2) + "\n";
|
|
121
|
-
const temporary = `${registryPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
122
|
-
try {
|
|
123
|
-
await fs.writeFile(temporary, content, "utf-8");
|
|
124
|
-
await retryOnWindowsContention(() => fs.rename(temporary, registryPath));
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
await fs.rm(temporary, { force: true });
|
|
128
|
-
throw error;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/** A lock older than this belongs to a process that stopped: it is removed. */
|
|
132
|
-
const STALE_LOCK_MS = 10_000;
|
|
133
|
-
/**
|
|
134
|
-
* True when another writer holds the lock. On Windows, a lock file that its owner is deleting
|
|
135
|
-
* cannot be opened until the delete completes: `open` fails with EPERM (or EACCES, EBUSY), not
|
|
136
|
-
* EEXIST.
|
|
137
|
-
*/
|
|
138
|
-
function isLockContention(error) {
|
|
139
|
-
const code = error.code;
|
|
140
|
-
if (code === "EEXIST")
|
|
141
|
-
return true;
|
|
142
|
-
return process.platform === "win32" && (code === "EPERM" || code === "EACCES" || code === "EBUSY");
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Read, change and write the registry under a lock file. Package managers run postinstall
|
|
146
|
-
* scripts in parallel: without the lock, two announcements read the same registry, and the
|
|
147
|
-
* second write loses the first entry (deep dive CORE-17).
|
|
148
|
-
*/
|
|
149
|
-
async function updateRegistry(rootDir, change) {
|
|
150
|
-
const lockPath = path.join(rootDir, `${REGISTRY_FILENAME}.lock`);
|
|
151
|
-
const deadline = Date.now() + 30_000;
|
|
152
|
-
for (;;) {
|
|
153
|
-
try {
|
|
154
|
-
const handle = await fs.open(lockPath, "wx");
|
|
155
|
-
await handle.close();
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
if (!isLockContention(error) || Date.now() > deadline)
|
|
160
|
-
throw error;
|
|
161
|
-
try {
|
|
162
|
-
const { mtimeMs } = await fs.stat(lockPath);
|
|
163
|
-
if (Date.now() - mtimeMs > STALE_LOCK_MS)
|
|
164
|
-
await fs.rm(lockPath, { force: true });
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
// The lock went away: try again
|
|
168
|
-
}
|
|
169
|
-
await new Promise((resolve) => setTimeout(resolve, 10 + Math.random() * 20));
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
try {
|
|
173
|
-
const registry = await readRegistry(rootDir);
|
|
174
|
-
if (change(registry)) {
|
|
175
|
-
await writeRegistry(rootDir, registry);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
finally {
|
|
179
|
-
await fs.rm(lockPath, { force: true });
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// =============================================================================
|
|
183
|
-
// Main
|
|
184
|
-
// =============================================================================
|
|
185
|
-
/**
|
|
186
|
-
* Announce this package's procedures to the project registry.
|
|
187
|
-
*
|
|
188
|
-
* Called from a package's postinstall script to register its procedures.
|
|
189
|
-
*
|
|
190
|
-
* With `propagate: true` (`client-registry announce --propagate`), it also adds the postinstall script
|
|
191
|
-
* to the package that depends on this one, for transitive discovery:
|
|
192
|
-
* - When client is installed in package D, client's postinstall adds postinstall to D
|
|
193
|
-
* - When D is installed in C, D's postinstall adds postinstall to C
|
|
194
|
-
* - When C is installed in B, C's postinstall adds postinstall to B
|
|
195
|
-
*
|
|
196
|
-
* The propagation edits the package.json of the consumer, so it happens only when asked.
|
|
197
|
-
* Without it, each package that has its own postinstall script still registers itself.
|
|
198
|
-
*/
|
|
199
|
-
export async function announce(options) {
|
|
200
|
-
const { verbose } = options;
|
|
201
|
-
// Find the package we're in (the one whose postinstall is running)
|
|
202
|
-
const containing = await findContainingPackage(options.cwd ?? process.cwd());
|
|
203
|
-
if (!containing) {
|
|
204
|
-
if (verbose) {
|
|
205
|
-
console.log("[client] No package.json found, skipping announcement");
|
|
206
|
-
}
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
const { dir: packageDir, pkg } = containing;
|
|
210
|
-
// Propagate the postinstall script to the parent package only when asked: it edits the
|
|
211
|
-
// consumer's package.json (deep dive CORE-17)
|
|
212
|
-
if (options.propagate) {
|
|
213
|
-
await propagatePostinstallToParent(packageDir, pkg, verbose);
|
|
214
|
-
}
|
|
215
|
-
// If this package has procedures, register them
|
|
216
|
-
if (pkg.client?.procedures) {
|
|
217
|
-
await registerProcedures(packageDir, pkg, verbose);
|
|
218
|
-
}
|
|
219
|
-
else if (verbose) {
|
|
220
|
-
console.log(`[client] ${pkg.name} does not declare procedures`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Register this package's procedures at the project root.
|
|
225
|
-
*/
|
|
226
|
-
async function registerProcedures(packageDir, pkg, verbose) {
|
|
227
|
-
// Find the project root
|
|
228
|
-
const projectRoot = await findProjectRoot(packageDir);
|
|
229
|
-
if (!projectRoot) {
|
|
230
|
-
if (verbose) {
|
|
231
|
-
console.log("[client] Could not find project root, skipping registration");
|
|
232
|
-
}
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
// Don't register if we ARE the project root (we're the app, not a dependency)
|
|
236
|
-
if (path.resolve(packageDir) === path.resolve(projectRoot)) {
|
|
237
|
-
if (verbose) {
|
|
238
|
-
console.log(`[client] ${pkg.name} is the project root, skipping self-registration`);
|
|
239
|
-
}
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
// Add/update our entry, under the lock
|
|
243
|
-
const entry = {
|
|
244
|
-
proceduresPath: pkg.client.procedures,
|
|
245
|
-
registeredAt: new Date().toISOString(),
|
|
246
|
-
};
|
|
247
|
-
if (pkg.version) {
|
|
248
|
-
entry.version = pkg.version;
|
|
249
|
-
}
|
|
250
|
-
await updateRegistry(projectRoot, (registry) => {
|
|
251
|
-
registry.packages[pkg.name] = entry;
|
|
252
|
-
return true;
|
|
253
|
-
});
|
|
254
|
-
if (verbose) {
|
|
255
|
-
console.log(`[client] Registered ${pkg.name} -> ${pkg.client.procedures}`);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Propagate postinstall to the parent package.
|
|
260
|
-
* This ensures the chain continues when this package is installed elsewhere.
|
|
261
|
-
*/
|
|
262
|
-
async function propagatePostinstallToParent(packageDir, pkg, verbose) {
|
|
263
|
-
// Find parent package (the one that depends on this package)
|
|
264
|
-
const parent = await findParentPackage(packageDir);
|
|
265
|
-
if (!parent) {
|
|
266
|
-
if (verbose) {
|
|
267
|
-
console.log(`[client] No parent package found for ${pkg.name}`);
|
|
268
|
-
}
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
const { dir: parentDir, pkg: parentPkg } = parent;
|
|
272
|
-
// Don't modify packages inside node_modules of other packages
|
|
273
|
-
// We only want to modify the immediate dependent
|
|
274
|
-
if (isNestedNodeModules(parentDir)) {
|
|
275
|
-
if (verbose) {
|
|
276
|
-
console.log(`[client] Parent ${parentPkg.name} is nested in node_modules, skipping`);
|
|
277
|
-
}
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
await ensurePostinstall(parentDir, parentPkg, verbose);
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Find the parent package (the one that depends on the current package).
|
|
284
|
-
* Walks up from node_modules to find the containing project.
|
|
285
|
-
*/
|
|
286
|
-
async function findParentPackage(packageDir) {
|
|
287
|
-
let current = path.dirname(packageDir);
|
|
288
|
-
while (true) {
|
|
289
|
-
// Skip node_modules directories
|
|
290
|
-
const basename = path.basename(current);
|
|
291
|
-
if (basename === "node_modules") {
|
|
292
|
-
current = path.dirname(current);
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
const pkgPath = path.join(current, "package.json");
|
|
296
|
-
try {
|
|
297
|
-
const content = await fs.readFile(pkgPath, "utf-8");
|
|
298
|
-
const pkg = JSON.parse(content);
|
|
299
|
-
return { dir: current, pkg };
|
|
300
|
-
}
|
|
301
|
-
catch {
|
|
302
|
-
// No package.json here
|
|
303
|
-
}
|
|
304
|
-
const parent = path.dirname(current);
|
|
305
|
-
if (parent === current) {
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
current = parent;
|
|
309
|
-
}
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Check if a path is inside nested node_modules (e.g., node_modules/a/node_modules/b).
|
|
314
|
-
*/
|
|
315
|
-
function isNestedNodeModules(dir) {
|
|
316
|
-
const normalized = dir.replace(/\\/g, "/");
|
|
317
|
-
const parts = normalized.split("/node_modules/");
|
|
318
|
-
return parts.length > 2;
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Ensure a package has the postinstall script for propagation.
|
|
322
|
-
*/
|
|
323
|
-
async function ensurePostinstall(packageDir, pkg, verbose) {
|
|
324
|
-
const pkgPath = path.join(packageDir, "package.json");
|
|
325
|
-
let fullPkg;
|
|
326
|
-
try {
|
|
327
|
-
fullPkg = JSON.parse(await fs.readFile(pkgPath, "utf-8"));
|
|
328
|
-
}
|
|
329
|
-
catch {
|
|
330
|
-
if (verbose) {
|
|
331
|
-
console.log(`[client] Could not read ${pkgPath}`);
|
|
332
|
-
}
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
const scripts = (fullPkg["scripts"] ?? {});
|
|
336
|
-
const postinstall = scripts["postinstall"] ?? "";
|
|
337
|
-
// Check if postinstall already includes client-registry announce
|
|
338
|
-
if (postinstall.includes("client-registry announce")) {
|
|
339
|
-
if (verbose) {
|
|
340
|
-
console.log(`[client] ${pkg.name} already has client-registry announce in postinstall`);
|
|
341
|
-
}
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
// Add client-registry announce to postinstall (cross-platform, no shell-specific syntax)
|
|
345
|
-
// The CLI handles errors internally and always exits 0
|
|
346
|
-
const newPostinstall = postinstall
|
|
347
|
-
? `${postinstall} && client-registry announce`
|
|
348
|
-
: "client-registry announce";
|
|
349
|
-
scripts["postinstall"] = newPostinstall;
|
|
350
|
-
fullPkg["scripts"] = scripts;
|
|
351
|
-
try {
|
|
352
|
-
await fs.writeFile(pkgPath, JSON.stringify(fullPkg, null, 2) + "\n", "utf-8");
|
|
353
|
-
if (verbose) {
|
|
354
|
-
console.log(`[client] Added postinstall to ${pkg.name}`);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
catch (error) {
|
|
358
|
-
if (verbose) {
|
|
359
|
-
console.log(`[client] Could not write to ${pkgPath}: ${error}`);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Remove this package from the registry (for uninstall).
|
|
365
|
-
*/
|
|
366
|
-
export async function unannounce(options) {
|
|
367
|
-
const { verbose } = options;
|
|
368
|
-
const containing = await findContainingPackage(options.cwd ?? process.cwd());
|
|
369
|
-
if (!containing)
|
|
370
|
-
return;
|
|
371
|
-
const { dir: packageDir, pkg } = containing;
|
|
372
|
-
const projectRoot = await findProjectRoot(packageDir);
|
|
373
|
-
if (!projectRoot)
|
|
374
|
-
return;
|
|
375
|
-
await updateRegistry(projectRoot, (registry) => {
|
|
376
|
-
if (!registry.packages[pkg.name])
|
|
377
|
-
return false;
|
|
378
|
-
delete registry.packages[pkg.name];
|
|
379
|
-
if (verbose) {
|
|
380
|
-
console.log(`[client] Unregistered ${pkg.name}`);
|
|
381
|
-
}
|
|
382
|
-
return true;
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Get the registry for use by discover command.
|
|
387
|
-
*/
|
|
388
|
-
export async function getRegistry(rootDir) {
|
|
389
|
-
return readRegistry(rootDir);
|
|
390
|
-
}
|
|
391
|
-
export { REGISTRY_FILENAME };
|
|
392
|
-
//# sourceMappingURL=announce.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"announce.js","sourceRoot":"","sources":["../../../src/procedures/cli/announce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AA2ClC,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF;;GAEG;AACH,KAAK,UAAU,eAAe,CAAC,QAAgB;IAC7C,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,aAAa,GAAkB,IAAI,CAAC;IAExC,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAEnD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAEzB,qCAAqC;YACrC,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;YAEzD,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,iCAAiC;gBACjC,aAAa,GAAG,OAAO,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,uBAAuB;QACzB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;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1
|
-
/**
|
|
2
|
-
* Procedure Discovery
|
|
3
|
-
*
|
|
4
|
-
* Generates a TypeScript file with static imports for all discovered procedures.
|
|
5
|
-
*
|
|
6
|
-
* Fast path: Reads from .client-registry.json (populated by `client-registry announce`)
|
|
7
|
-
* Fallback: Scans node_modules for packages with `client.procedures`
|
|
8
|
-
*
|
|
9
|
-
* This is compile-time discovery - the generated file contains static imports
|
|
10
|
-
* that get compiled/bundled with your application.
|
|
11
|
-
*/
|
|
12
|
-
export interface DiscoverOptions {
|
|
13
|
-
/** Output file path */
|
|
14
|
-
output: string;
|
|
15
|
-
/** Root directory to scan from */
|
|
16
|
-
root: string;
|
|
17
|
-
/** Watch mode for development */
|
|
18
|
-
watch: boolean;
|
|
19
|
-
/** Check if generated file is up-to-date (CI mode) */
|
|
20
|
-
check: boolean;
|
|
21
|
-
/** Verbose logging */
|
|
22
|
-
verbose: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** A package that declares procedures. */
|
|
25
|
-
export interface DiscoveredPackage {
|
|
26
|
-
name: string;
|
|
27
|
-
proceduresPath: string;
|
|
28
|
-
/** The module specifier that the generated file imports */
|
|
29
|
-
importPath: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* The specifier that imports the procedures file of a package. With an `exports` map, a bare
|
|
33
|
-
* `pkg/dist/register.js` import fails unless the map exports that path: the function looks for
|
|
34
|
-
* the subpath (also a `./*` pattern) whose target is the file: for the packages of this
|
|
35
|
-
* repository, `./register`. When the map has none, it imports the package root. (Before, the
|
|
36
|
-
* generated import ignored the map, and failed: deep dive CORE-17.)
|
|
37
|
-
*
|
|
38
|
-
* @param name - Package name
|
|
39
|
-
* @param manifest - The package.json of the package
|
|
40
|
-
* @param proceduresPath - The `client.procedures` field
|
|
41
|
-
* @returns The module specifier for the generated import
|
|
42
|
-
*/
|
|
43
|
-
export declare function procedureImportPath(name: string, manifest: {
|
|
44
|
-
exports?: unknown;
|
|
45
|
-
}, proceduresPath: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Discover packages with procedure declarations: the dependencies of the root package and
|
|
48
|
-
* their dependencies, in `node_modules`.
|
|
49
|
-
*
|
|
50
|
-
* @param rootDir - The folder of the root package.json
|
|
51
|
-
* @param verbose - Log each package
|
|
52
|
-
* @returns The packages that declare procedures, sorted by name
|
|
53
|
-
*/
|
|
54
|
-
export declare function discoverPackages(rootDir: string, verbose: boolean): Promise<DiscoveredPackage[]>;
|
|
55
|
-
/**
|
|
56
|
-
* Generate the TypeScript file content.
|
|
57
|
-
*
|
|
58
|
-
* @param packages - The discovered packages
|
|
59
|
-
* @returns The file content: one side-effect import for each package
|
|
60
|
-
*/
|
|
61
|
-
export declare function generateCode(packages: DiscoveredPackage[]): string;
|
|
62
|
-
/**
|
|
63
|
-
* Run procedure discovery.
|
|
64
|
-
*/
|
|
65
|
-
export declare function discover(options: DiscoverOptions): Promise<void>;
|
|
66
|
-
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/procedures/cli/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,sDAAsD;IACtD,KAAK,EAAE,OAAO,CAAC;IACf,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAYD,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAyBjH;AAMD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAqF9B;AAMD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAiClE;AAmDD;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA2FtE"}
|