@orieljs/foundation 0.1.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 meeeet-dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,93 @@
1
+ import { ServiceProvider, ServiceProviderClass, MiddlewareConfigurator, ExceptionsConfigurator, Application as Application$1, HttpKernel } from '@orieljs/contracts';
2
+ import { Container } from '@orieljs/container';
3
+
4
+ interface RoutingOptions {
5
+ web?: string;
6
+ api?: string;
7
+ console?: string;
8
+ /** A URI such as '/up', not a file. */
9
+ health?: string;
10
+ apiPrefix?: string;
11
+ }
12
+ type Lifecycle = (app: Application$1) => void | Promise<void>;
13
+ declare class ApplicationBuilder {
14
+ private readonly app;
15
+ private readonly providers;
16
+ private readonly middleware;
17
+ private readonly exceptions;
18
+ private routing;
19
+ constructor(app: Application);
20
+ withProviders(providers?: Array<ServiceProvider | ServiceProviderClass>): this;
21
+ withRouting(options: RoutingOptions): this;
22
+ withMiddleware(callback: (middleware: MiddlewareConfigurator) => void): this;
23
+ withExceptions(callback: (exceptions: ExceptionsConfigurator) => void): this;
24
+ booting(callback: Lifecycle): this;
25
+ booted(callback: Lifecycle): this;
26
+ create(): Promise<Application>;
27
+ }
28
+
29
+ type LifecycleCallback = (app: Application$1) => void | Promise<void>;
30
+ declare class Application extends Container implements Application$1 {
31
+ private readonly base;
32
+ readonly version = "0.0.0";
33
+ private readonly providers;
34
+ private readonly bootingCallbacks;
35
+ private readonly bootedCallbacks;
36
+ private readonly terminatingCallbacks;
37
+ private bootPromise;
38
+ private hasBooted;
39
+ private inConsole;
40
+ constructor(base: string);
41
+ /** Entry point used by bootstrap/app.ts. */
42
+ static configure(options: {
43
+ basePath: string;
44
+ }): ApplicationBuilder;
45
+ basePath(path?: string): string;
46
+ appPath(path?: string): string;
47
+ bootstrapPath(path?: string): string;
48
+ configPath(path?: string): string;
49
+ databasePath(path?: string): string;
50
+ publicPath(path?: string): string;
51
+ resourcePath(path?: string): string;
52
+ storagePath(path?: string): string;
53
+ environment(): string;
54
+ environment(...environments: string[]): boolean;
55
+ isProduction(): boolean;
56
+ isLocal(): boolean;
57
+ runningUnitTests(): boolean;
58
+ runningInConsole(): boolean;
59
+ setRunningInConsole(value?: boolean): void;
60
+ register(provider: ServiceProvider | ServiceProviderClass): Promise<ServiceProvider>;
61
+ getProviders(): ServiceProvider[];
62
+ boot(): Promise<void>;
63
+ isBooted(): boolean;
64
+ booting(callback: LifecycleCallback): void;
65
+ /** If already booted, the callback runs immediately (a rejection surfaces as an unhandled rejection). */
66
+ booted(callback: LifecycleCallback): void;
67
+ terminating(callback: () => void | Promise<void>): void;
68
+ handle(request: Request): Promise<Response>;
69
+ terminate(): Promise<void>;
70
+ private runBoot;
71
+ private bootProvider;
72
+ }
73
+
74
+ type Handler = (request: Request) => unknown;
75
+ /** Wave 0 stand-in for the Http kernel: exact "METHOD /path" matching only. Replaced by Wave 1's router. */
76
+ declare class ClosureKernel implements HttpKernel {
77
+ private readonly routes;
78
+ on(method: string, path: string, handler: Handler): this;
79
+ handle(request: Request): Promise<Response>;
80
+ }
81
+
82
+ declare class ProviderBootError extends Error {
83
+ readonly provider: string;
84
+ readonly name = "ProviderBootError";
85
+ constructor(provider: string, cause: unknown);
86
+ }
87
+ declare class ProviderRegisterError extends Error {
88
+ readonly provider: string;
89
+ readonly name = "ProviderRegisterError";
90
+ constructor(provider: string, cause: unknown);
91
+ }
92
+
93
+ export { Application, ApplicationBuilder, ClosureKernel, ProviderBootError, ProviderRegisterError, type RoutingOptions };
package/dist/index.js ADDED
@@ -0,0 +1,239 @@
1
+ // Application.ts
2
+ import { join as join2 } from "path";
3
+ import {
4
+ Application as ApplicationToken,
5
+ ClassRegistry as ClassRegistryToken,
6
+ ConfigRepository as ConfigRepository2,
7
+ HttpKernel
8
+ } from "@orieljs/contracts";
9
+ import { Container } from "@orieljs/container";
10
+ import { ClassRegistry, Str } from "@orieljs/support";
11
+
12
+ // ApplicationBuilder.ts
13
+ import { isAbsolute, join } from "path";
14
+ import {
15
+ ConfigRepository,
16
+ ExceptionCallbacks,
17
+ MiddlewareCallbacks,
18
+ RoutingPaths
19
+ } from "@orieljs/contracts";
20
+ import { loadConfiguration, loadEnvironment, Repository } from "@orieljs/config";
21
+ var ApplicationBuilder = class {
22
+ constructor(app) {
23
+ this.app = app;
24
+ }
25
+ app;
26
+ providers = [];
27
+ middleware = [];
28
+ exceptions = [];
29
+ routing;
30
+ withProviders(providers = []) {
31
+ this.providers.push(...providers);
32
+ return this;
33
+ }
34
+ withRouting(options) {
35
+ const abs = (p) => p === void 0 ? void 0 : isAbsolute(p) ? p : join(this.app.basePath(), p);
36
+ const paths = { apiPrefix: options.apiPrefix ?? "api" };
37
+ if (options.web !== void 0) paths.web = abs(options.web);
38
+ if (options.api !== void 0) paths.api = abs(options.api);
39
+ if (options.console !== void 0) paths.console = abs(options.console);
40
+ if (options.health !== void 0) paths.health = options.health;
41
+ this.routing = paths;
42
+ return this;
43
+ }
44
+ withMiddleware(callback) {
45
+ this.middleware.push(callback);
46
+ return this;
47
+ }
48
+ withExceptions(callback) {
49
+ this.exceptions.push(callback);
50
+ return this;
51
+ }
52
+ booting(callback) {
53
+ this.app.booting(callback);
54
+ return this;
55
+ }
56
+ booted(callback) {
57
+ this.app.booted(callback);
58
+ return this;
59
+ }
60
+ async create() {
61
+ loadEnvironment(this.app.basePath());
62
+ this.app.instance(ConfigRepository, new Repository(await loadConfiguration(this.app.configPath())));
63
+ if (this.routing) this.app.instance(RoutingPaths, this.routing);
64
+ this.app.instance(MiddlewareCallbacks, this.middleware);
65
+ this.app.instance(ExceptionCallbacks, this.exceptions);
66
+ for (const provider of this.providers) await this.app.register(provider);
67
+ return this.app;
68
+ }
69
+ };
70
+
71
+ // errors.ts
72
+ var ProviderBootError = class extends Error {
73
+ constructor(provider, cause) {
74
+ super(`Service provider [${provider}] failed to boot: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
75
+ this.provider = provider;
76
+ }
77
+ provider;
78
+ name = "ProviderBootError";
79
+ };
80
+ var ProviderRegisterError = class extends Error {
81
+ constructor(provider, cause) {
82
+ super(`Service provider [${provider}] failed to register: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
83
+ this.provider = provider;
84
+ }
85
+ provider;
86
+ name = "ProviderRegisterError";
87
+ };
88
+
89
+ // Application.ts
90
+ var Application = class _Application extends Container {
91
+ constructor(base) {
92
+ super();
93
+ this.base = base;
94
+ Container.setInstance(this);
95
+ this.instance(ApplicationToken, this);
96
+ this.instance(_Application, this);
97
+ this.singleton(ClassRegistryToken, ClassRegistry);
98
+ }
99
+ base;
100
+ version = "0.0.0";
101
+ providers = [];
102
+ bootingCallbacks = [];
103
+ bootedCallbacks = [];
104
+ terminatingCallbacks = [];
105
+ bootPromise;
106
+ hasBooted = false;
107
+ inConsole = false;
108
+ /** Entry point used by bootstrap/app.ts. */
109
+ static configure(options) {
110
+ return new ApplicationBuilder(new _Application(options.basePath));
111
+ }
112
+ basePath(path = "") {
113
+ return join2(this.base, path);
114
+ }
115
+ appPath(path = "") {
116
+ return this.basePath(join2("app", path));
117
+ }
118
+ bootstrapPath(path = "") {
119
+ return this.basePath(join2("bootstrap", path));
120
+ }
121
+ configPath(path = "") {
122
+ return this.basePath(join2("config", path));
123
+ }
124
+ databasePath(path = "") {
125
+ return this.basePath(join2("database", path));
126
+ }
127
+ publicPath(path = "") {
128
+ return this.basePath(join2("public", path));
129
+ }
130
+ resourcePath(path = "") {
131
+ return this.basePath(join2("resources", path));
132
+ }
133
+ storagePath(path = "") {
134
+ return this.basePath(join2("storage", path));
135
+ }
136
+ environment(...environments) {
137
+ const fallback = process.env.APP_ENV ?? "production";
138
+ const current = this.bound(ConfigRepository2) ? String(this.make(ConfigRepository2).get("app.env", fallback)) : fallback;
139
+ return environments.length === 0 ? current : environments.some((pattern) => Str.is(pattern, current));
140
+ }
141
+ isProduction() {
142
+ return this.environment("production");
143
+ }
144
+ isLocal() {
145
+ return this.environment("local");
146
+ }
147
+ runningUnitTests() {
148
+ return this.environment("testing");
149
+ }
150
+ runningInConsole() {
151
+ return this.inConsole;
152
+ }
153
+ setRunningInConsole(value = true) {
154
+ this.inConsole = value;
155
+ }
156
+ async register(provider) {
157
+ const cls = typeof provider === "function" ? provider : provider.constructor;
158
+ const existing = this.providers.find((p) => p.constructor === cls);
159
+ if (existing) return existing;
160
+ const instance = typeof provider === "function" ? new provider(this) : provider;
161
+ try {
162
+ instance.register?.();
163
+ } catch (error) {
164
+ throw new ProviderRegisterError(instance.constructor.name, error);
165
+ }
166
+ this.providers.push(instance);
167
+ if (this.hasBooted) await this.bootProvider(instance);
168
+ return instance;
169
+ }
170
+ getProviders() {
171
+ return [...this.providers];
172
+ }
173
+ boot() {
174
+ return this.bootPromise ??= this.runBoot();
175
+ }
176
+ isBooted() {
177
+ return this.hasBooted;
178
+ }
179
+ booting(callback) {
180
+ this.bootingCallbacks.push(callback);
181
+ }
182
+ /** If already booted, the callback runs immediately (a rejection surfaces as an unhandled rejection). */
183
+ booted(callback) {
184
+ this.bootedCallbacks.push(callback);
185
+ if (this.hasBooted) void callback(this);
186
+ }
187
+ terminating(callback) {
188
+ this.terminatingCallbacks.push(callback);
189
+ }
190
+ async handle(request) {
191
+ await this.boot();
192
+ const scope = this.createScope();
193
+ return scope.run(() => scope.make(HttpKernel).handle(request));
194
+ }
195
+ async terminate() {
196
+ for (const callback of this.terminatingCallbacks) await callback();
197
+ }
198
+ async runBoot() {
199
+ for (const callback of this.bootingCallbacks) await callback(this);
200
+ for (let i = 0; i < this.providers.length; i++) await this.bootProvider(this.providers[i]);
201
+ this.hasBooted = true;
202
+ for (const callback of this.bootedCallbacks) await callback(this);
203
+ }
204
+ async bootProvider(provider) {
205
+ try {
206
+ await provider.boot?.();
207
+ } catch (error) {
208
+ throw new ProviderBootError(provider.constructor.name, error);
209
+ }
210
+ }
211
+ };
212
+
213
+ // Http/ClosureKernel.ts
214
+ var ClosureKernel = class {
215
+ routes = /* @__PURE__ */ new Map();
216
+ on(method, path, handler) {
217
+ this.routes.set(`${method.toUpperCase()} ${path}`, handler);
218
+ return this;
219
+ }
220
+ async handle(request) {
221
+ const handler = this.routes.get(`${request.method} ${new URL(request.url).pathname}`);
222
+ if (!handler) return new Response("Not Found", { status: 404, headers: { "content-type": "text/plain; charset=utf-8" } });
223
+ return toResponse(await handler(request));
224
+ }
225
+ };
226
+ function toResponse(output) {
227
+ if (output instanceof Response) return output;
228
+ if (output === void 0 || output === null) return new Response(null, { status: 204 });
229
+ if (typeof output === "string") return new Response(output, { headers: { "content-type": "text/html; charset=utf-8" } });
230
+ return Response.json(output);
231
+ }
232
+ export {
233
+ Application,
234
+ ApplicationBuilder,
235
+ ClosureKernel,
236
+ ProviderBootError,
237
+ ProviderRegisterError
238
+ };
239
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../Application.ts","../ApplicationBuilder.ts","../errors.ts","../Http/ClosureKernel.ts"],"sourcesContent":["import { join } from 'node:path'\nimport {\n Application as ApplicationToken,\n ClassRegistry as ClassRegistryToken,\n ConfigRepository,\n HttpKernel,\n type Application as ApplicationContract,\n type ServiceProvider,\n type ServiceProviderClass,\n} from '@orieljs/contracts'\nimport { Container } from '@orieljs/container'\nimport { ClassRegistry, Str } from '@orieljs/support'\nimport { ApplicationBuilder } from './ApplicationBuilder'\nimport { ProviderBootError, ProviderRegisterError } from './errors'\n\ntype LifecycleCallback = (app: ApplicationContract) => void | Promise<void>\n\nexport class Application extends Container implements ApplicationContract {\n readonly version = '0.0.0'\n\n private readonly providers: ServiceProvider[] = []\n private readonly bootingCallbacks: LifecycleCallback[] = []\n private readonly bootedCallbacks: LifecycleCallback[] = []\n private readonly terminatingCallbacks: Array<() => void | Promise<void>> = []\n private bootPromise: Promise<void> | undefined\n private hasBooted = false\n private inConsole = false\n\n constructor(private readonly base: string) {\n super()\n Container.setInstance(this)\n this.instance(ApplicationToken, this)\n // The class too: otherwise inject(Application) would build a second app and hijack the global instance.\n this.instance(Application, this)\n this.singleton(ClassRegistryToken, ClassRegistry)\n }\n\n /** Entry point used by bootstrap/app.ts. */\n static configure(options: { basePath: string }): ApplicationBuilder {\n return new ApplicationBuilder(new Application(options.basePath))\n }\n\n basePath(path = ''): string { return join(this.base, path) }\n appPath(path = ''): string { return this.basePath(join('app', path)) }\n bootstrapPath(path = ''): string { return this.basePath(join('bootstrap', path)) }\n configPath(path = ''): string { return this.basePath(join('config', path)) }\n databasePath(path = ''): string { return this.basePath(join('database', path)) }\n publicPath(path = ''): string { return this.basePath(join('public', path)) }\n resourcePath(path = ''): string { return this.basePath(join('resources', path)) }\n storagePath(path = ''): string { return this.basePath(join('storage', path)) }\n\n environment(): string\n environment(...environments: string[]): boolean\n environment(...environments: string[]): string | boolean {\n const fallback = process.env.APP_ENV ?? 'production'\n const current = this.bound(ConfigRepository)\n ? String(this.make(ConfigRepository).get('app.env', fallback))\n : fallback\n return environments.length === 0 ? current : environments.some((pattern) => Str.is(pattern, current))\n }\n\n isProduction(): boolean { return this.environment('production') }\n isLocal(): boolean { return this.environment('local') }\n runningUnitTests(): boolean { return this.environment('testing') }\n runningInConsole(): boolean { return this.inConsole }\n setRunningInConsole(value = true): void { this.inConsole = value }\n\n async register(provider: ServiceProvider | ServiceProviderClass): Promise<ServiceProvider> {\n const cls = typeof provider === 'function' ? provider : provider.constructor\n const existing = this.providers.find((p) => p.constructor === cls)\n if (existing) return existing\n\n const instance = typeof provider === 'function' ? new provider(this) : provider\n try {\n instance.register?.()\n } catch (error) {\n throw new ProviderRegisterError(instance.constructor.name, error)\n }\n this.providers.push(instance)\n if (this.hasBooted) await this.bootProvider(instance)\n return instance\n }\n\n getProviders(): ServiceProvider[] {\n return [...this.providers]\n }\n\n boot(): Promise<void> {\n return (this.bootPromise ??= this.runBoot())\n }\n\n isBooted(): boolean {\n return this.hasBooted\n }\n\n booting(callback: LifecycleCallback): void {\n this.bootingCallbacks.push(callback)\n }\n\n /** If already booted, the callback runs immediately (a rejection surfaces as an unhandled rejection). */\n booted(callback: LifecycleCallback): void {\n this.bootedCallbacks.push(callback)\n if (this.hasBooted) void callback(this)\n }\n\n terminating(callback: () => void | Promise<void>): void {\n this.terminatingCallbacks.push(callback)\n }\n\n async handle(request: Request): Promise<Response> {\n await this.boot()\n const scope = this.createScope()\n return scope.run(() => scope.make(HttpKernel).handle(request))\n }\n\n async terminate(): Promise<void> {\n for (const callback of this.terminatingCallbacks) await callback()\n }\n\n private async runBoot(): Promise<void> {\n for (const callback of this.bootingCallbacks) await callback(this)\n // Index loop on purpose: providers registered during boot are appended and booted in this pass.\n for (let i = 0; i < this.providers.length; i++) await this.bootProvider(this.providers[i]!)\n this.hasBooted = true\n for (const callback of this.bootedCallbacks) await callback(this)\n }\n\n private async bootProvider(provider: ServiceProvider): Promise<void> {\n try {\n await provider.boot?.()\n } catch (error) {\n throw new ProviderBootError(provider.constructor.name, error)\n }\n }\n}\n","import { isAbsolute, join } from 'node:path'\nimport {\n ConfigRepository,\n ExceptionCallbacks,\n MiddlewareCallbacks,\n RoutingPaths,\n type Application as ApplicationContract,\n type ExceptionsConfigurator,\n type MiddlewareConfigurator,\n type ServiceProvider,\n type ServiceProviderClass,\n} from '@orieljs/contracts'\nimport { loadConfiguration, loadEnvironment, Repository } from '@orieljs/config'\nimport type { Application } from './Application'\n\nexport interface RoutingOptions {\n web?: string\n api?: string\n console?: string\n /** A URI such as '/up', not a file. */\n health?: string\n apiPrefix?: string\n}\n\ntype Lifecycle = (app: ApplicationContract) => void | Promise<void>\n\nexport class ApplicationBuilder {\n private readonly providers: Array<ServiceProvider | ServiceProviderClass> = []\n private readonly middleware: Array<(middleware: MiddlewareConfigurator) => void> = []\n private readonly exceptions: Array<(exceptions: ExceptionsConfigurator) => void> = []\n private routing: RoutingPaths | undefined\n\n constructor(private readonly app: Application) {}\n\n withProviders(providers: Array<ServiceProvider | ServiceProviderClass> = []): this {\n this.providers.push(...providers)\n return this\n }\n\n withRouting(options: RoutingOptions): this {\n const abs = (p?: string) => (p === undefined ? undefined : isAbsolute(p) ? p : join(this.app.basePath(), p))\n const paths: RoutingPaths = { apiPrefix: options.apiPrefix ?? 'api' }\n if (options.web !== undefined) paths.web = abs(options.web)\n if (options.api !== undefined) paths.api = abs(options.api)\n if (options.console !== undefined) paths.console = abs(options.console)\n if (options.health !== undefined) paths.health = options.health\n this.routing = paths\n return this\n }\n\n withMiddleware(callback: (middleware: MiddlewareConfigurator) => void): this {\n this.middleware.push(callback)\n return this\n }\n\n withExceptions(callback: (exceptions: ExceptionsConfigurator) => void): this {\n this.exceptions.push(callback)\n return this\n }\n\n booting(callback: Lifecycle): this {\n this.app.booting(callback)\n return this\n }\n\n booted(callback: Lifecycle): this {\n this.app.booted(callback)\n return this\n }\n\n async create(): Promise<Application> {\n loadEnvironment(this.app.basePath())\n this.app.instance(ConfigRepository, new Repository(await loadConfiguration(this.app.configPath())))\n if (this.routing) this.app.instance(RoutingPaths, this.routing)\n this.app.instance(MiddlewareCallbacks, this.middleware as Array<(configurator: unknown) => void>)\n this.app.instance(ExceptionCallbacks, this.exceptions)\n for (const provider of this.providers) await this.app.register(provider)\n return this.app\n }\n}\n","export class ProviderBootError extends Error {\n override readonly name = 'ProviderBootError'\n constructor(readonly provider: string, cause: unknown) {\n super(`Service provider [${provider}] failed to boot: ${cause instanceof Error ? cause.message : String(cause)}`, { cause })\n }\n}\n\nexport class ProviderRegisterError extends Error {\n override readonly name = 'ProviderRegisterError'\n constructor(readonly provider: string, cause: unknown) {\n super(`Service provider [${provider}] failed to register: ${cause instanceof Error ? cause.message : String(cause)}`, { cause })\n }\n}\n","import type { HttpKernel } from '@orieljs/contracts'\n\ntype Handler = (request: Request) => unknown\n\n/** Wave 0 stand-in for the Http kernel: exact \"METHOD /path\" matching only. Replaced by Wave 1's router. */\nexport class ClosureKernel implements HttpKernel {\n private readonly routes = new Map<string, Handler>()\n\n on(method: string, path: string, handler: Handler): this {\n this.routes.set(`${method.toUpperCase()} ${path}`, handler)\n return this\n }\n\n async handle(request: Request): Promise<Response> {\n const handler = this.routes.get(`${request.method} ${new URL(request.url).pathname}`)\n if (!handler) return new Response('Not Found', { status: 404, headers: { 'content-type': 'text/plain; charset=utf-8' } })\n return toResponse(await handler(request))\n }\n}\n\nfunction toResponse(output: unknown): Response {\n if (output instanceof Response) return output\n if (output === undefined || output === null) return new Response(null, { status: 204 })\n if (typeof output === 'string') return new Response(output, { headers: { 'content-type': 'text/html; charset=utf-8' } })\n return Response.json(output)\n}\n"],"mappings":";AAAA,SAAS,QAAAA,aAAY;AACrB;AAAA,EACE,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,oBAAAC;AAAA,EACA;AAAA,OAIK;AACP,SAAS,iBAAiB;AAC1B,SAAS,eAAe,WAAW;;;ACXnC,SAAS,YAAY,YAAY;AACjC;AAAA,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AAE,CAAC;AACvH,SAAO,SAAS,KAAK,MAAM;AAC7B;","names":["join","ConfigRepository","join","ConfigRepository"]}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@orieljs/foundation",
3
+ "version": "0.1.0-alpha.0",
4
+ "description": "The Oriel application: service providers, lifecycle and request handling.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/orieljs/framework.git",
11
+ "directory": "src/Oriel/Foundation"
12
+ },
13
+ "engines": {
14
+ "node": ">=22"
15
+ },
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "dependencies": {
30
+ "@orieljs/config": "0.1.0-alpha.0",
31
+ "@orieljs/container": "0.1.0-alpha.0",
32
+ "@orieljs/contracts": "0.1.0-alpha.0",
33
+ "@orieljs/support": "0.1.0-alpha.0"
34
+ },
35
+ "scripts": {
36
+ "build": "tsup"
37
+ }
38
+ }