@orieljs/foundation 0.1.0-alpha.10 → 0.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ServiceProvider, ServiceProviderClass, MiddlewareConfigurator, ExceptionsConfigurator, Application as Application$1, HttpKernel, Htmlable, OrielError } from '@orieljs/contracts';
1
+ import { ServiceProvider, ServiceProviderClass, MiddlewareConfigurator, ExceptionsConfigurator, Application as Application$1, ClassNames, HttpKernel, Middleware, HttpRequest, Next, Htmlable, OrielError } from '@orieljs/contracts';
2
2
  import { Container } from '@orieljs/container';
3
3
 
4
4
  interface RoutingOptions {
@@ -30,7 +30,7 @@ declare class ApplicationBuilder {
30
30
  type LifecycleCallback = (app: Application$1) => void | Promise<void>;
31
31
  declare class Application extends Container implements Application$1 {
32
32
  private readonly base;
33
- readonly version = "0.1.0-alpha.10";
33
+ readonly version = "0.1.0-alpha.11";
34
34
  private readonly providers;
35
35
  private readonly bootingCallbacks;
36
36
  private readonly bootedCallbacks;
@@ -88,6 +88,21 @@ declare class Application extends Container implements Application$1 {
88
88
  private bootProvider;
89
89
  }
90
90
 
91
+ /**
92
+ * The class names of a scrambled production build, read from `bootstrap/cache/classes.json`. The file is read again when
93
+ * a new build replaces it, and ignored while `public/hot` exists (the Vite dev server's CSS keeps the names as written)
94
+ * and while the app runs its tests, which check the HTML its views write.
95
+ */
96
+ declare class ClassNameMap implements ClassNames {
97
+ #private;
98
+ private readonly app;
99
+ constructor(app: Application$1);
100
+ /** The map, or undefined: no scrambled build, the dev server is running, or the app is running its tests. */
101
+ classes(): Record<string, string> | undefined;
102
+ get active(): boolean;
103
+ html(html: string): string;
104
+ }
105
+
91
106
  type Handler = (request: Request) => unknown;
92
107
  /** Wave 0 stand-in for the Http kernel: exact "METHOD /path" matching only. Replaced by Wave 1's router. */
93
108
  declare class ClosureKernel implements HttpKernel {
@@ -96,6 +111,16 @@ declare class ClosureKernel implements HttpKernel {
96
111
  handle(request: Request): Promise<Response>;
97
112
  }
98
113
 
114
+ /**
115
+ * Renames the classes in the HTML pages the app sends, as a scrambled production build renamed them in its CSS
116
+ * (`ClassNames`). JSON, files and every other response are left alone, and so is every page when there's no
117
+ * scrambled build. A streamed page is renamed chunk by chunk, each chunk cut after its last whole tag.
118
+ */
119
+ declare class RenameClasses implements Middleware {
120
+ #private;
121
+ handle(request: HttpRequest, next: Next): Promise<Response>;
122
+ }
123
+
99
124
  declare class ProviderBootError extends Error {
100
125
  readonly provider: string;
101
126
  readonly name = "ProviderBootError";
@@ -189,4 +214,4 @@ declare function vite(entryPoints: string | string[], buildDirectory?: string):
189
214
  /** Laravel's @viteReactRefresh: put it before vite([...]) in the root view of a React app. */
190
215
  declare function viteReactRefresh(): ViteHtml | undefined;
191
216
 
192
- export { Application, ApplicationBuilder, type AttributesResolver, ClosureKernel, type Manifest, type ManifestChunk, type PreloadAttributesResolver, ProviderBootError, ProviderRegisterError, type RoutingOptions, type TagAttributes, Vite, ViteError, ViteHtml, currentVite, vite, viteReactRefresh };
217
+ export { Application, ApplicationBuilder, type AttributesResolver, ClassNameMap, ClosureKernel, type Manifest, type ManifestChunk, type PreloadAttributesResolver, ProviderBootError, ProviderRegisterError, RenameClasses, type RoutingOptions, type TagAttributes, Vite, ViteError, ViteHtml, currentVite, vite, viteReactRefresh };
package/dist/index.js CHANGED
@@ -2,11 +2,12 @@
2
2
  import { join as join3 } from "path";
3
3
  import {
4
4
  Application as ApplicationToken2,
5
+ ClassNames as ClassNames2,
5
6
  ClassRegistry as ClassRegistryToken,
6
7
  ConfigRepository as ConfigRepository3,
7
8
  HttpKernel
8
9
  } from "@orieljs/contracts";
9
- import { Container } from "@orieljs/container";
10
+ import { Container as Container2 } from "@orieljs/container";
10
11
  import { ClassRegistry, Str } from "@orieljs/support";
11
12
 
12
13
  // ApplicationBuilder.ts
@@ -18,6 +19,53 @@ import {
18
19
  RoutingPaths
19
20
  } from "@orieljs/contracts";
20
21
  import { loadConfiguration, loadEnvironment, Repository } from "@orieljs/config";
22
+
23
+ // Http/RenameClasses.ts
24
+ import { ClassNames, Container } from "@orieljs/contracts";
25
+ import { inject } from "@orieljs/container";
26
+ var RAW_TEXT = /<(script|style|textarea|title|xmp|noembed|noframes)\b[^>]*>(?![\s\S]*<\/\1)/i;
27
+ var RenameClasses = class {
28
+ #container = inject(Container);
29
+ async handle(request, next) {
30
+ const response = await next(request);
31
+ if (response.body === null || !/^text\/html\b/i.test(response.headers.get("content-type") ?? "") || response.headers.has("content-encoding")) return response;
32
+ if (!this.#container.bound(ClassNames)) return response;
33
+ const classNames = this.#container.make(ClassNames);
34
+ if (!classNames.active) return response;
35
+ const headers = new Headers(response.headers);
36
+ headers.delete("content-length");
37
+ return new Response(response.body.pipeThrough(renamer((html) => classNames.html(html))), { status: response.status, statusText: response.statusText, headers });
38
+ }
39
+ };
40
+ function renamer(rename) {
41
+ const decoder = new TextDecoder();
42
+ const encoder = new TextEncoder();
43
+ let carry = "";
44
+ return new TransformStream({
45
+ transform(chunk, controller) {
46
+ const text = carry + decoder.decode(chunk, { stream: true });
47
+ const cut = safeCut(text);
48
+ carry = text.slice(cut);
49
+ if (cut > 0) controller.enqueue(encoder.encode(rename(text.slice(0, cut))));
50
+ },
51
+ flush(controller) {
52
+ const text = carry + decoder.decode();
53
+ if (text !== "") controller.enqueue(encoder.encode(rename(text)));
54
+ }
55
+ });
56
+ }
57
+ function safeCut(text) {
58
+ let cut = text.lastIndexOf(">") + 1;
59
+ if (cut === 0) return 0;
60
+ const head = text.slice(0, cut);
61
+ const comment = head.lastIndexOf("<!--");
62
+ if (comment !== -1 && head.indexOf("-->", comment + 4) === -1) cut = comment;
63
+ const raw = RAW_TEXT.exec(text.slice(0, cut));
64
+ if (raw !== null) cut = raw.index;
65
+ return cut;
66
+ }
67
+
68
+ // ApplicationBuilder.ts
21
69
  var ApplicationBuilder = class {
22
70
  constructor(app) {
23
71
  this.app = app;
@@ -62,13 +110,53 @@ var ApplicationBuilder = class {
62
110
  loadEnvironment(this.app.basePath());
63
111
  this.app.instance(ConfigRepository, new Repository(await loadConfiguration(this.app.configPath())));
64
112
  if (this.routing) this.app.instance(RoutingPaths, this.routing);
65
- this.app.instance(MiddlewareCallbacks, this.middleware);
113
+ const middleware = [(m) => void m.prepend(RenameClasses), ...this.middleware];
114
+ this.app.instance(MiddlewareCallbacks, middleware);
66
115
  this.app.instance(ExceptionCallbacks, this.exceptions);
67
116
  for (const provider of this.providers) await this.app.register(provider);
68
117
  return this.app;
69
118
  }
70
119
  };
71
120
 
121
+ // ClassNames.ts
122
+ import { existsSync, readFileSync, statSync } from "fs";
123
+ import { rewriteHtml } from "@orieljs/obfuscate";
124
+ var ClassNameMap = class {
125
+ constructor(app) {
126
+ this.app = app;
127
+ }
128
+ app;
129
+ #loaded;
130
+ /** The map, or undefined: no scrambled build, the dev server is running, or the app is running its tests. */
131
+ classes() {
132
+ if (this.#testing() || existsSync(this.app.publicPath("hot"))) return void 0;
133
+ const file = this.app.bootstrapPath("cache/classes.json");
134
+ let modified;
135
+ try {
136
+ modified = statSync(file).mtimeMs;
137
+ } catch {
138
+ this.#loaded = void 0;
139
+ return void 0;
140
+ }
141
+ if (this.#loaded?.modified !== modified) {
142
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
143
+ this.#loaded = { modified, classes: parsed.classes ?? {} };
144
+ }
145
+ return Object.keys(this.#loaded.classes).length === 0 ? void 0 : this.#loaded.classes;
146
+ }
147
+ /** The app runs its tests: Oriel's TestCase sets APP_ENV=testing, which a test that switches app.env leaves set. */
148
+ #testing() {
149
+ return this.app.runningUnitTests() || process.env.APP_ENV === "testing";
150
+ }
151
+ get active() {
152
+ return this.classes() !== void 0;
153
+ }
154
+ html(html) {
155
+ const classes = this.classes();
156
+ return classes === void 0 ? html : rewriteHtml(html, classes);
157
+ }
158
+ };
159
+
72
160
  // errors.ts
73
161
  var ProviderBootError = class extends Error {
74
162
  constructor(provider, cause) {
@@ -88,7 +176,7 @@ var ProviderRegisterError = class extends Error {
88
176
  };
89
177
 
90
178
  // Vite.ts
91
- import { existsSync, readFileSync, statSync } from "fs";
179
+ import { existsSync as existsSync2, readFileSync as readFileSync2, statSync as statSync2 } from "fs";
92
180
  import { createHash, randomBytes } from "crypto";
93
181
  import { join as join2 } from "path";
94
182
  import { Application as ApplicationToken, ConfigRepository as ConfigRepository2, HttpRequest, UrlGenerator } from "@orieljs/contracts";
@@ -183,11 +271,11 @@ var Vite = class {
183
271
  return this.#hotFile ?? this.app.publicPath("hot");
184
272
  }
185
273
  isRunningHot() {
186
- return existsSync(this.hotFile());
274
+ return existsSync2(this.hotFile());
187
275
  }
188
276
  /** The dev server URL written by @orieljs/vite, or undefined when it isn't running. */
189
277
  devServerUrl() {
190
- return this.isRunningHot() ? readFileSync(this.hotFile(), "utf8").trimEnd() : void 0;
278
+ return this.isRunningHot() ? readFileSync2(this.hotFile(), "utf8").trimEnd() : void 0;
191
279
  }
192
280
  // Tags -----------------------------------------------------------------------------------------------------
193
281
  /** Laravel's @vite([...]): preloads (styles first), then stylesheets, then scripts. */
@@ -256,25 +344,25 @@ var Vite = class {
256
344
  content(path, buildDirectory = this.#buildDirectory) {
257
345
  const chunk = this.#chunk(this.manifest(buildDirectory), path);
258
346
  const file = this.app.publicPath(join2(buildDirectory, chunk.file));
259
- if (!existsSync(file)) throw new ViteError(`Unable to locate file from Vite manifest: ${file}.`);
260
- return readFileSync(file, "utf8");
347
+ if (!existsSync2(file)) throw new ViteError(`Unable to locate file from Vite manifest: ${file}.`);
348
+ return readFileSync2(file, "utf8");
261
349
  }
262
350
  /** md5 of the manifest (a cache-busting asset version); undefined while hot or without a build. */
263
351
  manifestHash(buildDirectory = this.#buildDirectory) {
264
352
  if (this.isRunningHot()) return void 0;
265
353
  const path = this.manifestPath(buildDirectory);
266
- return existsSync(path) ? createHash("md5").update(readFileSync(path)).digest("hex") : void 0;
354
+ return existsSync2(path) ? createHash("md5").update(readFileSync2(path)).digest("hex") : void 0;
267
355
  }
268
356
  manifestPath(buildDirectory = this.#buildDirectory) {
269
357
  return this.app.publicPath(join2(buildDirectory, this.#manifestFilename));
270
358
  }
271
359
  manifest(buildDirectory = this.#buildDirectory) {
272
360
  const path = this.manifestPath(buildDirectory);
273
- if (!existsSync(path)) throw new ViteError(`Vite manifest not found at: ${path}`);
274
- const { mtimeMs } = statSync(path);
361
+ if (!existsSync2(path)) throw new ViteError(`Vite manifest not found at: ${path}`);
362
+ const { mtimeMs } = statSync2(path);
275
363
  const cached = manifests.get(path);
276
364
  if (cached !== void 0 && cached.mtimeMs === mtimeMs) return cached.manifest;
277
- const manifest = JSON.parse(readFileSync(path, "utf8"));
365
+ const manifest = JSON.parse(readFileSync2(path, "utf8"));
278
366
  manifests.set(path, { mtimeMs, manifest });
279
367
  return manifest;
280
368
  }
@@ -371,18 +459,19 @@ function viteReactRefresh() {
371
459
 
372
460
  // Application.ts
373
461
  var SHUTDOWN_TIMEOUT_MS = 1e4;
374
- var Application = class _Application extends Container {
462
+ var Application = class _Application extends Container2 {
375
463
  constructor(base) {
376
464
  super();
377
465
  this.base = base;
378
- Container.setInstance(this);
466
+ Container2.setInstance(this);
379
467
  this.instance(ApplicationToken2, this);
380
468
  this.instance(_Application, this);
381
469
  this.singleton(ClassRegistryToken, ClassRegistry);
382
470
  this.scoped(Vite, () => new Vite(this));
471
+ this.singleton(ClassNames2, () => new ClassNameMap(this));
383
472
  }
384
473
  base;
385
- version = "0.1.0-alpha.10";
474
+ version = "0.1.0-alpha.11";
386
475
  providers = [];
387
476
  bootingCallbacks = [];
388
477
  bootedCallbacks = [];
@@ -557,9 +646,11 @@ function toResponse(output) {
557
646
  export {
558
647
  Application,
559
648
  ApplicationBuilder,
649
+ ClassNameMap,
560
650
  ClosureKernel,
561
651
  ProviderBootError,
562
652
  ProviderRegisterError,
653
+ RenameClasses,
563
654
  Vite,
564
655
  ViteError,
565
656
  ViteHtml,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../Application.ts","../ApplicationBuilder.ts","../errors.ts","../Vite.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'\nimport { Vite } from './Vite'\n\ntype LifecycleCallback = (app: ApplicationContract) => void | Promise<void>\n\n/** How long shutdown() waits for its callbacks before giving up, so a hung close never keeps the process alive. */\nconst SHUTDOWN_TIMEOUT_MS = 10_000\n\nexport class Application extends Container implements ApplicationContract {\n readonly version = '0.1.0-alpha.10'\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 readonly shutdownCallbacks: Array<() => void | Promise<void>> = []\n private shutdownPromise: Promise<void> | undefined\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 // One per request: a CSP nonce set with vite().useCspNonce() must not leak into other requests.\n this.scoped(Vite, () => new Vite(this))\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 /**\n * A callback for the end of the process (the CLI after its command, the server on SIGTERM): close DB pools, Redis\n * clients and log files. Not in Laravel, whose PHP processes end with each request.\n */\n onShutdown(callback: () => void | Promise<void>): void {\n this.shutdownCallbacks.push(callback)\n }\n\n /**\n * Runs the shutdown callbacks once (a second call returns the same promise), newest first: an app's own callbacks\n * run before the framework closes what they use, then the framework's in the reverse of its providers' order (the\n * queue, database and cache connections close, then the log is written, then the session store closes). A failing\n * callback is printed with console.error (the log may be closed already) and the others still run; after 10 seconds\n * the rest are given up on, so the process can still exit. Never rejects.\n */\n shutdown(): Promise<void> {\n return (this.shutdownPromise ??= this.runShutdown())\n }\n\n private async runShutdown(): Promise<void> {\n if (this.shutdownCallbacks.length === 0) return\n const callbacks = [...this.shutdownCallbacks].reverse()\n const run = (async () => {\n for (const callback of callbacks) {\n try {\n await callback()\n } catch (error) {\n console.error(error)\n }\n }\n return 'done' as const\n })()\n let timer: ReturnType<typeof setTimeout> | undefined\n // Not unref'd: if a callback hangs on a promise and nothing else is left, the process must still reach its exit.\n const deadline = new Promise<'timeout'>((resolve) => (timer = setTimeout(() => resolve('timeout'), SHUTDOWN_TIMEOUT_MS)))\n const outcome = await Promise.race([run, deadline])\n clearTimeout(timer)\n if (outcome === 'timeout') {\n console.error(`The shutdown callbacks did not finish within ${SHUTDOWN_TIMEOUT_MS / 1000} seconds; carrying on with the exit.`)\n }\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 /** One route file or several, loaded in order: web: ['routes/web.ts', 'routes/settings.ts', 'routes/auth.ts']. */\n web?: string | string[]\n api?: string | 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) => (isAbsolute(p) ? p : join(this.app.basePath(), p))\n const each = (p: string | string[]) => (Array.isArray(p) ? p.map(abs) : abs(p))\n const paths: RoutingPaths = { apiPrefix: options.apiPrefix ?? 'api' }\n if (options.web !== undefined) paths.web = each(options.web)\n if (options.api !== undefined) paths.api = each(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 { existsSync, readFileSync, statSync } from 'node:fs'\nimport { createHash, randomBytes } from 'node:crypto'\nimport { join } from 'node:path'\nimport { Application as ApplicationToken, ConfigRepository, HttpRequest, UrlGenerator, type Application, type Htmlable, type OrielError } from '@orieljs/contracts'\nimport { ContainerNotAvailableError, currentContainer } from '@orieljs/container'\n\n/** One entry of Vite's build manifest (vite's ManifestChunk). */\nexport interface ManifestChunk {\n file: string\n src?: string\n name?: string\n isEntry?: boolean\n isDynamicEntry?: boolean\n imports?: string[]\n dynamicImports?: string[]\n css?: string[]\n assets?: string[]\n [key: string]: unknown\n}\nexport type Manifest = Record<string, ManifestChunk>\n\nexport type TagAttributes = Record<string, string | boolean | null | undefined>\nexport type AttributesResolver = (src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined) => TagAttributes\nexport type PreloadAttributesResolver = (src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined) => TagAttributes | false\n\n/** A missing manifest or chunk (Laravel's ViteException / ViteManifestNotFoundException). */\nexport class ViteError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n\n constructor(message: string) {\n super(message)\n this.name = 'ViteError'\n }\n}\n\n/** Markup the view renderer emits unescaped (Htmlable; Foundation can't import View's HtmlString). */\nexport class ViteHtml implements Htmlable {\n constructor(private readonly html: string) {}\n\n toHtml(): string {\n return this.html\n }\n\n toString(): string {\n return this.html\n }\n}\n\n/**\n * Marks the tags as tracked assets: when o:navigate reaches a page whose tracked URLs changed (a new build), it loads\n * the page in full rather than run the new bundle beside the old one. A tag attribute of `false` takes it off.\n */\nconst TRACKED: TagAttributes = { 'data-navigate-track': true }\nconst CSS_PATH = /\\.(css|less|sass|scss|styl|stylus|pcss|postcss)(\\?[^.]*)?$/\n\n/** Parsed manifests by path, reloaded when the file changes (a long-running server outlives a `vite build`). */\nconst manifests = new Map<string, { mtimeMs: number; manifest: Manifest }>()\n\nconst escapeAttribute = (value: string): string => value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;')\n\n/**\n * Laravel's Illuminate\\Foundation\\Vite: the script, style and preload tags for Vite entry points. While the dev\n * server runs (public/hot holds its URL) it points at the dev server; otherwise it reads public/build/manifest.json.\n */\nexport class Vite {\n #hotFile: string | undefined\n #buildDirectory = 'build'\n #manifestFilename = 'manifest.json'\n #nonce: string | undefined\n #integrityKey: string | false = 'integrity'\n #entryPoints: string[] = []\n readonly #scriptResolvers: AttributesResolver[] = []\n readonly #styleResolvers: AttributesResolver[] = []\n readonly #preloadResolvers: PreloadAttributesResolver[] = []\n #assetPathResolver: ((path: string) => string) | undefined\n readonly #preloaded: Record<string, string[]> = {}\n\n constructor(protected readonly app: Application) {}\n\n // Configuration --------------------------------------------------------------------------------------------\n\n useCspNonce(nonce?: string): string {\n this.#nonce = nonce ?? randomBytes(30).toString('base64url').slice(0, 40)\n return this.#nonce\n }\n\n cspNonce(): string | undefined {\n return this.#nonce\n }\n\n useIntegrityKey(key: string | false): this {\n this.#integrityKey = key\n return this\n }\n\n withEntryPoints(entryPoints: string[]): this {\n this.#entryPoints = entryPoints\n return this\n }\n\n useHotFile(path: string): this {\n this.#hotFile = path\n return this\n }\n\n useBuildDirectory(path: string): this {\n this.#buildDirectory = path\n return this\n }\n\n useManifestFilename(filename: string): this {\n this.#manifestFilename = filename\n return this\n }\n\n useScriptTagAttributes(attributes: TagAttributes | AttributesResolver): this {\n this.#scriptResolvers.push(typeof attributes === 'function' ? attributes : () => attributes)\n return this\n }\n\n useStyleTagAttributes(attributes: TagAttributes | AttributesResolver): this {\n this.#styleResolvers.push(typeof attributes === 'function' ? attributes : () => attributes)\n return this\n }\n\n /** Extra preload attributes; a resolver returning false drops that preload. */\n usePreloadTagAttributes(attributes: TagAttributes | PreloadAttributesResolver | false): this {\n this.#preloadResolvers.push(typeof attributes === 'function' ? attributes : () => attributes)\n return this\n }\n\n createAssetPathsUsing(resolver: (path: string) => string): this {\n this.#assetPathResolver = resolver\n return this\n }\n\n // Dev server -----------------------------------------------------------------------------------------------\n\n hotFile(): string {\n return this.#hotFile ?? this.app.publicPath('hot')\n }\n\n isRunningHot(): boolean {\n return existsSync(this.hotFile())\n }\n\n /** The dev server URL written by @orieljs/vite, or undefined when it isn't running. */\n devServerUrl(): string | undefined {\n return this.isRunningHot() ? readFileSync(this.hotFile(), 'utf8').trimEnd() : undefined\n }\n\n // Tags -----------------------------------------------------------------------------------------------------\n\n /** Laravel's @vite([...]): preloads (styles first), then stylesheets, then scripts. */\n tags(entryPoints: string | string[], buildDirectory = this.#buildDirectory): ViteHtml {\n const entries = [entryPoints].flat()\n if (this.isRunningHot()) {\n return new ViteHtml(['@vite/client', ...entries].map((entry) => this.#tagForChunk(entry, this.#hotAsset(entry), undefined, undefined)).join(''))\n }\n const manifest = this.manifest(buildDirectory)\n const tags: string[] = []\n const preloads: Array<[string, string, ManifestChunk | undefined]> = []\n const cssChunk = (css: string): [string, ManifestChunk | undefined] => {\n const found = Object.entries(manifest).find(([, chunk]) => chunk.file === css)\n return found === undefined ? [css, undefined] : [found[0], found[1]]\n }\n for (const entry of entries) {\n const chunk = this.#chunk(manifest, entry)\n preloads.push([chunk.src ?? entry, this.#assetPath(`${buildDirectory}/${chunk.file}`), chunk])\n for (const name of this.#resolveImports(manifest, chunk)) {\n const imported = manifest[name]!\n preloads.push([name, this.#assetPath(`${buildDirectory}/${imported.file}`), imported])\n for (const css of imported.css ?? []) {\n const [key, partial] = cssChunk(css)\n preloads.push([key, this.#assetPath(`${buildDirectory}/${css}`), partial])\n tags.push(this.#tagForChunk(key, this.#assetPath(`${buildDirectory}/${css}`), partial, manifest))\n }\n }\n tags.push(this.#tagForChunk(entry, this.#assetPath(`${buildDirectory}/${chunk.file}`), chunk, manifest))\n for (const css of chunk.css ?? []) {\n const [key, partial] = cssChunk(css)\n preloads.push([key, this.#assetPath(`${buildDirectory}/${css}`), partial])\n tags.push(this.#tagForChunk(key, this.#assetPath(`${buildDirectory}/${css}`), partial, manifest))\n }\n }\n const uniqueTags = [...new Set(tags)]\n const stylesheets = uniqueTags.filter((tag) => tag.startsWith('<link'))\n const scripts = uniqueTags.filter((tag) => !tag.startsWith('<link'))\n const seen = new Set<string>()\n const uniquePreloads = preloads.filter(([, url]) => (seen.has(url) ? false : (seen.add(url), true)))\n const sorted = [...uniquePreloads.filter(([, url]) => CSS_PATH.test(url)), ...uniquePreloads.filter(([, url]) => !CSS_PATH.test(url))]\n const preloadTags = sorted.map(([src, url, chunk]) => this.#preloadTag(src, url, chunk, manifest))\n return new ViteHtml(preloadTags.join('') + stylesheets.join('') + scripts.join(''))\n }\n\n /** Laravel's @viteReactRefresh: the React Refresh preamble while the dev server runs; nothing otherwise. */\n reactRefresh(): ViteHtml | undefined {\n if (!this.isRunningHot()) return undefined\n const attributes = this.#parseAttributes({ nonce: this.#nonce ?? false })\n return new ViteHtml(\n [\n `<script type=\"module\" ${attributes.join(' ')}>`,\n ` import RefreshRuntime from '${this.#hotAsset('@react-refresh')}'`,\n ' RefreshRuntime.injectIntoGlobalHook(window)',\n ' window.$RefreshReg$ = () => {}',\n ' window.$RefreshSig$ = () => (type) => type',\n ' window.__vite_plugin_react_preamble_installed__ = true',\n '</script>',\n ].join('\\n'),\n )\n }\n\n /** The URL of a processed asset (Vite::asset('resources/images/logo.svg')). */\n asset(path: string, buildDirectory = this.#buildDirectory): string {\n if (this.isRunningHot()) return this.#hotAsset(path)\n return this.#assetPath(`${buildDirectory}/${this.#chunk(this.manifest(buildDirectory), path).file}`)\n }\n\n /** The built file's contents (Vite::content()). */\n content(path: string, buildDirectory = this.#buildDirectory): string {\n const chunk = this.#chunk(this.manifest(buildDirectory), path)\n const file = this.app.publicPath(join(buildDirectory, chunk.file))\n if (!existsSync(file)) throw new ViteError(`Unable to locate file from Vite manifest: ${file}.`)\n return readFileSync(file, 'utf8')\n }\n\n /** md5 of the manifest (a cache-busting asset version); undefined while hot or without a build. */\n manifestHash(buildDirectory = this.#buildDirectory): string | undefined {\n if (this.isRunningHot()) return undefined\n const path = this.manifestPath(buildDirectory)\n return existsSync(path) ? createHash('md5').update(readFileSync(path)).digest('hex') : undefined\n }\n\n manifestPath(buildDirectory = this.#buildDirectory): string {\n return this.app.publicPath(join(buildDirectory, this.#manifestFilename))\n }\n\n manifest(buildDirectory = this.#buildDirectory): Manifest {\n const path = this.manifestPath(buildDirectory)\n if (!existsSync(path)) throw new ViteError(`Vite manifest not found at: ${path}`)\n const { mtimeMs } = statSync(path)\n const cached = manifests.get(path)\n if (cached !== undefined && cached.mtimeMs === mtimeMs) return cached.manifest\n const manifest = JSON.parse(readFileSync(path, 'utf8')) as Manifest\n manifests.set(path, { mtimeMs, manifest })\n return manifest\n }\n\n /** URL → the attributes of the preload tags rendered so far (without href), for Link headers. */\n preloadedAssets(): Record<string, string[]> {\n return { ...this.#preloaded }\n }\n\n /** Renders withEntryPoints() (Vite is Htmlable, like Laravel's). */\n toHtml(): string {\n return this.tags(this.#entryPoints).toHtml()\n }\n\n // Internals ------------------------------------------------------------------------------------------------\n\n #hotAsset(path: string): string {\n return `${this.devServerUrl() ?? ''}/${path}`\n }\n\n #assetPath(path: string): string {\n if (this.#assetPathResolver !== undefined) return this.#assetPathResolver(path)\n if (this.app.bound(UrlGenerator)) return this.app.make(UrlGenerator).asset(path)\n const base = this.app.bound(ConfigRepository) ? this.app.make(ConfigRepository).get<string | null>('app.asset_url', null) : null\n return `${(base ?? '').replace(/\\/+$/, '')}/${path.replace(/^\\/+/, '')}`\n }\n\n #chunk(manifest: Manifest, file: string): ManifestChunk {\n const chunk = manifest[file]\n if (chunk === undefined) throw new ViteError(`Unable to locate file in Vite manifest: ${file}.`)\n return chunk\n }\n\n /** Every static import, depth first, each once. */\n #resolveImports(manifest: Manifest, chunk: ManifestChunk, seen = new Set<string>()): string[] {\n const imports: string[] = []\n for (const name of chunk.imports ?? []) {\n if (seen.has(name)) continue\n seen.add(name)\n imports.push(name)\n const imported = manifest[name]\n if (imported !== undefined) imports.push(...this.#resolveImports(manifest, imported, seen))\n }\n return imports\n }\n\n #tagForChunk(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined): string {\n if (CSS_PATH.test(url)) {\n const attributes = this.#parseAttributes({ rel: 'stylesheet', href: url, nonce: this.#nonce ?? false, ...TRACKED, ...this.#styleAttributes(src, url, chunk, manifest) })\n return `<link ${attributes.join(' ')} />`\n }\n const attributes = this.#parseAttributes({ type: 'module', src: url, nonce: this.#nonce ?? false, ...TRACKED, ...this.#scriptAttributes(src, url, chunk, manifest) })\n return `<script ${attributes.join(' ')}></script>`\n }\n\n #preloadTag(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest): string {\n const css = CSS_PATH.test(url)\n let attributes: TagAttributes = {\n rel: css ? 'preload' : 'modulepreload',\n as: css ? 'style' : 'script',\n href: url,\n nonce: this.#nonce ?? false,\n crossorigin: (css ? this.#styleAttributes(src, url, chunk, manifest) : this.#scriptAttributes(src, url, chunk, manifest)).crossorigin ?? false,\n }\n if (this.#integrityKey !== false) attributes.integrity = (chunk?.[this.#integrityKey] as string | undefined) ?? false\n for (const resolver of this.#preloadResolvers) {\n const resolved = resolver(src, url, chunk, manifest)\n if (resolved === false) return ''\n attributes = { ...attributes, ...resolved }\n }\n const { href: _href, ...rest } = attributes\n this.#preloaded[url] = this.#parseAttributes(rest)\n return `<link ${this.#parseAttributes(attributes).join(' ')} />`\n }\n\n #scriptAttributes(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined): TagAttributes {\n let attributes: TagAttributes = this.#integrityKey !== false ? { integrity: (chunk?.[this.#integrityKey] as string | undefined) ?? false } : {}\n for (const resolver of this.#scriptResolvers) attributes = { ...attributes, ...resolver(src, url, chunk, manifest) }\n return attributes\n }\n\n #styleAttributes(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined): TagAttributes {\n let attributes: TagAttributes = this.#integrityKey !== false ? { integrity: (chunk?.[this.#integrityKey] as string | undefined) ?? false } : {}\n for (const resolver of this.#styleResolvers) attributes = { ...attributes, ...resolver(src, url, chunk, manifest) }\n return attributes\n }\n\n /** false/null/undefined are dropped, true is a bare attribute, anything else name=\"value\". */\n #parseAttributes(attributes: TagAttributes): string[] {\n return Object.entries(attributes)\n .filter(([, value]) => value !== false && value !== null && value !== undefined)\n .map(([name, value]) => (value === true ? name : `${name}=\"${escapeAttribute(String(value))}\"`))\n }\n}\n\n/**\n * The Vite instance for the current context: the request's own (scoped, so a CSP nonce stays in its request),\n * else a fresh one for the application (a mail view rendered by a queue worker).\n */\nexport function currentVite(): Vite {\n const container = currentContainer()\n if (container === undefined) throw new ContainerNotAvailableError('Vite')\n if (container.bound(HttpRequest)) return container.make(Vite)\n return new Vite(container.make(ApplicationToken))\n}\n\n/** vite(['resources/js/app.tsx']) → the tags (Laravel's @vite); vite() → the Vite instance. */\nexport function vite(): Vite\nexport function vite(entryPoints: string | string[], buildDirectory?: string): ViteHtml\nexport function vite(entryPoints?: string | string[], buildDirectory?: string): Vite | ViteHtml {\n const instance = currentVite()\n return entryPoints === undefined ? instance : instance.tags(entryPoints, buildDirectory)\n}\n\n/** Laravel's @viteReactRefresh: put it before vite([...]) in the root view of a React app. */\nexport function viteReactRefresh(): ViteHtml | undefined {\n return currentVite().reactRefresh()\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,eAAeC;AAAA,EACf,iBAAiB;AAAA,EACjB,oBAAAC;AAAA,EACA;AAAA,OAIK;AACP,SAAS,iBAAiB;AAC1B,SAAS,eAAe,WAAW;;;ACXnC,SAAS,YAAY,YAAY;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,mBAAmB,iBAAiB,kBAAkB;AAexD,IAAM,qBAAN,MAAyB;AAAA,EAM9B,YAA6B,KAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EALZ,YAA2D,CAAC;AAAA,EAC5D,aAAkE,CAAC;AAAA,EACnE,aAAkE,CAAC;AAAA,EAC5E;AAAA,EAIR,cAAc,YAA2D,CAAC,GAAS;AACjF,SAAK,UAAU,KAAK,GAAG,SAAS;AAChC,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,SAA+B;AACzC,UAAM,MAAM,CAAC,MAAe,WAAW,CAAC,IAAI,IAAI,KAAK,KAAK,IAAI,SAAS,GAAG,CAAC;AAC3E,UAAM,OAAO,CAAC,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,SAAK,OAAO,IAAI,GAAG,OAAO,YAAY,CAAC,IAAI,IAAI,IAAI,OAAO;AAC1D,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,SAAqC;AAChD,UAAM,UAAU,KAAK,OAAO,IAAI,GAAG,QAAQ,MAAM,IAAI,IAAI,IAAI,QAAQ,GAAG,EAAE,QAAQ,EAAE;AACpF,QAAI,CAAC,QAAS,QAAO,IAAI,SAAS,aAAa,EAAE,QAAQ,KAAK,SAAS,EAAE,gBAAgB,4BAA4B,EAAE,CAAC;AACxH,WAAO,WAAW,MAAM,QAAQ,OAAO,CAAC;AAAA,EAC1C;AACF;AAEA,SAAS,WAAW,QAA2B;AAC7C,MAAI,kBAAkB,SAAU,QAAO;AACvC,MAAI,WAAW,UAAa,WAAW,KAAM,QAAO,IAAI,SAAS,MAAM,EAAE,QAAQ,IAAI,CAAC;AACtF,MAAI,OAAO,WAAW,SAAU,QAAO,IAAI,SAAS,QAAQ,EAAE,SAAS,EAAE,gBAAgB,2BAA2B,EAAE,CAAC;AACvH,SAAO,SAAS,KAAK,MAAM;AAC7B;","names":["join","ApplicationToken","ConfigRepository","join","ConfigRepository","attributes","ApplicationToken","join","ConfigRepository"]}
1
+ {"version":3,"sources":["../Application.ts","../ApplicationBuilder.ts","../Http/RenameClasses.ts","../ClassNames.ts","../errors.ts","../Vite.ts","../Http/ClosureKernel.ts"],"sourcesContent":["import { join } from 'node:path'\nimport {\n Application as ApplicationToken,\n ClassNames,\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 { ClassNameMap } from './ClassNames'\nimport { ProviderBootError, ProviderRegisterError } from './errors'\nimport { Vite } from './Vite'\n\ntype LifecycleCallback = (app: ApplicationContract) => void | Promise<void>\n\n/** How long shutdown() waits for its callbacks before giving up, so a hung close never keeps the process alive. */\nconst SHUTDOWN_TIMEOUT_MS = 10_000\n\nexport class Application extends Container implements ApplicationContract {\n readonly version = '0.1.0-alpha.11'\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 readonly shutdownCallbacks: Array<() => void | Promise<void>> = []\n private shutdownPromise: Promise<void> | undefined\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 // One per request: a CSP nonce set with vite().useCspNonce() must not leak into other requests.\n this.scoped(Vite, () => new Vite(this))\n this.singleton(ClassNames, () => new ClassNameMap(this))\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 /**\n * A callback for the end of the process (the CLI after its command, the server on SIGTERM): close DB pools, Redis\n * clients and log files. Not in Laravel, whose PHP processes end with each request.\n */\n onShutdown(callback: () => void | Promise<void>): void {\n this.shutdownCallbacks.push(callback)\n }\n\n /**\n * Runs the shutdown callbacks once (a second call returns the same promise), newest first: an app's own callbacks\n * run before the framework closes what they use, then the framework's in the reverse of its providers' order (the\n * queue, database and cache connections close, then the log is written, then the session store closes). A failing\n * callback is printed with console.error (the log may be closed already) and the others still run; after 10 seconds\n * the rest are given up on, so the process can still exit. Never rejects.\n */\n shutdown(): Promise<void> {\n return (this.shutdownPromise ??= this.runShutdown())\n }\n\n private async runShutdown(): Promise<void> {\n if (this.shutdownCallbacks.length === 0) return\n const callbacks = [...this.shutdownCallbacks].reverse()\n const run = (async () => {\n for (const callback of callbacks) {\n try {\n await callback()\n } catch (error) {\n console.error(error)\n }\n }\n return 'done' as const\n })()\n let timer: ReturnType<typeof setTimeout> | undefined\n // Not unref'd: if a callback hangs on a promise and nothing else is left, the process must still reach its exit.\n const deadline = new Promise<'timeout'>((resolve) => (timer = setTimeout(() => resolve('timeout'), SHUTDOWN_TIMEOUT_MS)))\n const outcome = await Promise.race([run, deadline])\n clearTimeout(timer)\n if (outcome === 'timeout') {\n console.error(`The shutdown callbacks did not finish within ${SHUTDOWN_TIMEOUT_MS / 1000} seconds; carrying on with the exit.`)\n }\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'\nimport { RenameClasses } from './Http/RenameClasses'\n\nexport interface RoutingOptions {\n /** One route file or several, loaded in order: web: ['routes/web.ts', 'routes/settings.ts', 'routes/auth.ts']. */\n web?: string | string[]\n api?: string | 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) => (isAbsolute(p) ? p : join(this.app.basePath(), p))\n const each = (p: string | string[]) => (Array.isArray(p) ? p.map(abs) : abs(p))\n const paths: RoutingPaths = { apiPrefix: options.apiPrefix ?? 'api' }\n if (options.web !== undefined) paths.web = each(options.web)\n if (options.api !== undefined) paths.api = each(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 // Outermost, so it sees every page as it leaves: the classes of a scrambled build renamed.\n const middleware = [(m: MiddlewareConfigurator) => void m.prepend(RenameClasses), ...this.middleware]\n this.app.instance(MiddlewareCallbacks, 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","import { ClassNames, Container, type HttpRequest, type Middleware, type Next } from '@orieljs/contracts'\nimport { inject } from '@orieljs/container'\n\n/** Elements whose content isn't markup: a chunk is never cut inside one, so its text is never read as tags. */\nconst RAW_TEXT = /<(script|style|textarea|title|xmp|noembed|noframes)\\b[^>]*>(?![\\s\\S]*<\\/\\1)/i\n\n/**\n * Renames the classes in the HTML pages the app sends, as a scrambled production build renamed them in its CSS\n * (`ClassNames`). JSON, files and every other response are left alone, and so is every page when there's no\n * scrambled build. A streamed page is renamed chunk by chunk, each chunk cut after its last whole tag.\n */\nexport class RenameClasses implements Middleware {\n readonly #container = inject(Container)\n\n async handle(request: HttpRequest, next: Next): Promise<Response> {\n const response = await next(request)\n if (response.body === null || !/^text\\/html\\b/i.test(response.headers.get('content-type') ?? '') || response.headers.has('content-encoding')) return response\n if (!this.#container.bound(ClassNames)) return response\n const classNames = this.#container.make(ClassNames)\n if (!classNames.active) return response\n const headers = new Headers(response.headers)\n headers.delete('content-length')\n return new Response(response.body.pipeThrough(renamer((html) => classNames.html(html))), { status: response.status, statusText: response.statusText, headers })\n }\n}\n\n/** Decodes the page, renames each whole run of tags, and keeps the rest for the next chunk. */\nfunction renamer(rename: (html: string) => string): TransformStream<Uint8Array, Uint8Array> {\n const decoder = new TextDecoder()\n const encoder = new TextEncoder()\n let carry = ''\n return new TransformStream({\n transform(chunk, controller) {\n const text = carry + decoder.decode(chunk, { stream: true })\n const cut = safeCut(text)\n carry = text.slice(cut)\n if (cut > 0) controller.enqueue(encoder.encode(rename(text.slice(0, cut))))\n },\n flush(controller) {\n const text = carry + decoder.decode()\n if (text !== '') controller.enqueue(encoder.encode(rename(text)))\n },\n })\n}\n\n/** Where a chunk of HTML can be cut: after its last `>`, but before a comment or a raw-text element still open there. */\nfunction safeCut(text: string): number {\n let cut = text.lastIndexOf('>') + 1\n if (cut === 0) return 0\n const head = text.slice(0, cut)\n const comment = head.lastIndexOf('<!--')\n if (comment !== -1 && head.indexOf('-->', comment + 4) === -1) cut = comment\n const raw = RAW_TEXT.exec(text.slice(0, cut))\n if (raw !== null) cut = raw.index\n return cut\n}\n","import { existsSync, readFileSync, statSync } from 'node:fs'\nimport type { Application, ClassNames as ClassNamesContract } from '@orieljs/contracts'\nimport { rewriteHtml } from '@orieljs/obfuscate'\n\n/**\n * The class names of a scrambled production build, read from `bootstrap/cache/classes.json`. The file is read again when\n * a new build replaces it, and ignored while `public/hot` exists (the Vite dev server's CSS keeps the names as written)\n * and while the app runs its tests, which check the HTML its views write.\n */\nexport class ClassNameMap implements ClassNamesContract {\n #loaded: { modified: number; classes: Record<string, string> } | undefined\n\n constructor(private readonly app: Application) {}\n\n /** The map, or undefined: no scrambled build, the dev server is running, or the app is running its tests. */\n classes(): Record<string, string> | undefined {\n if (this.#testing() || existsSync(this.app.publicPath('hot'))) return undefined\n const file = this.app.bootstrapPath('cache/classes.json')\n let modified: number\n try {\n modified = statSync(file).mtimeMs\n } catch {\n this.#loaded = undefined\n return undefined\n }\n if (this.#loaded?.modified !== modified) {\n const parsed = JSON.parse(readFileSync(file, 'utf8')) as { classes?: Record<string, string> }\n this.#loaded = { modified, classes: parsed.classes ?? {} }\n }\n return Object.keys(this.#loaded.classes).length === 0 ? undefined : this.#loaded.classes\n }\n\n /** The app runs its tests: Oriel's TestCase sets APP_ENV=testing, which a test that switches app.env leaves set. */\n #testing(): boolean {\n return this.app.runningUnitTests() || process.env.APP_ENV === 'testing'\n }\n\n get active(): boolean {\n return this.classes() !== undefined\n }\n\n html(html: string): string {\n const classes = this.classes()\n return classes === undefined ? html : rewriteHtml(html, classes)\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 { existsSync, readFileSync, statSync } from 'node:fs'\nimport { createHash, randomBytes } from 'node:crypto'\nimport { join } from 'node:path'\nimport { Application as ApplicationToken, ConfigRepository, HttpRequest, UrlGenerator, type Application, type Htmlable, type OrielError } from '@orieljs/contracts'\nimport { ContainerNotAvailableError, currentContainer } from '@orieljs/container'\n\n/** One entry of Vite's build manifest (vite's ManifestChunk). */\nexport interface ManifestChunk {\n file: string\n src?: string\n name?: string\n isEntry?: boolean\n isDynamicEntry?: boolean\n imports?: string[]\n dynamicImports?: string[]\n css?: string[]\n assets?: string[]\n [key: string]: unknown\n}\nexport type Manifest = Record<string, ManifestChunk>\n\nexport type TagAttributes = Record<string, string | boolean | null | undefined>\nexport type AttributesResolver = (src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined) => TagAttributes\nexport type PreloadAttributesResolver = (src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined) => TagAttributes | false\n\n/** A missing manifest or chunk (Laravel's ViteException / ViteManifestNotFoundException). */\nexport class ViteError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n\n constructor(message: string) {\n super(message)\n this.name = 'ViteError'\n }\n}\n\n/** Markup the view renderer emits unescaped (Htmlable; Foundation can't import View's HtmlString). */\nexport class ViteHtml implements Htmlable {\n constructor(private readonly html: string) {}\n\n toHtml(): string {\n return this.html\n }\n\n toString(): string {\n return this.html\n }\n}\n\n/**\n * Marks the tags as tracked assets: when o:navigate reaches a page whose tracked URLs changed (a new build), it loads\n * the page in full rather than run the new bundle beside the old one. A tag attribute of `false` takes it off.\n */\nconst TRACKED: TagAttributes = { 'data-navigate-track': true }\nconst CSS_PATH = /\\.(css|less|sass|scss|styl|stylus|pcss|postcss)(\\?[^.]*)?$/\n\n/** Parsed manifests by path, reloaded when the file changes (a long-running server outlives a `vite build`). */\nconst manifests = new Map<string, { mtimeMs: number; manifest: Manifest }>()\n\nconst escapeAttribute = (value: string): string => value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;')\n\n/**\n * Laravel's Illuminate\\Foundation\\Vite: the script, style and preload tags for Vite entry points. While the dev\n * server runs (public/hot holds its URL) it points at the dev server; otherwise it reads public/build/manifest.json.\n */\nexport class Vite {\n #hotFile: string | undefined\n #buildDirectory = 'build'\n #manifestFilename = 'manifest.json'\n #nonce: string | undefined\n #integrityKey: string | false = 'integrity'\n #entryPoints: string[] = []\n readonly #scriptResolvers: AttributesResolver[] = []\n readonly #styleResolvers: AttributesResolver[] = []\n readonly #preloadResolvers: PreloadAttributesResolver[] = []\n #assetPathResolver: ((path: string) => string) | undefined\n readonly #preloaded: Record<string, string[]> = {}\n\n constructor(protected readonly app: Application) {}\n\n // Configuration --------------------------------------------------------------------------------------------\n\n useCspNonce(nonce?: string): string {\n this.#nonce = nonce ?? randomBytes(30).toString('base64url').slice(0, 40)\n return this.#nonce\n }\n\n cspNonce(): string | undefined {\n return this.#nonce\n }\n\n useIntegrityKey(key: string | false): this {\n this.#integrityKey = key\n return this\n }\n\n withEntryPoints(entryPoints: string[]): this {\n this.#entryPoints = entryPoints\n return this\n }\n\n useHotFile(path: string): this {\n this.#hotFile = path\n return this\n }\n\n useBuildDirectory(path: string): this {\n this.#buildDirectory = path\n return this\n }\n\n useManifestFilename(filename: string): this {\n this.#manifestFilename = filename\n return this\n }\n\n useScriptTagAttributes(attributes: TagAttributes | AttributesResolver): this {\n this.#scriptResolvers.push(typeof attributes === 'function' ? attributes : () => attributes)\n return this\n }\n\n useStyleTagAttributes(attributes: TagAttributes | AttributesResolver): this {\n this.#styleResolvers.push(typeof attributes === 'function' ? attributes : () => attributes)\n return this\n }\n\n /** Extra preload attributes; a resolver returning false drops that preload. */\n usePreloadTagAttributes(attributes: TagAttributes | PreloadAttributesResolver | false): this {\n this.#preloadResolvers.push(typeof attributes === 'function' ? attributes : () => attributes)\n return this\n }\n\n createAssetPathsUsing(resolver: (path: string) => string): this {\n this.#assetPathResolver = resolver\n return this\n }\n\n // Dev server -----------------------------------------------------------------------------------------------\n\n hotFile(): string {\n return this.#hotFile ?? this.app.publicPath('hot')\n }\n\n isRunningHot(): boolean {\n return existsSync(this.hotFile())\n }\n\n /** The dev server URL written by @orieljs/vite, or undefined when it isn't running. */\n devServerUrl(): string | undefined {\n return this.isRunningHot() ? readFileSync(this.hotFile(), 'utf8').trimEnd() : undefined\n }\n\n // Tags -----------------------------------------------------------------------------------------------------\n\n /** Laravel's @vite([...]): preloads (styles first), then stylesheets, then scripts. */\n tags(entryPoints: string | string[], buildDirectory = this.#buildDirectory): ViteHtml {\n const entries = [entryPoints].flat()\n if (this.isRunningHot()) {\n return new ViteHtml(['@vite/client', ...entries].map((entry) => this.#tagForChunk(entry, this.#hotAsset(entry), undefined, undefined)).join(''))\n }\n const manifest = this.manifest(buildDirectory)\n const tags: string[] = []\n const preloads: Array<[string, string, ManifestChunk | undefined]> = []\n const cssChunk = (css: string): [string, ManifestChunk | undefined] => {\n const found = Object.entries(manifest).find(([, chunk]) => chunk.file === css)\n return found === undefined ? [css, undefined] : [found[0], found[1]]\n }\n for (const entry of entries) {\n const chunk = this.#chunk(manifest, entry)\n preloads.push([chunk.src ?? entry, this.#assetPath(`${buildDirectory}/${chunk.file}`), chunk])\n for (const name of this.#resolveImports(manifest, chunk)) {\n const imported = manifest[name]!\n preloads.push([name, this.#assetPath(`${buildDirectory}/${imported.file}`), imported])\n for (const css of imported.css ?? []) {\n const [key, partial] = cssChunk(css)\n preloads.push([key, this.#assetPath(`${buildDirectory}/${css}`), partial])\n tags.push(this.#tagForChunk(key, this.#assetPath(`${buildDirectory}/${css}`), partial, manifest))\n }\n }\n tags.push(this.#tagForChunk(entry, this.#assetPath(`${buildDirectory}/${chunk.file}`), chunk, manifest))\n for (const css of chunk.css ?? []) {\n const [key, partial] = cssChunk(css)\n preloads.push([key, this.#assetPath(`${buildDirectory}/${css}`), partial])\n tags.push(this.#tagForChunk(key, this.#assetPath(`${buildDirectory}/${css}`), partial, manifest))\n }\n }\n const uniqueTags = [...new Set(tags)]\n const stylesheets = uniqueTags.filter((tag) => tag.startsWith('<link'))\n const scripts = uniqueTags.filter((tag) => !tag.startsWith('<link'))\n const seen = new Set<string>()\n const uniquePreloads = preloads.filter(([, url]) => (seen.has(url) ? false : (seen.add(url), true)))\n const sorted = [...uniquePreloads.filter(([, url]) => CSS_PATH.test(url)), ...uniquePreloads.filter(([, url]) => !CSS_PATH.test(url))]\n const preloadTags = sorted.map(([src, url, chunk]) => this.#preloadTag(src, url, chunk, manifest))\n return new ViteHtml(preloadTags.join('') + stylesheets.join('') + scripts.join(''))\n }\n\n /** Laravel's @viteReactRefresh: the React Refresh preamble while the dev server runs; nothing otherwise. */\n reactRefresh(): ViteHtml | undefined {\n if (!this.isRunningHot()) return undefined\n const attributes = this.#parseAttributes({ nonce: this.#nonce ?? false })\n return new ViteHtml(\n [\n `<script type=\"module\" ${attributes.join(' ')}>`,\n ` import RefreshRuntime from '${this.#hotAsset('@react-refresh')}'`,\n ' RefreshRuntime.injectIntoGlobalHook(window)',\n ' window.$RefreshReg$ = () => {}',\n ' window.$RefreshSig$ = () => (type) => type',\n ' window.__vite_plugin_react_preamble_installed__ = true',\n '</script>',\n ].join('\\n'),\n )\n }\n\n /** The URL of a processed asset (Vite::asset('resources/images/logo.svg')). */\n asset(path: string, buildDirectory = this.#buildDirectory): string {\n if (this.isRunningHot()) return this.#hotAsset(path)\n return this.#assetPath(`${buildDirectory}/${this.#chunk(this.manifest(buildDirectory), path).file}`)\n }\n\n /** The built file's contents (Vite::content()). */\n content(path: string, buildDirectory = this.#buildDirectory): string {\n const chunk = this.#chunk(this.manifest(buildDirectory), path)\n const file = this.app.publicPath(join(buildDirectory, chunk.file))\n if (!existsSync(file)) throw new ViteError(`Unable to locate file from Vite manifest: ${file}.`)\n return readFileSync(file, 'utf8')\n }\n\n /** md5 of the manifest (a cache-busting asset version); undefined while hot or without a build. */\n manifestHash(buildDirectory = this.#buildDirectory): string | undefined {\n if (this.isRunningHot()) return undefined\n const path = this.manifestPath(buildDirectory)\n return existsSync(path) ? createHash('md5').update(readFileSync(path)).digest('hex') : undefined\n }\n\n manifestPath(buildDirectory = this.#buildDirectory): string {\n return this.app.publicPath(join(buildDirectory, this.#manifestFilename))\n }\n\n manifest(buildDirectory = this.#buildDirectory): Manifest {\n const path = this.manifestPath(buildDirectory)\n if (!existsSync(path)) throw new ViteError(`Vite manifest not found at: ${path}`)\n const { mtimeMs } = statSync(path)\n const cached = manifests.get(path)\n if (cached !== undefined && cached.mtimeMs === mtimeMs) return cached.manifest\n const manifest = JSON.parse(readFileSync(path, 'utf8')) as Manifest\n manifests.set(path, { mtimeMs, manifest })\n return manifest\n }\n\n /** URL → the attributes of the preload tags rendered so far (without href), for Link headers. */\n preloadedAssets(): Record<string, string[]> {\n return { ...this.#preloaded }\n }\n\n /** Renders withEntryPoints() (Vite is Htmlable, like Laravel's). */\n toHtml(): string {\n return this.tags(this.#entryPoints).toHtml()\n }\n\n // Internals ------------------------------------------------------------------------------------------------\n\n #hotAsset(path: string): string {\n return `${this.devServerUrl() ?? ''}/${path}`\n }\n\n #assetPath(path: string): string {\n if (this.#assetPathResolver !== undefined) return this.#assetPathResolver(path)\n if (this.app.bound(UrlGenerator)) return this.app.make(UrlGenerator).asset(path)\n const base = this.app.bound(ConfigRepository) ? this.app.make(ConfigRepository).get<string | null>('app.asset_url', null) : null\n return `${(base ?? '').replace(/\\/+$/, '')}/${path.replace(/^\\/+/, '')}`\n }\n\n #chunk(manifest: Manifest, file: string): ManifestChunk {\n const chunk = manifest[file]\n if (chunk === undefined) throw new ViteError(`Unable to locate file in Vite manifest: ${file}.`)\n return chunk\n }\n\n /** Every static import, depth first, each once. */\n #resolveImports(manifest: Manifest, chunk: ManifestChunk, seen = new Set<string>()): string[] {\n const imports: string[] = []\n for (const name of chunk.imports ?? []) {\n if (seen.has(name)) continue\n seen.add(name)\n imports.push(name)\n const imported = manifest[name]\n if (imported !== undefined) imports.push(...this.#resolveImports(manifest, imported, seen))\n }\n return imports\n }\n\n #tagForChunk(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined): string {\n if (CSS_PATH.test(url)) {\n const attributes = this.#parseAttributes({ rel: 'stylesheet', href: url, nonce: this.#nonce ?? false, ...TRACKED, ...this.#styleAttributes(src, url, chunk, manifest) })\n return `<link ${attributes.join(' ')} />`\n }\n const attributes = this.#parseAttributes({ type: 'module', src: url, nonce: this.#nonce ?? false, ...TRACKED, ...this.#scriptAttributes(src, url, chunk, manifest) })\n return `<script ${attributes.join(' ')}></script>`\n }\n\n #preloadTag(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest): string {\n const css = CSS_PATH.test(url)\n let attributes: TagAttributes = {\n rel: css ? 'preload' : 'modulepreload',\n as: css ? 'style' : 'script',\n href: url,\n nonce: this.#nonce ?? false,\n crossorigin: (css ? this.#styleAttributes(src, url, chunk, manifest) : this.#scriptAttributes(src, url, chunk, manifest)).crossorigin ?? false,\n }\n if (this.#integrityKey !== false) attributes.integrity = (chunk?.[this.#integrityKey] as string | undefined) ?? false\n for (const resolver of this.#preloadResolvers) {\n const resolved = resolver(src, url, chunk, manifest)\n if (resolved === false) return ''\n attributes = { ...attributes, ...resolved }\n }\n const { href: _href, ...rest } = attributes\n this.#preloaded[url] = this.#parseAttributes(rest)\n return `<link ${this.#parseAttributes(attributes).join(' ')} />`\n }\n\n #scriptAttributes(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined): TagAttributes {\n let attributes: TagAttributes = this.#integrityKey !== false ? { integrity: (chunk?.[this.#integrityKey] as string | undefined) ?? false } : {}\n for (const resolver of this.#scriptResolvers) attributes = { ...attributes, ...resolver(src, url, chunk, manifest) }\n return attributes\n }\n\n #styleAttributes(src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined): TagAttributes {\n let attributes: TagAttributes = this.#integrityKey !== false ? { integrity: (chunk?.[this.#integrityKey] as string | undefined) ?? false } : {}\n for (const resolver of this.#styleResolvers) attributes = { ...attributes, ...resolver(src, url, chunk, manifest) }\n return attributes\n }\n\n /** false/null/undefined are dropped, true is a bare attribute, anything else name=\"value\". */\n #parseAttributes(attributes: TagAttributes): string[] {\n return Object.entries(attributes)\n .filter(([, value]) => value !== false && value !== null && value !== undefined)\n .map(([name, value]) => (value === true ? name : `${name}=\"${escapeAttribute(String(value))}\"`))\n }\n}\n\n/**\n * The Vite instance for the current context: the request's own (scoped, so a CSP nonce stays in its request),\n * else a fresh one for the application (a mail view rendered by a queue worker).\n */\nexport function currentVite(): Vite {\n const container = currentContainer()\n if (container === undefined) throw new ContainerNotAvailableError('Vite')\n if (container.bound(HttpRequest)) return container.make(Vite)\n return new Vite(container.make(ApplicationToken))\n}\n\n/** vite(['resources/js/app.tsx']) → the tags (Laravel's @vite); vite() → the Vite instance. */\nexport function vite(): Vite\nexport function vite(entryPoints: string | string[], buildDirectory?: string): ViteHtml\nexport function vite(entryPoints?: string | string[], buildDirectory?: string): Vite | ViteHtml {\n const instance = currentVite()\n return entryPoints === undefined ? instance : instance.tags(entryPoints, buildDirectory)\n}\n\n/** Laravel's @viteReactRefresh: put it before vite([...]) in the root view of a React app. */\nexport function viteReactRefresh(): ViteHtml | undefined {\n return currentVite().reactRefresh()\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)\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AAO,IAAI,GAAG,QAAQ,MAAM,IAAI,IAAI,IAAI,QAAQ,GAAG,EAAE,QAAQ,EAAE;AACpF,QAAI,CAAC,QAAS,QAAO,IAAI,SAAS,aAAa,EAAE,QAAQ,KAAK,SAAS,EAAE,gBAAgB,4BAA4B,EAAE,CAAC;AACxH,WAAO,WAAW,MAAM,QAAQ,OAAO,CAAC;AAAA,EAC1C;AACF;AAEA,SAAS,WAAW,QAA2B;AAC7C,MAAI,kBAAkB,SAAU,QAAO;AACvC,MAAI,WAAW,UAAa,WAAW,KAAM,QAAO,IAAI,SAAS,MAAM,EAAE,QAAQ,IAAI,CAAC;AACtF,MAAI,OAAO,WAAW,SAAU,QAAO,IAAI,SAAS,QAAQ,EAAE,SAAS,EAAE,gBAAgB,2BAA2B,EAAE,CAAC;AACvH,SAAO,SAAS,KAAK,MAAM;AAC7B;","names":["join","ApplicationToken","ClassNames","ConfigRepository","Container","existsSync","readFileSync","statSync","join","ConfigRepository","attributes","Container","ApplicationToken","ClassNames","join","ConfigRepository"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orieljs/foundation",
3
- "version": "0.1.0-alpha.10",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "The Oriel application: service providers, lifecycle and request handling.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -31,10 +31,11 @@
31
31
  "TRADEMARKS.md"
32
32
  ],
33
33
  "dependencies": {
34
- "@orieljs/container": "0.1.0-alpha.10",
35
- "@orieljs/support": "0.1.0-alpha.10",
36
- "@orieljs/config": "0.1.0-alpha.10",
37
- "@orieljs/contracts": "0.1.0-alpha.10"
34
+ "@orieljs/config": "0.1.0-alpha.11",
35
+ "@orieljs/container": "0.1.0-alpha.11",
36
+ "@orieljs/contracts": "0.1.0-alpha.11",
37
+ "@orieljs/support": "0.1.0-alpha.11",
38
+ "@orieljs/obfuscate": "0.1.0-alpha.11"
38
39
  },
39
40
  "scripts": {
40
41
  "build": "tsup && node ../../../scripts/copy-license.mjs"