nmtjs 0.15.0-beta.1 → 0.15.0-beta.3

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.
Files changed (112) hide show
  1. package/dist/_exports/application.d.ts +1 -0
  2. package/dist/_exports/application.js +2 -0
  3. package/dist/_exports/application.js.map +1 -0
  4. package/dist/_exports/common.d.ts +1 -0
  5. package/dist/_exports/common.js +2 -0
  6. package/dist/_exports/common.js.map +1 -0
  7. package/dist/_exports/contract.d.ts +2 -0
  8. package/dist/_exports/contract.js +3 -0
  9. package/dist/_exports/contract.js.map +1 -0
  10. package/dist/_exports/core.d.ts +1 -0
  11. package/dist/_exports/core.js +2 -0
  12. package/dist/_exports/core.js.map +1 -0
  13. package/dist/_exports/gateway.d.ts +1 -0
  14. package/dist/_exports/gateway.js +2 -0
  15. package/dist/_exports/gateway.js.map +1 -0
  16. package/dist/_exports/http-transport/bun.d.ts +1 -0
  17. package/dist/_exports/http-transport/bun.js +2 -0
  18. package/dist/_exports/http-transport/bun.js.map +1 -0
  19. package/dist/_exports/http-transport/deno.d.ts +1 -0
  20. package/dist/_exports/http-transport/deno.js +2 -0
  21. package/dist/_exports/http-transport/deno.js.map +1 -0
  22. package/dist/_exports/http-transport/node.d.ts +1 -0
  23. package/dist/_exports/http-transport/node.js +2 -0
  24. package/dist/_exports/http-transport/node.js.map +1 -0
  25. package/dist/_exports/http-transport.d.ts +1 -0
  26. package/dist/_exports/http-transport.js +2 -0
  27. package/dist/_exports/http-transport.js.map +1 -0
  28. package/dist/_exports/index.d.ts +61 -0
  29. package/dist/_exports/index.js +40 -0
  30. package/dist/_exports/index.js.map +1 -0
  31. package/dist/_exports/json-format.d.ts +1 -0
  32. package/dist/_exports/json-format.js +2 -0
  33. package/dist/_exports/json-format.js.map +1 -0
  34. package/dist/_exports/protocol/client.d.ts +1 -0
  35. package/dist/_exports/protocol/client.js +2 -0
  36. package/dist/_exports/protocol/client.js.map +1 -0
  37. package/dist/_exports/protocol/server.d.ts +1 -0
  38. package/dist/_exports/protocol/server.js +2 -0
  39. package/dist/_exports/protocol/server.js.map +1 -0
  40. package/dist/_exports/protocol.d.ts +1 -0
  41. package/dist/_exports/protocol.js +2 -0
  42. package/dist/_exports/protocol.js.map +1 -0
  43. package/dist/_exports/runtime/types.d.ts +1 -0
  44. package/dist/_exports/runtime/types.js +2 -0
  45. package/dist/_exports/runtime/types.js.map +1 -0
  46. package/dist/_exports/runtime.d.ts +1 -0
  47. package/dist/_exports/runtime.js +2 -0
  48. package/dist/_exports/runtime.js.map +1 -0
  49. package/dist/_exports/type.d.ts +2 -0
  50. package/dist/_exports/type.js +3 -0
  51. package/dist/_exports/type.js.map +1 -0
  52. package/dist/_exports/ws-transport/bun.d.ts +1 -0
  53. package/dist/_exports/ws-transport/bun.js +2 -0
  54. package/dist/_exports/ws-transport/bun.js.map +1 -0
  55. package/dist/_exports/ws-transport/deno.d.ts +1 -0
  56. package/dist/_exports/ws-transport/deno.js +2 -0
  57. package/dist/_exports/ws-transport/deno.js.map +1 -0
  58. package/dist/_exports/ws-transport/node.d.ts +1 -0
  59. package/dist/_exports/ws-transport/node.js +2 -0
  60. package/dist/_exports/ws-transport/node.js.map +1 -0
  61. package/dist/_exports/ws-transport.d.ts +1 -0
  62. package/dist/_exports/ws-transport.js +2 -0
  63. package/dist/_exports/ws-transport.js.map +1 -0
  64. package/dist/cli.d.ts +2 -0
  65. package/dist/cli.js +122 -0
  66. package/dist/cli.js.map +1 -0
  67. package/dist/command.d.ts +1 -0
  68. package/dist/command.js +31 -0
  69. package/dist/command.js.map +1 -0
  70. package/dist/config.d.ts +48 -0
  71. package/dist/config.js +14 -0
  72. package/dist/config.js.map +1 -0
  73. package/dist/entrypoints/cli.d.ts +1 -0
  74. package/dist/entrypoints/cli.js +12 -0
  75. package/dist/entrypoints/cli.js.map +1 -0
  76. package/dist/entrypoints/main.d.ts +5 -0
  77. package/dist/entrypoints/main.js +86 -0
  78. package/dist/entrypoints/main.js.map +1 -0
  79. package/dist/entrypoints/thread.d.ts +14 -0
  80. package/dist/entrypoints/thread.js +53 -0
  81. package/dist/entrypoints/thread.js.map +1 -0
  82. package/dist/entrypoints/worker.d.ts +3 -0
  83. package/dist/entrypoints/worker.js +42 -0
  84. package/dist/entrypoints/worker.js.map +1 -0
  85. package/dist/resolver.d.ts +2 -0
  86. package/dist/resolver.js +15 -0
  87. package/dist/resolver.js.map +1 -0
  88. package/dist/typings.d.ts +4 -0
  89. package/dist/typings.js +18 -0
  90. package/dist/typings.js.map +1 -0
  91. package/dist/vite/builder.d.ts +5 -0
  92. package/dist/vite/builder.js +110 -0
  93. package/dist/vite/builder.js.map +1 -0
  94. package/dist/vite/config.d.ts +27 -0
  95. package/dist/vite/config.js +22 -0
  96. package/dist/vite/config.js.map +1 -0
  97. package/dist/vite/plugins.d.ts +2 -0
  98. package/dist/vite/plugins.js +18 -0
  99. package/dist/vite/plugins.js.map +1 -0
  100. package/dist/vite/runners/worker.d.ts +4 -0
  101. package/dist/vite/runners/worker.js +33 -0
  102. package/dist/vite/runners/worker.js.map +1 -0
  103. package/dist/vite/server.d.ts +3 -0
  104. package/dist/vite/server.js +18 -0
  105. package/dist/vite/server.js.map +1 -0
  106. package/dist/vite/servers/main.d.ts +8 -0
  107. package/dist/vite/servers/main.js +23 -0
  108. package/dist/vite/servers/main.js.map +1 -0
  109. package/dist/vite/servers/worker.d.ts +8 -0
  110. package/dist/vite/servers/worker.js +79 -0
  111. package/dist/vite/servers/worker.js.map +1 -0
  112. package/package.json +14 -14
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/runtime/application';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/runtime/application';
2
+ //# sourceMappingURL=application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.js","sourceRoot":"","sources":["../../src/_exports/application.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/common';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/common';
2
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/_exports/common.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/contract';
2
+ export { default } from '@nmtjs/contract';
@@ -0,0 +1,3 @@
1
+ export * from '@nmtjs/contract';
2
+ export { default } from '@nmtjs/contract';
3
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/_exports/contract.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/core';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/core';
2
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/_exports/core.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/gateway';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/gateway';
2
+ //# sourceMappingURL=gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/_exports/gateway.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/http-transport/bun';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/http-transport/bun';
2
+ //# sourceMappingURL=bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun.js","sourceRoot":"","sources":["../../../src/_exports/http-transport/bun.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/http-transport/deno';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/http-transport/deno';
2
+ //# sourceMappingURL=deno.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deno.js","sourceRoot":"","sources":["../../../src/_exports/http-transport/deno.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/http-transport/node';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/http-transport/node';
2
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/_exports/http-transport/node.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/http-transport';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/http-transport';
2
+ //# sourceMappingURL=http-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-transport.js","sourceRoot":"","sources":["../../src/_exports/http-transport.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,61 @@
1
+ import { createConsolePrettyDestination, createFactoryInjectable, createLazyInjectable, createOptionalInjectable, createValueInjectable } from '@nmtjs/core';
2
+ import { createTransport } from '@nmtjs/gateway';
3
+ import { createContractProcedure, createContractRouter, createFilter, createGuard, createHook, createJob, createMiddleware, createPlugin, createProcedure, createRouter, createStep, defineApplication } from '@nmtjs/runtime';
4
+ export declare const neemata: {
5
+ app: typeof defineApplication;
6
+ injectables: {
7
+ pubSubAdapter: import("@nmtjs/core").LazyInjectable<import("@nmtjs/runtime").PubSubAdapterType, import("@nmtjs/core").Scope.Global>;
8
+ pubSubPublish: import("@nmtjs/core").LazyInjectable<import("@nmtjs/runtime").PubSubPublish, import("@nmtjs/core").Scope.Global>;
9
+ pubSubSubscribe: import("@nmtjs/core").LazyInjectable<import("@nmtjs/runtime").PubSubSubscribe, import("@nmtjs/core").Scope.Global>;
10
+ jobManager: import("@nmtjs/core").LazyInjectable<import("@nmtjs/runtime").JobManagerInstance, import("@nmtjs/core").Scope.Global>;
11
+ storeConfig: import("@nmtjs/core").LazyInjectable<import("@nmtjs/runtime").ServerStoreConfig, import("@nmtjs/core").Scope.Global>;
12
+ connection: import("@nmtjs/core").LazyInjectable<import("@nmtjs/gateway").GatewayConnection, import("@nmtjs/core").Scope.Connection>;
13
+ connectionId: import("@nmtjs/core").LazyInjectable<string, import("@nmtjs/core").Scope.Connection>;
14
+ connectionData: import("@nmtjs/core").LazyInjectable<unknown, import("@nmtjs/core").Scope.Connection>;
15
+ connectionAbortSignal: import("@nmtjs/core").LazyInjectable<AbortSignal, import("@nmtjs/core").Scope.Connection>;
16
+ rpcClientAbortSignal: import("@nmtjs/core").LazyInjectable<AbortSignal, import("@nmtjs/core").Scope.Call>;
17
+ rpcStreamAbortSignal: import("@nmtjs/core").LazyInjectable<AbortSignal, import("@nmtjs/core").Scope.Call>;
18
+ rpcAbortSignal: import("@nmtjs/core").FactoryInjectable<AbortSignal, {
19
+ rpcClientAbortSignal: import("@nmtjs/core").LazyInjectable<AbortSignal, import("@nmtjs/core").Scope.Call>;
20
+ connectionAbortSignal: import("@nmtjs/core").LazyInjectable<AbortSignal, import("@nmtjs/core").Scope.Connection>;
21
+ rpcStreamAbortSignal: import("@nmtjs/core").DependencyOptional<import("@nmtjs/core").LazyInjectable<AbortSignal, import("@nmtjs/core").Scope.Call>>;
22
+ }, import("@nmtjs/core").Scope.Global, AbortSignal>;
23
+ createBlob: import("@nmtjs/core").LazyInjectable<(source: import("stream").Readable | globalThis.ReadableStream | File | Blob | string | ArrayBuffer | Uint8Array, metadata?: import("@nmtjs/protocol").ProtocolBlobMetadata) => import("@nmtjs/protocol").ProtocolBlobInterface, import("@nmtjs/core").Scope.Call>;
24
+ logger: ((label: string) => import("@nmtjs/core").FactoryInjectable<import("@nmtjs/core").Logger, {
25
+ logger: import("@nmtjs/core").LazyInjectable<import("@nmtjs/core").Logger>;
26
+ }>) & import("@nmtjs/core").LazyInjectable<import("@nmtjs/core").Logger, import("@nmtjs/core").Scope.Global>;
27
+ inject: import("@nmtjs/core").LazyInjectable<(<T extends import("@nmtjs/core").AnyInjectable>(injectable: T, context: { [K in keyof T["dependencies"]]?: import("@nmtjs/core").ResolveInjectableType<T["dependencies"][K]> | import("@nmtjs/core").AnyInjectable<import("@nmtjs/core").ResolveInjectableType<T["dependencies"][K]>> | undefined; }, scope?: Exclude<import("@nmtjs/core").Scope, import("@nmtjs/core").Scope.Transient>) => Promise<import("@nmtjs/core").ResolveInjectableType<T>>) & {
28
+ explicit: <T extends import("@nmtjs/core").AnyInjectable>(injectable: T, context: { [K in keyof T["dependencies"]]?: import("@nmtjs/core").ResolveInjectableType<T["dependencies"][K]> | import("@nmtjs/core").AnyInjectable<import("@nmtjs/core").ResolveInjectableType<T["dependencies"][K]>> | undefined; }, scope?: Exclude<import("@nmtjs/core").Scope, import("@nmtjs/core").Scope.Transient>) => Promise<{
29
+ instance: Awaited<import("@nmtjs/core").ResolveInjectableType<T>>;
30
+ [Symbol.asyncDispose]: () => Promise<void>;
31
+ }>;
32
+ }, import("@nmtjs/core").Scope.Global>;
33
+ dispose: import("@nmtjs/core").LazyInjectable<(<T extends import("@nmtjs/core").AnyInjectable>(injectable: T, instance?: any) => Promise<void>), import("@nmtjs/core").Scope.Global>;
34
+ };
35
+ transport: typeof createTransport;
36
+ plugin: typeof createPlugin;
37
+ logging: {
38
+ console: typeof createConsolePrettyDestination;
39
+ };
40
+ optional: typeof createOptionalInjectable;
41
+ value: typeof createValueInjectable;
42
+ lazy: typeof createLazyInjectable;
43
+ factory: typeof createFactoryInjectable;
44
+ router: typeof createRouter;
45
+ contractRouter: typeof createContractRouter;
46
+ procedure: typeof createProcedure;
47
+ contractProcedure: typeof createContractProcedure;
48
+ middleware: typeof createMiddleware;
49
+ guard: typeof createGuard;
50
+ filter: typeof createFilter;
51
+ job: typeof createJob;
52
+ step: typeof createStep;
53
+ hook: typeof createHook;
54
+ };
55
+ export { c } from '@nmtjs/contract';
56
+ export { Scope } from '@nmtjs/core';
57
+ export { ErrorCode, ProtocolBlob } from '@nmtjs/protocol';
58
+ export { t } from '@nmtjs/type';
59
+ export { ApiError, defineApplication, LifecycleHook } from 'nmtjs/runtime';
60
+ export { neemata as n };
61
+ export default neemata;
@@ -0,0 +1,40 @@
1
+ import { CoreInjectables, createConsolePrettyDestination, createFactoryInjectable, createLazyInjectable, createOptionalInjectable, createValueInjectable, } from '@nmtjs/core';
2
+ import { createTransport, GatewayInjectables } from '@nmtjs/gateway';
3
+ import { createContractProcedure, createContractRouter, createFilter, createGuard, createHook, createJob, createMiddleware, createPlugin, createProcedure, createRouter, createStep, defineApplication, RuntimeInjectables, } from '@nmtjs/runtime';
4
+ export const neemata = {
5
+ app: defineApplication,
6
+ injectables: {
7
+ ...CoreInjectables,
8
+ ...GatewayInjectables,
9
+ ...RuntimeInjectables,
10
+ },
11
+ transport: createTransport,
12
+ plugin: createPlugin,
13
+ logging: {
14
+ console:
15
+ // TODO: TSC wants it
16
+ createConsolePrettyDestination,
17
+ },
18
+ optional: createOptionalInjectable,
19
+ value: createValueInjectable,
20
+ lazy: createLazyInjectable,
21
+ factory: createFactoryInjectable,
22
+ router: createRouter,
23
+ contractRouter: createContractRouter,
24
+ procedure: createProcedure,
25
+ contractProcedure: createContractProcedure,
26
+ middleware: createMiddleware,
27
+ guard: createGuard,
28
+ filter: createFilter,
29
+ job: createJob,
30
+ step: createStep,
31
+ hook: createHook,
32
+ };
33
+ export { c } from '@nmtjs/contract';
34
+ export { Scope } from '@nmtjs/core';
35
+ export { ErrorCode, ProtocolBlob } from '@nmtjs/protocol';
36
+ export { t } from '@nmtjs/type';
37
+ export { ApiError, defineApplication, LifecycleHook } from 'nmtjs/runtime';
38
+ export { neemata as n };
39
+ export default neemata;
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/_exports/index.ts"],"names":[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AC/B,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE1E,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,CAAA;AACvB,eAAe,OAAO,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/json-format/server';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/json-format/server';
2
+ //# sourceMappingURL=json-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-format.js","sourceRoot":"","sources":["../../src/_exports/json-format.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/protocol/client';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/protocol/client';
2
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/_exports/protocol/client.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/protocol/server';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/protocol/server';
2
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/_exports/protocol/server.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/protocol';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/protocol';
2
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/_exports/protocol.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/runtime/types';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/runtime/types';
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/_exports/runtime/types.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/runtime';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/runtime';
2
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/_exports/runtime.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/type';
2
+ export { default } from '@nmtjs/type';
@@ -0,0 +1,3 @@
1
+ export * from '@nmtjs/type';
2
+ export { default } from '@nmtjs/type';
3
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/_exports/type.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/ws-transport/bun';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/ws-transport/bun';
2
+ //# sourceMappingURL=bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun.js","sourceRoot":"","sources":["../../../src/_exports/ws-transport/bun.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/ws-transport/deno';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/ws-transport/deno';
2
+ //# sourceMappingURL=deno.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deno.js","sourceRoot":"","sources":["../../../src/_exports/ws-transport/deno.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/ws-transport/node';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/ws-transport/node';
2
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/_exports/ws-transport/node.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '@nmtjs/ws-transport';
@@ -0,0 +1,2 @@
1
+ export * from '@nmtjs/ws-transport';
2
+ //# sourceMappingURL=ws-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-transport.js","sourceRoot":"","sources":["../../src/_exports/ws-transport.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node --enable-source-maps
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node --enable-source-maps
2
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
3
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
4
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
5
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
6
+ });
7
+ }
8
+ return path;
9
+ };
10
+ import { once } from 'node:events';
11
+ import { relative, resolve } from 'node:path';
12
+ import process from 'node:process';
13
+ import { defineCommand, runMain } from 'citty';
14
+ import { config as dotenv } from 'dotenv';
15
+ import { resolver } from "./resolver.js";
16
+ import { generateTypings } from "./typings.js";
17
+ import { createBuilder } from "./vite/builder.js";
18
+ import { baseViteConfigOptions } from "./vite/config.js";
19
+ import { createMainServer } from "./vite/servers/main.js";
20
+ // import { createMainRunner } from './vite/runner.ts'
21
+ const commonArgs = {
22
+ config: {
23
+ type: 'string',
24
+ alias: 'c',
25
+ default: './neemata.config.ts',
26
+ description: 'Path to Neemata config file',
27
+ required: false,
28
+ },
29
+ };
30
+ let config;
31
+ let viteConfigOptions;
32
+ let applicationImports;
33
+ const mainCommand = defineCommand({
34
+ meta: { description: 'Neemata CLI' },
35
+ args: { ...commonArgs },
36
+ async setup(ctx) {
37
+ const configPath = resolve(ctx.args.config);
38
+ config = await import(__rewriteRelativeImportExtension(configPath)).then((m) => m.default);
39
+ for (const env of config.env) {
40
+ if (typeof env === 'string') {
41
+ const { error } = dotenv({ path: env });
42
+ if (error)
43
+ console.warn(error);
44
+ }
45
+ else if (typeof env === 'object') {
46
+ for (const key in env) {
47
+ process.env[key] = env[key];
48
+ }
49
+ }
50
+ }
51
+ // const applicationEntryPaths: Record<string, string> = {}
52
+ applicationImports = {};
53
+ const currentPkg = resolver.sync(process.cwd(), './package.json');
54
+ for (const [appName, appSpecifier] of Object.entries(config.applications)) {
55
+ const resolution = resolver.sync(process.cwd(), appSpecifier);
56
+ if (resolution.error)
57
+ throw new Error(`Failed to resolve application path for ${appName}: ${resolution.error}`);
58
+ if (!resolution.path)
59
+ throw new Error(`Failed to resolve application path for ${appName}: no path found`);
60
+ const specifier = resolution.packageJsonPath === currentPkg.path
61
+ ? relative(resolve('.neemata'), resolution.path)
62
+ : appSpecifier;
63
+ applicationImports[appName] = { path: resolution.path, specifier };
64
+ }
65
+ viteConfigOptions = {
66
+ applicationImports,
67
+ serverEntryPath: resolve(config.serverPath),
68
+ ...baseViteConfigOptions,
69
+ configPath,
70
+ };
71
+ },
72
+ subCommands: {
73
+ prepare: defineCommand({
74
+ async run(ctx) {
75
+ await generateTypings(applicationImports);
76
+ },
77
+ }),
78
+ dev: defineCommand({
79
+ async run(ctx) {
80
+ const { runner } = await createMainServer(viteConfigOptions, 'development', config);
81
+ await runner.import(viteConfigOptions.entrypointMainPath);
82
+ await once(process, 'beforeExit');
83
+ },
84
+ }),
85
+ preview: defineCommand({
86
+ async run(ctx) {
87
+ const { runner } = await createMainServer(viteConfigOptions, 'production', config);
88
+ await runner.import(viteConfigOptions.entrypointMainPath);
89
+ await once(process, 'beforeExit');
90
+ },
91
+ }),
92
+ build: defineCommand({
93
+ async run(ctx) {
94
+ const builder = await createBuilder(viteConfigOptions, config);
95
+ await builder.build();
96
+ },
97
+ }),
98
+ // command: defineCommand({
99
+ // async run(ctx) {
100
+ // const runner = await createRunner(
101
+ // viteConfigOptions,
102
+ // 'production',
103
+ // config,
104
+ // )
105
+ // const workerModule = await runner.import<
106
+ // typeof import('./entrypoints/worker.ts')
107
+ // >(import.meta.resolve('./entrypoints/worker.js'))
108
+ // const commandModule = await runner.import<
109
+ // typeof import('./command.ts')
110
+ // >(import.meta.resolve('./command.js'))
111
+ // const worker = await workerModule.default({
112
+ // applicationWorkerData: undefined,
113
+ // type: ApplicationType.Command,
114
+ // workerType: ApplicationWorkerType.Command,
115
+ // })
116
+ // await runMain(commandModule.default(worker), { rawArgs: ctx.rawArgs })
117
+ // },
118
+ // }),
119
+ },
120
+ });
121
+ runMain(mainCommand);
122
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,OAAO,MAAM,cAAc,CAAA;AAGlC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,sDA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CAAA;gBACD,MAAM,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAA;gBACzD,MAAM,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;YACnC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,aAAa,CAAC;YACrB,KAAK,CAAC,GAAG,CAAC,GAAG;gBACX,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CACvC,iBAAiB,EACjB,YAAY,EACZ,MAAM,CACP,CAAA;gBACD,MAAM,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAA;gBACzD,MAAM,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;YACnC,CAAC;SACF,CAAC;QACF,KAAK,EAAE,aAAa,CAAC;YACnB,KAAK,CAAC,GAAG,CAAC,GAAG;gBACX,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;gBAC9D,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;YACvB,CAAC;SACF,CAAC;QACF,2BAA2B;QAC3B,qBAAqB;QACrB,yCAAyC;QACzC,2BAA2B;QAC3B,sBAAsB;QACtB,gBAAgB;QAChB,QAAQ;QACR,gDAAgD;QAChD,iDAAiD;QACjD,wDAAwD;QACxD,iDAAiD;QACjD,sCAAsC;QACtC,6CAA6C;QAC7C,kDAAkD;QAClD,0CAA0C;QAC1C,uCAAuC;QACvC,mDAAmD;QACnD,SAAS;QACT,6EAA6E;QAC7E,OAAO;QACP,MAAM;KACP;CACF,CAAC,CAAA;AAEF,OAAO,CAAC,WAAW,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ // import type { ApplicationWorker } from '@nmtjs/runtime/worker'
2
+ // import { typeToString } from '@nmtjs/type'
3
+ // import { defineCommand } from 'citty'
4
+ export {};
5
+ // export default (worker: ApplicationWorker) =>
6
+ // defineCommand({
7
+ // meta: { description: 'Application CLI' },
8
+ // subCommands: {
9
+ // list: defineCommand({
10
+ // async run(ctx) {
11
+ // worker.app.initializeCore()
12
+ // const commands = Array.from(worker.app.registry.commands).map(
13
+ // ([name, command]) => ({
14
+ // command: name,
15
+ // args: typeToString(command.args),
16
+ // kwargs: typeToString(command.kwargs),
17
+ // }),
18
+ // )
19
+ // console.table(commands, ['command', 'args', 'kwargs'])
20
+ // },
21
+ // }),
22
+ // execute: defineCommand({
23
+ // async run(ctx) {
24
+ // const { _: positionals, ...kwargs } = ctx.args
25
+ // const [commandName, ...args] = positionals
26
+ // await worker.runCommand(commandName, args, kwargs)
27
+ // },
28
+ // }),
29
+ // },
30
+ // })
31
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,6CAA6C;AAC7C,wCAAwC;;AAExC,gDAAgD;AAChD,oBAAoB;AACpB,gDAAgD;AAChD,qBAAqB;AACrB,8BAA8B;AAC9B,2BAA2B;AAC3B,wCAAwC;AACxC,2EAA2E;AAC3E,sCAAsC;AACtC,+BAA+B;AAC/B,kDAAkD;AAClD,sDAAsD;AACtD,kBAAkB;AAClB,cAAc;AACd,mEAAmE;AACnE,aAAa;AACb,YAAY;AACZ,iCAAiC;AACjC,2BAA2B;AAC3B,2DAA2D;AAC3D,uDAAuD;AACvD,+DAA+D;AAC/D,aAAa;AACb,YAAY;AACZ,SAAS;AACT,OAAO"}
@@ -0,0 +1,48 @@
1
+ import type { Plugin as VitePlugin } from 'vite';
2
+ export type ExtrernalDependency = string | RegExp;
3
+ type DeepPartial<T> = {
4
+ [P in keyof T]?: T[P] extends Record<any, unknown> ? DeepPartial<T[P]> : T[P];
5
+ };
6
+ export interface NeemataConfig {
7
+ /**
8
+ * Path to application entry point
9
+ */
10
+ applications: {
11
+ /**
12
+ * Application name
13
+ */
14
+ [appName: string]: string;
15
+ };
16
+ /**
17
+ * Path to server entry point
18
+ */
19
+ serverPath: string;
20
+ /**
21
+ * External dependencies to exclude from application bundle
22
+ *
23
+ * 'prod' - exclude production dependencies from package.json
24
+ *
25
+ * 'all' - exclude all dependencies from package.json
26
+ *
27
+ * ExtrernalDependency[] - array of package names or regular expressions to match package names
28
+ */
29
+ externalDependencies: 'prod' | 'all' | ExtrernalDependency[];
30
+ /**
31
+ * Timeout in milliseconds for graceful shutdown of application workers
32
+ */
33
+ timeout: number;
34
+ /**
35
+ * Environment variables to set for application workers
36
+ *
37
+ * Strings are paths to .env files
38
+ * Records are key-value pairs to set directly
39
+ */
40
+ env: (Record<string, string> | string)[];
41
+ build: {
42
+ outDir: string;
43
+ minify: boolean;
44
+ };
45
+ plugins: VitePlugin[];
46
+ }
47
+ export declare function defineConfig(config?: DeepPartial<NeemataConfig>): NeemataConfig;
48
+ export {};
package/dist/config.js ADDED
@@ -0,0 +1,14 @@
1
+ export function defineConfig(config = {}) {
2
+ return {
3
+ serverPath: './src/server.ts',
4
+ externalDependencies: 'prod',
5
+ timeout: 10000,
6
+ env: [],
7
+ plugins: [],
8
+ ...config,
9
+ // @ts-expect-error
10
+ applications: config.applications || {},
11
+ build: { outDir: './dist', minify: true, ...config.build },
12
+ };
13
+ }
14
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAiDA,MAAM,UAAU,YAAY,CAC1B,SAAqC,EAAE;IAEvC,OAAO;QACL,UAAU,EAAE,iBAAiB;QAC7B,oBAAoB,EAAE,MAAM;QAC5B,OAAO,EAAE,KAAK;QACd,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,EAAE;QACX,GAAG,MAAM;QACT,mBAAmB;QACnB,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,EAAE;QACvC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE;KAC3D,CAAA;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ // // import { ApplicationType, ApplicationWorkerType } from '@nmtjs/application'
2
+ // import { runMain } from 'citty'
3
+ export {};
4
+ // import command from '../command.ts'
5
+ // import createWorker from './worker.ts'
6
+ // const worker = await createWorker({
7
+ // applicationWorkerData: undefined,
8
+ // // type: ApplicationType.Command,
9
+ // // workerType: ApplicationWorkerType.Command,
10
+ // })
11
+ // runMain(command(worker))
12
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/entrypoints/cli.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kCAAkC;;AAElC,sCAAsC;AACtC,yCAAyC;AAEzC,sCAAsC;AACtC,sCAAsC;AACtC,sCAAsC;AACtC,kDAAkD;AAClD,KAAK;AAEL,2BAA2B"}
@@ -0,0 +1,5 @@
1
+ declare global {
2
+ const __VITE_CONFIG__: string;
3
+ const __APPLICATIONS_CONFIG__: string;
4
+ }
5
+ export {};