@orieljs/foundation 0.1.0-alpha.0 → 0.1.0-alpha.2
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 +202 -21
- package/NOTICE +9 -0
- package/dist/index.d.ts +85 -3
- package/dist/index.js +303 -15
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Oriel
|
|
2
|
+
Copyright 2026 meeeet-dev and Oriel contributors
|
|
3
|
+
|
|
4
|
+
This product includes software developed by the Oriel project
|
|
5
|
+
(https://orieljs.vercel.app, https://github.com/orieljs).
|
|
6
|
+
|
|
7
|
+
Oriel is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
8
|
+
The Oriel name and logo are not covered by that license; see TRADEMARKS.md
|
|
9
|
+
(https://github.com/orieljs/framework/blob/main/TRADEMARKS.md).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServiceProvider, ServiceProviderClass, MiddlewareConfigurator, ExceptionsConfigurator, Application as Application$1, HttpKernel } from '@orieljs/contracts';
|
|
1
|
+
import { ServiceProvider, ServiceProviderClass, MiddlewareConfigurator, ExceptionsConfigurator, Application as Application$1, HttpKernel, Htmlable, OrielError } from '@orieljs/contracts';
|
|
2
2
|
import { Container } from '@orieljs/container';
|
|
3
3
|
|
|
4
4
|
interface RoutingOptions {
|
|
@@ -29,7 +29,7 @@ declare class ApplicationBuilder {
|
|
|
29
29
|
type LifecycleCallback = (app: Application$1) => void | Promise<void>;
|
|
30
30
|
declare class Application extends Container implements Application$1 {
|
|
31
31
|
private readonly base;
|
|
32
|
-
readonly version = "0.0.
|
|
32
|
+
readonly version = "0.1.0-alpha.1";
|
|
33
33
|
private readonly providers;
|
|
34
34
|
private readonly bootingCallbacks;
|
|
35
35
|
private readonly bootedCallbacks;
|
|
@@ -90,4 +90,86 @@ declare class ProviderRegisterError extends Error {
|
|
|
90
90
|
constructor(provider: string, cause: unknown);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
/** One entry of Vite's build manifest (vite's ManifestChunk). */
|
|
94
|
+
interface ManifestChunk {
|
|
95
|
+
file: string;
|
|
96
|
+
src?: string;
|
|
97
|
+
name?: string;
|
|
98
|
+
isEntry?: boolean;
|
|
99
|
+
isDynamicEntry?: boolean;
|
|
100
|
+
imports?: string[];
|
|
101
|
+
dynamicImports?: string[];
|
|
102
|
+
css?: string[];
|
|
103
|
+
assets?: string[];
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
}
|
|
106
|
+
type Manifest = Record<string, ManifestChunk>;
|
|
107
|
+
type TagAttributes = Record<string, string | boolean | null | undefined>;
|
|
108
|
+
type AttributesResolver = (src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined) => TagAttributes;
|
|
109
|
+
type PreloadAttributesResolver = (src: string, url: string, chunk: ManifestChunk | undefined, manifest: Manifest | undefined) => TagAttributes | false;
|
|
110
|
+
/** A missing manifest or chunk (Laravel's ViteException / ViteManifestNotFoundException). */
|
|
111
|
+
declare class ViteError extends Error implements OrielError {
|
|
112
|
+
readonly kind: "Server";
|
|
113
|
+
readonly status = 500;
|
|
114
|
+
constructor(message: string);
|
|
115
|
+
}
|
|
116
|
+
/** Markup the view renderer emits unescaped (Htmlable; Foundation can't import View's HtmlString). */
|
|
117
|
+
declare class ViteHtml implements Htmlable {
|
|
118
|
+
private readonly html;
|
|
119
|
+
constructor(html: string);
|
|
120
|
+
toHtml(): string;
|
|
121
|
+
toString(): string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Laravel's Illuminate\Foundation\Vite: the script, style and preload tags for Vite entry points. While the dev
|
|
125
|
+
* server runs (public/hot holds its URL) it points at the dev server; otherwise it reads public/build/manifest.json.
|
|
126
|
+
*/
|
|
127
|
+
declare class Vite {
|
|
128
|
+
#private;
|
|
129
|
+
protected readonly app: Application$1;
|
|
130
|
+
constructor(app: Application$1);
|
|
131
|
+
useCspNonce(nonce?: string): string;
|
|
132
|
+
cspNonce(): string | undefined;
|
|
133
|
+
useIntegrityKey(key: string | false): this;
|
|
134
|
+
withEntryPoints(entryPoints: string[]): this;
|
|
135
|
+
useHotFile(path: string): this;
|
|
136
|
+
useBuildDirectory(path: string): this;
|
|
137
|
+
useManifestFilename(filename: string): this;
|
|
138
|
+
useScriptTagAttributes(attributes: TagAttributes | AttributesResolver): this;
|
|
139
|
+
useStyleTagAttributes(attributes: TagAttributes | AttributesResolver): this;
|
|
140
|
+
/** Extra preload attributes; a resolver returning false drops that preload. */
|
|
141
|
+
usePreloadTagAttributes(attributes: TagAttributes | PreloadAttributesResolver | false): this;
|
|
142
|
+
createAssetPathsUsing(resolver: (path: string) => string): this;
|
|
143
|
+
hotFile(): string;
|
|
144
|
+
isRunningHot(): boolean;
|
|
145
|
+
/** The dev server URL written by @orieljs/vite, or undefined when it isn't running. */
|
|
146
|
+
devServerUrl(): string | undefined;
|
|
147
|
+
/** Laravel's @vite([...]): preloads (styles first), then stylesheets, then scripts. */
|
|
148
|
+
tags(entryPoints: string | string[], buildDirectory?: string): ViteHtml;
|
|
149
|
+
/** Laravel's @viteReactRefresh: the React Refresh preamble while the dev server runs; nothing otherwise. */
|
|
150
|
+
reactRefresh(): ViteHtml | undefined;
|
|
151
|
+
/** The URL of a processed asset (Vite::asset('resources/images/logo.svg')). */
|
|
152
|
+
asset(path: string, buildDirectory?: string): string;
|
|
153
|
+
/** The built file's contents (Vite::content()). */
|
|
154
|
+
content(path: string, buildDirectory?: string): string;
|
|
155
|
+
/** md5 of the manifest (a cache-busting asset version); undefined while hot or without a build. */
|
|
156
|
+
manifestHash(buildDirectory?: string): string | undefined;
|
|
157
|
+
manifestPath(buildDirectory?: string): string;
|
|
158
|
+
manifest(buildDirectory?: string): Manifest;
|
|
159
|
+
/** URL → the attributes of the preload tags rendered so far (without href), for Link headers. */
|
|
160
|
+
preloadedAssets(): Record<string, string[]>;
|
|
161
|
+
/** Renders withEntryPoints() (Vite is Htmlable, like Laravel's). */
|
|
162
|
+
toHtml(): string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The Vite instance for the current context: the request's own (scoped, so a CSP nonce stays in its request),
|
|
166
|
+
* else a fresh one for the application (a mail view rendered by a queue worker).
|
|
167
|
+
*/
|
|
168
|
+
declare function currentVite(): Vite;
|
|
169
|
+
/** vite(['resources/js/app.tsx']) → the tags (Laravel's @vite); vite() → the Vite instance. */
|
|
170
|
+
declare function vite(): Vite;
|
|
171
|
+
declare function vite(entryPoints: string | string[], buildDirectory?: string): ViteHtml;
|
|
172
|
+
/** Laravel's @viteReactRefresh: put it before vite([...]) in the root view of a React app. */
|
|
173
|
+
declare function viteReactRefresh(): ViteHtml | undefined;
|
|
174
|
+
|
|
175
|
+
export { Application, ApplicationBuilder, type AttributesResolver, ClosureKernel, type Manifest, type ManifestChunk, type PreloadAttributesResolver, ProviderBootError, ProviderRegisterError, type RoutingOptions, type TagAttributes, Vite, ViteError, ViteHtml, currentVite, vite, viteReactRefresh };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Application.ts
|
|
2
|
-
import { join as
|
|
2
|
+
import { join as join3 } from "path";
|
|
3
3
|
import {
|
|
4
|
-
Application as
|
|
4
|
+
Application as ApplicationToken2,
|
|
5
5
|
ClassRegistry as ClassRegistryToken,
|
|
6
|
-
ConfigRepository as
|
|
6
|
+
ConfigRepository as ConfigRepository3,
|
|
7
7
|
HttpKernel
|
|
8
8
|
} from "@orieljs/contracts";
|
|
9
9
|
import { Container } from "@orieljs/container";
|
|
@@ -86,18 +86,300 @@ var ProviderRegisterError = class extends Error {
|
|
|
86
86
|
name = "ProviderRegisterError";
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
// Vite.ts
|
|
90
|
+
import { existsSync, readFileSync, statSync } from "fs";
|
|
91
|
+
import { createHash, randomBytes } from "crypto";
|
|
92
|
+
import { join as join2 } from "path";
|
|
93
|
+
import { Application as ApplicationToken, ConfigRepository as ConfigRepository2, HttpRequest, UrlGenerator } from "@orieljs/contracts";
|
|
94
|
+
import { ContainerNotAvailableError, currentContainer } from "@orieljs/container";
|
|
95
|
+
var ViteError = class extends Error {
|
|
96
|
+
kind = "Server";
|
|
97
|
+
status = 500;
|
|
98
|
+
constructor(message) {
|
|
99
|
+
super(message);
|
|
100
|
+
this.name = "ViteError";
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var ViteHtml = class {
|
|
104
|
+
constructor(html) {
|
|
105
|
+
this.html = html;
|
|
106
|
+
}
|
|
107
|
+
html;
|
|
108
|
+
toHtml() {
|
|
109
|
+
return this.html;
|
|
110
|
+
}
|
|
111
|
+
toString() {
|
|
112
|
+
return this.html;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
var CSS_PATH = /\.(css|less|sass|scss|styl|stylus|pcss|postcss)(\?[^.]*)?$/;
|
|
116
|
+
var manifests = /* @__PURE__ */ new Map();
|
|
117
|
+
var escapeAttribute = (value) => value.replace(/&/g, "&").replace(/"/g, """);
|
|
118
|
+
var Vite = class {
|
|
119
|
+
constructor(app) {
|
|
120
|
+
this.app = app;
|
|
121
|
+
}
|
|
122
|
+
app;
|
|
123
|
+
#hotFile;
|
|
124
|
+
#buildDirectory = "build";
|
|
125
|
+
#manifestFilename = "manifest.json";
|
|
126
|
+
#nonce;
|
|
127
|
+
#integrityKey = "integrity";
|
|
128
|
+
#entryPoints = [];
|
|
129
|
+
#scriptResolvers = [];
|
|
130
|
+
#styleResolvers = [];
|
|
131
|
+
#preloadResolvers = [];
|
|
132
|
+
#assetPathResolver;
|
|
133
|
+
#preloaded = {};
|
|
134
|
+
// Configuration --------------------------------------------------------------------------------------------
|
|
135
|
+
useCspNonce(nonce) {
|
|
136
|
+
this.#nonce = nonce ?? randomBytes(30).toString("base64url").slice(0, 40);
|
|
137
|
+
return this.#nonce;
|
|
138
|
+
}
|
|
139
|
+
cspNonce() {
|
|
140
|
+
return this.#nonce;
|
|
141
|
+
}
|
|
142
|
+
useIntegrityKey(key) {
|
|
143
|
+
this.#integrityKey = key;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
withEntryPoints(entryPoints) {
|
|
147
|
+
this.#entryPoints = entryPoints;
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
useHotFile(path) {
|
|
151
|
+
this.#hotFile = path;
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
useBuildDirectory(path) {
|
|
155
|
+
this.#buildDirectory = path;
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
useManifestFilename(filename) {
|
|
159
|
+
this.#manifestFilename = filename;
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
useScriptTagAttributes(attributes) {
|
|
163
|
+
this.#scriptResolvers.push(typeof attributes === "function" ? attributes : () => attributes);
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
useStyleTagAttributes(attributes) {
|
|
167
|
+
this.#styleResolvers.push(typeof attributes === "function" ? attributes : () => attributes);
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
/** Extra preload attributes; a resolver returning false drops that preload. */
|
|
171
|
+
usePreloadTagAttributes(attributes) {
|
|
172
|
+
this.#preloadResolvers.push(typeof attributes === "function" ? attributes : () => attributes);
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
createAssetPathsUsing(resolver) {
|
|
176
|
+
this.#assetPathResolver = resolver;
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
// Dev server -----------------------------------------------------------------------------------------------
|
|
180
|
+
hotFile() {
|
|
181
|
+
return this.#hotFile ?? this.app.publicPath("hot");
|
|
182
|
+
}
|
|
183
|
+
isRunningHot() {
|
|
184
|
+
return existsSync(this.hotFile());
|
|
185
|
+
}
|
|
186
|
+
/** The dev server URL written by @orieljs/vite, or undefined when it isn't running. */
|
|
187
|
+
devServerUrl() {
|
|
188
|
+
return this.isRunningHot() ? readFileSync(this.hotFile(), "utf8").trimEnd() : void 0;
|
|
189
|
+
}
|
|
190
|
+
// Tags -----------------------------------------------------------------------------------------------------
|
|
191
|
+
/** Laravel's @vite([...]): preloads (styles first), then stylesheets, then scripts. */
|
|
192
|
+
tags(entryPoints, buildDirectory = this.#buildDirectory) {
|
|
193
|
+
const entries = [entryPoints].flat();
|
|
194
|
+
if (this.isRunningHot()) {
|
|
195
|
+
return new ViteHtml(["@vite/client", ...entries].map((entry) => this.#tagForChunk(entry, this.#hotAsset(entry), void 0, void 0)).join(""));
|
|
196
|
+
}
|
|
197
|
+
const manifest = this.manifest(buildDirectory);
|
|
198
|
+
const tags = [];
|
|
199
|
+
const preloads = [];
|
|
200
|
+
const cssChunk = (css) => {
|
|
201
|
+
const found = Object.entries(manifest).find(([, chunk]) => chunk.file === css);
|
|
202
|
+
return found === void 0 ? [css, void 0] : [found[0], found[1]];
|
|
203
|
+
};
|
|
204
|
+
for (const entry of entries) {
|
|
205
|
+
const chunk = this.#chunk(manifest, entry);
|
|
206
|
+
preloads.push([chunk.src ?? entry, this.#assetPath(`${buildDirectory}/${chunk.file}`), chunk]);
|
|
207
|
+
for (const name of this.#resolveImports(manifest, chunk)) {
|
|
208
|
+
const imported = manifest[name];
|
|
209
|
+
preloads.push([name, this.#assetPath(`${buildDirectory}/${imported.file}`), imported]);
|
|
210
|
+
for (const css of imported.css ?? []) {
|
|
211
|
+
const [key, partial] = cssChunk(css);
|
|
212
|
+
preloads.push([key, this.#assetPath(`${buildDirectory}/${css}`), partial]);
|
|
213
|
+
tags.push(this.#tagForChunk(key, this.#assetPath(`${buildDirectory}/${css}`), partial, manifest));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
tags.push(this.#tagForChunk(entry, this.#assetPath(`${buildDirectory}/${chunk.file}`), chunk, manifest));
|
|
217
|
+
for (const css of chunk.css ?? []) {
|
|
218
|
+
const [key, partial] = cssChunk(css);
|
|
219
|
+
preloads.push([key, this.#assetPath(`${buildDirectory}/${css}`), partial]);
|
|
220
|
+
tags.push(this.#tagForChunk(key, this.#assetPath(`${buildDirectory}/${css}`), partial, manifest));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
const uniqueTags = [...new Set(tags)];
|
|
224
|
+
const stylesheets = uniqueTags.filter((tag) => tag.startsWith("<link"));
|
|
225
|
+
const scripts = uniqueTags.filter((tag) => !tag.startsWith("<link"));
|
|
226
|
+
const seen = /* @__PURE__ */ new Set();
|
|
227
|
+
const uniquePreloads = preloads.filter(([, url]) => seen.has(url) ? false : (seen.add(url), true));
|
|
228
|
+
const sorted = [...uniquePreloads.filter(([, url]) => CSS_PATH.test(url)), ...uniquePreloads.filter(([, url]) => !CSS_PATH.test(url))];
|
|
229
|
+
const preloadTags = sorted.map(([src, url, chunk]) => this.#preloadTag(src, url, chunk, manifest));
|
|
230
|
+
return new ViteHtml(preloadTags.join("") + stylesheets.join("") + scripts.join(""));
|
|
231
|
+
}
|
|
232
|
+
/** Laravel's @viteReactRefresh: the React Refresh preamble while the dev server runs; nothing otherwise. */
|
|
233
|
+
reactRefresh() {
|
|
234
|
+
if (!this.isRunningHot()) return void 0;
|
|
235
|
+
const attributes = this.#parseAttributes({ nonce: this.#nonce ?? false });
|
|
236
|
+
return new ViteHtml(
|
|
237
|
+
[
|
|
238
|
+
`<script type="module" ${attributes.join(" ")}>`,
|
|
239
|
+
` import RefreshRuntime from '${this.#hotAsset("@react-refresh")}'`,
|
|
240
|
+
" RefreshRuntime.injectIntoGlobalHook(window)",
|
|
241
|
+
" window.$RefreshReg$ = () => {}",
|
|
242
|
+
" window.$RefreshSig$ = () => (type) => type",
|
|
243
|
+
" window.__vite_plugin_react_preamble_installed__ = true",
|
|
244
|
+
"</script>"
|
|
245
|
+
].join("\n")
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
/** The URL of a processed asset (Vite::asset('resources/images/logo.svg')). */
|
|
249
|
+
asset(path, buildDirectory = this.#buildDirectory) {
|
|
250
|
+
if (this.isRunningHot()) return this.#hotAsset(path);
|
|
251
|
+
return this.#assetPath(`${buildDirectory}/${this.#chunk(this.manifest(buildDirectory), path).file}`);
|
|
252
|
+
}
|
|
253
|
+
/** The built file's contents (Vite::content()). */
|
|
254
|
+
content(path, buildDirectory = this.#buildDirectory) {
|
|
255
|
+
const chunk = this.#chunk(this.manifest(buildDirectory), path);
|
|
256
|
+
const file = this.app.publicPath(join2(buildDirectory, chunk.file));
|
|
257
|
+
if (!existsSync(file)) throw new ViteError(`Unable to locate file from Vite manifest: ${file}.`);
|
|
258
|
+
return readFileSync(file, "utf8");
|
|
259
|
+
}
|
|
260
|
+
/** md5 of the manifest (a cache-busting asset version); undefined while hot or without a build. */
|
|
261
|
+
manifestHash(buildDirectory = this.#buildDirectory) {
|
|
262
|
+
if (this.isRunningHot()) return void 0;
|
|
263
|
+
const path = this.manifestPath(buildDirectory);
|
|
264
|
+
return existsSync(path) ? createHash("md5").update(readFileSync(path)).digest("hex") : void 0;
|
|
265
|
+
}
|
|
266
|
+
manifestPath(buildDirectory = this.#buildDirectory) {
|
|
267
|
+
return this.app.publicPath(join2(buildDirectory, this.#manifestFilename));
|
|
268
|
+
}
|
|
269
|
+
manifest(buildDirectory = this.#buildDirectory) {
|
|
270
|
+
const path = this.manifestPath(buildDirectory);
|
|
271
|
+
if (!existsSync(path)) throw new ViteError(`Vite manifest not found at: ${path}`);
|
|
272
|
+
const { mtimeMs } = statSync(path);
|
|
273
|
+
const cached = manifests.get(path);
|
|
274
|
+
if (cached !== void 0 && cached.mtimeMs === mtimeMs) return cached.manifest;
|
|
275
|
+
const manifest = JSON.parse(readFileSync(path, "utf8"));
|
|
276
|
+
manifests.set(path, { mtimeMs, manifest });
|
|
277
|
+
return manifest;
|
|
278
|
+
}
|
|
279
|
+
/** URL → the attributes of the preload tags rendered so far (without href), for Link headers. */
|
|
280
|
+
preloadedAssets() {
|
|
281
|
+
return { ...this.#preloaded };
|
|
282
|
+
}
|
|
283
|
+
/** Renders withEntryPoints() (Vite is Htmlable, like Laravel's). */
|
|
284
|
+
toHtml() {
|
|
285
|
+
return this.tags(this.#entryPoints).toHtml();
|
|
286
|
+
}
|
|
287
|
+
// Internals ------------------------------------------------------------------------------------------------
|
|
288
|
+
#hotAsset(path) {
|
|
289
|
+
return `${this.devServerUrl() ?? ""}/${path}`;
|
|
290
|
+
}
|
|
291
|
+
#assetPath(path) {
|
|
292
|
+
if (this.#assetPathResolver !== void 0) return this.#assetPathResolver(path);
|
|
293
|
+
if (this.app.bound(UrlGenerator)) return this.app.make(UrlGenerator).asset(path);
|
|
294
|
+
const base = this.app.bound(ConfigRepository2) ? this.app.make(ConfigRepository2).get("app.asset_url", null) : null;
|
|
295
|
+
return `${(base ?? "").replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
296
|
+
}
|
|
297
|
+
#chunk(manifest, file) {
|
|
298
|
+
const chunk = manifest[file];
|
|
299
|
+
if (chunk === void 0) throw new ViteError(`Unable to locate file in Vite manifest: ${file}.`);
|
|
300
|
+
return chunk;
|
|
301
|
+
}
|
|
302
|
+
/** Every static import, depth first, each once. */
|
|
303
|
+
#resolveImports(manifest, chunk, seen = /* @__PURE__ */ new Set()) {
|
|
304
|
+
const imports = [];
|
|
305
|
+
for (const name of chunk.imports ?? []) {
|
|
306
|
+
if (seen.has(name)) continue;
|
|
307
|
+
seen.add(name);
|
|
308
|
+
imports.push(name);
|
|
309
|
+
const imported = manifest[name];
|
|
310
|
+
if (imported !== void 0) imports.push(...this.#resolveImports(manifest, imported, seen));
|
|
311
|
+
}
|
|
312
|
+
return imports;
|
|
313
|
+
}
|
|
314
|
+
#tagForChunk(src, url, chunk, manifest) {
|
|
315
|
+
if (CSS_PATH.test(url)) {
|
|
316
|
+
const attributes2 = this.#parseAttributes({ rel: "stylesheet", href: url, nonce: this.#nonce ?? false, ...this.#styleAttributes(src, url, chunk, manifest) });
|
|
317
|
+
return `<link ${attributes2.join(" ")} />`;
|
|
318
|
+
}
|
|
319
|
+
const attributes = this.#parseAttributes({ type: "module", src: url, nonce: this.#nonce ?? false, ...this.#scriptAttributes(src, url, chunk, manifest) });
|
|
320
|
+
return `<script ${attributes.join(" ")}></script>`;
|
|
321
|
+
}
|
|
322
|
+
#preloadTag(src, url, chunk, manifest) {
|
|
323
|
+
const css = CSS_PATH.test(url);
|
|
324
|
+
let attributes = {
|
|
325
|
+
rel: css ? "preload" : "modulepreload",
|
|
326
|
+
as: css ? "style" : "script",
|
|
327
|
+
href: url,
|
|
328
|
+
nonce: this.#nonce ?? false,
|
|
329
|
+
crossorigin: (css ? this.#styleAttributes(src, url, chunk, manifest) : this.#scriptAttributes(src, url, chunk, manifest)).crossorigin ?? false
|
|
330
|
+
};
|
|
331
|
+
if (this.#integrityKey !== false) attributes.integrity = chunk?.[this.#integrityKey] ?? false;
|
|
332
|
+
for (const resolver of this.#preloadResolvers) {
|
|
333
|
+
const resolved = resolver(src, url, chunk, manifest);
|
|
334
|
+
if (resolved === false) return "";
|
|
335
|
+
attributes = { ...attributes, ...resolved };
|
|
336
|
+
}
|
|
337
|
+
const { href: _href, ...rest } = attributes;
|
|
338
|
+
this.#preloaded[url] = this.#parseAttributes(rest);
|
|
339
|
+
return `<link ${this.#parseAttributes(attributes).join(" ")} />`;
|
|
340
|
+
}
|
|
341
|
+
#scriptAttributes(src, url, chunk, manifest) {
|
|
342
|
+
let attributes = this.#integrityKey !== false ? { integrity: chunk?.[this.#integrityKey] ?? false } : {};
|
|
343
|
+
for (const resolver of this.#scriptResolvers) attributes = { ...attributes, ...resolver(src, url, chunk, manifest) };
|
|
344
|
+
return attributes;
|
|
345
|
+
}
|
|
346
|
+
#styleAttributes(src, url, chunk, manifest) {
|
|
347
|
+
let attributes = this.#integrityKey !== false ? { integrity: chunk?.[this.#integrityKey] ?? false } : {};
|
|
348
|
+
for (const resolver of this.#styleResolvers) attributes = { ...attributes, ...resolver(src, url, chunk, manifest) };
|
|
349
|
+
return attributes;
|
|
350
|
+
}
|
|
351
|
+
/** false/null/undefined are dropped, true is a bare attribute, anything else name="value". */
|
|
352
|
+
#parseAttributes(attributes) {
|
|
353
|
+
return Object.entries(attributes).filter(([, value]) => value !== false && value !== null && value !== void 0).map(([name, value]) => value === true ? name : `${name}="${escapeAttribute(String(value))}"`);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
function currentVite() {
|
|
357
|
+
const container = currentContainer();
|
|
358
|
+
if (container === void 0) throw new ContainerNotAvailableError("Vite");
|
|
359
|
+
if (container.bound(HttpRequest)) return container.make(Vite);
|
|
360
|
+
return new Vite(container.make(ApplicationToken));
|
|
361
|
+
}
|
|
362
|
+
function vite(entryPoints, buildDirectory) {
|
|
363
|
+
const instance = currentVite();
|
|
364
|
+
return entryPoints === void 0 ? instance : instance.tags(entryPoints, buildDirectory);
|
|
365
|
+
}
|
|
366
|
+
function viteReactRefresh() {
|
|
367
|
+
return currentVite().reactRefresh();
|
|
368
|
+
}
|
|
369
|
+
|
|
89
370
|
// Application.ts
|
|
90
371
|
var Application = class _Application extends Container {
|
|
91
372
|
constructor(base) {
|
|
92
373
|
super();
|
|
93
374
|
this.base = base;
|
|
94
375
|
Container.setInstance(this);
|
|
95
|
-
this.instance(
|
|
376
|
+
this.instance(ApplicationToken2, this);
|
|
96
377
|
this.instance(_Application, this);
|
|
97
378
|
this.singleton(ClassRegistryToken, ClassRegistry);
|
|
379
|
+
this.scoped(Vite, () => new Vite(this));
|
|
98
380
|
}
|
|
99
381
|
base;
|
|
100
|
-
version = "0.0.
|
|
382
|
+
version = "0.1.0-alpha.1";
|
|
101
383
|
providers = [];
|
|
102
384
|
bootingCallbacks = [];
|
|
103
385
|
bootedCallbacks = [];
|
|
@@ -110,32 +392,32 @@ var Application = class _Application extends Container {
|
|
|
110
392
|
return new ApplicationBuilder(new _Application(options.basePath));
|
|
111
393
|
}
|
|
112
394
|
basePath(path = "") {
|
|
113
|
-
return
|
|
395
|
+
return join3(this.base, path);
|
|
114
396
|
}
|
|
115
397
|
appPath(path = "") {
|
|
116
|
-
return this.basePath(
|
|
398
|
+
return this.basePath(join3("app", path));
|
|
117
399
|
}
|
|
118
400
|
bootstrapPath(path = "") {
|
|
119
|
-
return this.basePath(
|
|
401
|
+
return this.basePath(join3("bootstrap", path));
|
|
120
402
|
}
|
|
121
403
|
configPath(path = "") {
|
|
122
|
-
return this.basePath(
|
|
404
|
+
return this.basePath(join3("config", path));
|
|
123
405
|
}
|
|
124
406
|
databasePath(path = "") {
|
|
125
|
-
return this.basePath(
|
|
407
|
+
return this.basePath(join3("database", path));
|
|
126
408
|
}
|
|
127
409
|
publicPath(path = "") {
|
|
128
|
-
return this.basePath(
|
|
410
|
+
return this.basePath(join3("public", path));
|
|
129
411
|
}
|
|
130
412
|
resourcePath(path = "") {
|
|
131
|
-
return this.basePath(
|
|
413
|
+
return this.basePath(join3("resources", path));
|
|
132
414
|
}
|
|
133
415
|
storagePath(path = "") {
|
|
134
|
-
return this.basePath(
|
|
416
|
+
return this.basePath(join3("storage", path));
|
|
135
417
|
}
|
|
136
418
|
environment(...environments) {
|
|
137
419
|
const fallback = process.env.APP_ENV ?? "production";
|
|
138
|
-
const current = this.bound(
|
|
420
|
+
const current = this.bound(ConfigRepository3) ? String(this.make(ConfigRepository3).get("app.env", fallback)) : fallback;
|
|
139
421
|
return environments.length === 0 ? current : environments.some((pattern) => Str.is(pattern, current));
|
|
140
422
|
}
|
|
141
423
|
isProduction() {
|
|
@@ -234,6 +516,12 @@ export {
|
|
|
234
516
|
ApplicationBuilder,
|
|
235
517
|
ClosureKernel,
|
|
236
518
|
ProviderBootError,
|
|
237
|
-
ProviderRegisterError
|
|
519
|
+
ProviderRegisterError,
|
|
520
|
+
Vite,
|
|
521
|
+
ViteError,
|
|
522
|
+
ViteHtml,
|
|
523
|
+
currentVite,
|
|
524
|
+
vite,
|
|
525
|
+
viteReactRefresh
|
|
238
526
|
};
|
|
239
527
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP,SAAS,mBAAmB,iBAAiB,kBAAkB;AAcxD,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,MAAgB,MAAM,SAAY,SAAY,WAAW,CAAC,IAAI,IAAI,KAAK,KAAK,IAAI,SAAS,GAAG,CAAC;AAC1G,UAAM,QAAsB,EAAE,WAAW,QAAQ,aAAa,MAAM;AACpE,QAAI,QAAQ,QAAQ,OAAW,OAAM,MAAM,IAAI,QAAQ,GAAG;AAC1D,QAAI,QAAQ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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","ConfigRepository","join","ConfigRepository"]}
|
|
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\nexport class Application extends Container implements ApplicationContract {\n readonly version = '0.1.0-alpha.1'\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 // 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 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 { 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\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, '&').replace(/\"/g, '"')\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, ...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, ...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;AA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AQ,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"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orieljs/foundation",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "The Oriel application: service providers, lifecycle and request handling.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -24,15 +24,17 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"dist"
|
|
27
|
+
"dist",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"NOTICE"
|
|
28
30
|
],
|
|
29
31
|
"dependencies": {
|
|
30
|
-
"@orieljs/config": "0.1.0-alpha.
|
|
31
|
-
"@orieljs/container": "0.1.0-alpha.
|
|
32
|
-
"@orieljs/contracts": "0.1.0-alpha.
|
|
33
|
-
"@orieljs/support": "0.1.0-alpha.
|
|
32
|
+
"@orieljs/config": "0.1.0-alpha.2",
|
|
33
|
+
"@orieljs/container": "0.1.0-alpha.2",
|
|
34
|
+
"@orieljs/contracts": "0.1.0-alpha.2",
|
|
35
|
+
"@orieljs/support": "0.1.0-alpha.2"
|
|
34
36
|
},
|
|
35
37
|
"scripts": {
|
|
36
|
-
"build": "tsup"
|
|
38
|
+
"build": "tsup && node ../../../scripts/copy-license.mjs"
|
|
37
39
|
}
|
|
38
40
|
}
|