@orieljs/vercel 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,202 @@
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,16 @@
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).
10
+
11
+ @orieljs/support (and @orieljs/framework, which bundles it) includes transliteration data from
12
+ voku/portable-ascii (https://github.com/voku/portable-ascii), Copyright (C) 2019 Lars Moelleken, MIT License.
13
+
14
+ @orieljs/notifications (and @orieljs/framework, which bundles it) includes the HTML and CSS of
15
+ Laravel's default notification mail (laravel/framework, https://github.com/laravel/framework),
16
+ Copyright (c) Taylor Otwell, MIT License.
package/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # @orieljs/vercel
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Deploys an Oriel app to Vercel and runs it live on Vercel's serverless functions. `node oriel vercel:build` writes
4
+ Vercel's build output (`.vercel/output`): your `public/` folder as static files, and one Node function holding your
5
+ app's code, its production dependencies and a small launcher that boots the app once per function instance. Vercel is
6
+ part of `@orieljs/framework`, which every Oriel app already installs, and is re-exported from it; `@orieljs/vercel` is
7
+ also published on its own.
8
+
9
+ ```bash
10
+ npm install @orieljs/framework
11
+ ```
12
+
13
+ Set the build command of your Vercel project to build the assets, migrate and write the output:
14
+
15
+ ```bash
16
+ npm run build && node oriel migrate --force && node oriel vercel:build
17
+ ```
18
+
19
+ Your `.env` never goes into the output: set `APP_KEY`, the database URL and the other variables in the Vercel
20
+ project's settings.
21
+
22
+ Documentation: https://orieljs.vercel.app/docs/deployment
23
+
24
+ Status: early alpha. APIs will change.
25
+
26
+ ## License
27
+
28
+ Oriel is open-source software licensed under the Apache License 2.0 (Apache-2.0; see `LICENSE` and `NOTICE`). The Oriel name and logo are trademarks; see `TRADEMARKS.md`.
29
+
30
+ Website: https://orieljs.vercel.app
package/TRADEMARKS.md ADDED
@@ -0,0 +1,33 @@
1
+ # Oriel trademark policy
2
+
3
+ The Oriel code is open source under the Apache License 2.0. The **Oriel name and logo** are not: the license covers
4
+ the code only (section 6 of the license says so), and the name and logo stay with the project. This page explains
5
+ what you can and can't do with them. The goal is simple: people should always be able to tell what is the real Oriel
6
+ and what isn't.
7
+
8
+ ## You can, without asking
9
+
10
+ - Use, change, ship and sell the code, as the license allows.
11
+ - Say that your app or package is "built with Oriel", "for Oriel" or "compatible with Oriel".
12
+ - Name a package `oriel-<something>` or `<something>-for-oriel` when it works with Oriel, as long as it is clear that
13
+ it is not official (for example, don't publish it under the `@orieljs` npm scope).
14
+ - Use the name and logo to write about Oriel, teach it, or link to it, in articles, talks, videos and courses.
15
+ - Use the unmodified logo to point to the project, as it is (no recolouring, cropping or
16
+ distortion).
17
+
18
+ ## You can't, without written permission
19
+
20
+ - Call a fork, a modified copy or a competing product "Oriel", or anything likely to be confused with it.
21
+ - Use the name or logo as the name, logo or domain of your own product, company or service.
22
+ - Suggest that the Oriel project made, endorses or supports your work when it doesn't.
23
+ - Sell merchandise with the name or logo.
24
+
25
+ ## Forks
26
+
27
+ Forks are welcome. Please give yours a different name and logo, keep the `LICENSE` and `NOTICE` files, and say that
28
+ it is based on Oriel.
29
+
30
+ ## Questions
31
+
32
+ Open an issue at https://github.com/orieljs/framework or email meeeet.dev@gmail.com. If you're unsure whether a use
33
+ is fine, ask; the answer is usually yes.
@@ -0,0 +1,45 @@
1
+ import { Application } from '@orieljs/contracts';
2
+ import { ServiceProvider } from '@orieljs/support';
3
+
4
+ interface VercelBuildOptions {
5
+ /** Where the build output goes, relative to the app. Default: `.vercel/output` (where Vercel looks for it). */
6
+ output?: string;
7
+ /** The function's Node runtime. Default: `nodejs22.x`. */
8
+ runtime?: string;
9
+ /** The largest function Vercel accepts, unzipped. Default: 250 MB. */
10
+ maxFunctionBytes?: number;
11
+ /** The machine the build runs on, which decides the native packages copied. Default: `process.platform`. */
12
+ platform?: string;
13
+ }
14
+ interface VercelBuildResult {
15
+ /** The function's size, unzipped. */
16
+ functionBytes: number;
17
+ /** The files Vercel serves without the function. */
18
+ staticFiles: number;
19
+ /** What the build got right but the deploy may not: a build off Linux. */
20
+ warnings: string[];
21
+ }
22
+ /** Vercel's limit on a function's unzipped size. */
23
+ declare const VERCEL_FUNCTION_LIMIT: number;
24
+ /**
25
+ * Writes Vercel's Build Output API v3 folder for an app: `static/` from `public/`, and one Node function holding the
26
+ * app's code, the build files it reads at run time, its production dependencies and the launcher. `.env` files are
27
+ * never copied: the secrets come from Vercel's environment variables.
28
+ */
29
+ declare function buildVercelOutput(app: Application, options?: VercelBuildOptions): Promise<VercelBuildResult>;
30
+
31
+ /**
32
+ * The function's entry (`index.mjs` in `.vercel/output/functions/index.func`): registers tsx as the app's `oriel`
33
+ * file does, boots the app once per function instance, and hands each request to the Node request handler `serve`
34
+ * uses. Public files never reach it: Vercel serves them from `static/`. A boot that fails answers a plain 500, logs
35
+ * the error, and is tried again on the next request. Logs go to stderr unless `LOG_CHANNEL` is set, since the
36
+ * function can't write files, and Vercel's proxy is trusted unless the app lists its own.
37
+ */
38
+ declare const LAUNCHER = "// Oriel on Vercel: boots the app once per function instance and hands it each request.\nimport { fileURLToPath } from 'node:url'\n\nlet ready\n\nasync function boot() {\n // Vercel's disk is read-only, so a log file can't open; stderr is what Vercel's log view shows.\n process.env.LOG_CHANNEL ??= 'stderr'\n if (!process.versions.bun) {\n const { register } = await import('tsx/esm/api')\n register({ tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)) })\n }\n const { createApplication } = await import('./bootstrap/app.ts')\n const { nodeRequestHandler } = await import('@orieljs/framework')\n const { ConfigRepository } = await import('@orieljs/framework/contracts')\n const app = await createApplication()\n await app.boot()\n // Every request comes through Vercel's proxy, which sets the X-Forwarded-* headers itself: trust it, unless the app\n // lists its own proxies, so that URLs keep the browser's https and ip() is the visitor's.\n const config = app.make(ConfigRepository)\n const proxies = config.get('http.trusted_proxies', [])\n if (proxies === undefined || proxies === null || proxies.length === 0) config.set('http.trusted_proxies', '*')\n return nodeRequestHandler(app, { fallbackHost: 'localhost' })\n}\n\nexport default async function handler(req, res) {\n let handle\n try {\n ready ??= boot()\n handle = await ready\n } catch (error) {\n ready = undefined\n console.error(error)\n if (!res.headersSent) {\n res.statusCode = 500\n res.setHeader('content-type', 'text/plain; charset=utf-8')\n }\n res.end('Internal Server Error')\n return\n }\n await handle(req, res)\n}\n";
39
+
40
+ /** Registers `oriel vercel:build`, which writes Vercel's build output for the app. */
41
+ declare class VercelServiceProvider extends ServiceProvider {
42
+ boot(): void;
43
+ }
44
+
45
+ export { LAUNCHER, VERCEL_FUNCTION_LIMIT, type VercelBuildOptions, type VercelBuildResult, VercelServiceProvider, buildVercelOutput };
package/dist/index.js ADDED
@@ -0,0 +1,182 @@
1
+ // build.ts
2
+ import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "fs";
3
+ import { cp, mkdir, rm, writeFile } from "fs/promises";
4
+ import { basename, dirname, join, relative, resolve } from "path";
5
+
6
+ // launcher.ts
7
+ var LAUNCHER = `// Oriel on Vercel: boots the app once per function instance and hands it each request.
8
+ import { fileURLToPath } from 'node:url'
9
+
10
+ let ready
11
+
12
+ async function boot() {
13
+ // Vercel's disk is read-only, so a log file can't open; stderr is what Vercel's log view shows.
14
+ process.env.LOG_CHANNEL ??= 'stderr'
15
+ if (!process.versions.bun) {
16
+ const { register } = await import('tsx/esm/api')
17
+ register({ tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)) })
18
+ }
19
+ const { createApplication } = await import('./bootstrap/app.ts')
20
+ const { nodeRequestHandler } = await import('@orieljs/framework')
21
+ const { ConfigRepository } = await import('@orieljs/framework/contracts')
22
+ const app = await createApplication()
23
+ await app.boot()
24
+ // Every request comes through Vercel's proxy, which sets the X-Forwarded-* headers itself: trust it, unless the app
25
+ // lists its own proxies, so that URLs keep the browser's https and ip() is the visitor's.
26
+ const config = app.make(ConfigRepository)
27
+ const proxies = config.get('http.trusted_proxies', [])
28
+ if (proxies === undefined || proxies === null || proxies.length === 0) config.set('http.trusted_proxies', '*')
29
+ return nodeRequestHandler(app, { fallbackHost: 'localhost' })
30
+ }
31
+
32
+ export default async function handler(req, res) {
33
+ let handle
34
+ try {
35
+ ready ??= boot()
36
+ handle = await ready
37
+ } catch (error) {
38
+ ready = undefined
39
+ console.error(error)
40
+ if (!res.headersSent) {
41
+ res.statusCode = 500
42
+ res.setHeader('content-type', 'text/plain; charset=utf-8')
43
+ }
44
+ res.end('Internal Server Error')
45
+ return
46
+ }
47
+ await handle(req, res)
48
+ }
49
+ `;
50
+
51
+ // build.ts
52
+ var VERCEL_FUNCTION_LIMIT = 250 * 1024 * 1024;
53
+ var APP_FOLDERS = ["app", "bootstrap", "config", "routes", "resources", "lang", "database"];
54
+ var APP_FILES = ["package.json", "tsconfig.json"];
55
+ var BUILD_FILES = ["manifest.json"];
56
+ var VITE_CONFIGS = ["vite.config.ts", "vite.config.mts", "vite.config.js", "vite.config.mjs"];
57
+ var isEnvFile = (path) => /^\.env(\..*)?$/.test(basename(path));
58
+ var isSqliteFile = (path) => /\.(sqlite3?|db)(-wal|-shm|-journal)?$/.test(basename(path));
59
+ var PLATFORM_NAMES = { darwin: "macOS", win32: "Windows" };
60
+ async function buildVercelOutput(app, options = {}) {
61
+ const base = app.basePath();
62
+ const publicPath = app.publicPath();
63
+ if (existsSync(join(publicPath, "hot"))) {
64
+ throw new Error("The Vite dev server is running (public/hot exists): stop `npm run dev` and build the assets with `npm run build` first.");
65
+ }
66
+ if (VITE_CONFIGS.some((file) => existsSync(join(base, file))) && !existsSync(join(publicPath, "build/manifest.json"))) {
67
+ throw new Error("The assets aren't built (public/build/manifest.json is missing): run `npm run build` first.");
68
+ }
69
+ const output = resolve(base, options.output ?? ".vercel/output");
70
+ await rm(output, { recursive: true, force: true });
71
+ const staticFolder = join(output, "static");
72
+ await mkdir(staticFolder, { recursive: true });
73
+ if (existsSync(publicPath)) {
74
+ await cp(publicPath, staticFolder, { recursive: true, filter: (source) => basename(source) !== "hot" && !isEnvFile(source) });
75
+ }
76
+ const fn = join(output, "functions/index.func");
77
+ for (const folder of APP_FOLDERS) {
78
+ const filter = (source) => !isEnvFile(source) && !(folder === "database" && isSqliteFile(source));
79
+ if (existsSync(join(base, folder))) await cp(join(base, folder), join(fn, folder), { recursive: true, filter });
80
+ }
81
+ for (const file of APP_FILES) if (existsSync(join(base, file))) await cp(join(base, file), join(fn, file));
82
+ for (const file of BUILD_FILES) {
83
+ const source = join(publicPath, "build", file);
84
+ if (existsSync(source)) await cp(source, join(fn, relative(base, publicPath), "build", file));
85
+ }
86
+ await copyDependencies(base, fn);
87
+ await writeFile(join(fn, "index.mjs"), LAUNCHER);
88
+ const vcConfig = { runtime: options.runtime ?? "nodejs22.x", handler: "index.mjs", launcherType: "Nodejs", shouldAddHelpers: false, supportsResponseStreaming: true };
89
+ await writeFile(join(fn, ".vc-config.json"), `${JSON.stringify(vcConfig, null, 2)}
90
+ `);
91
+ const config = {
92
+ version: 3,
93
+ routes: [
94
+ // The built assets' names change with their content, so they're cached for a year, as serve() does.
95
+ { src: "^/build/assets/(.*)$", headers: { "cache-control": "public, max-age=31536000, immutable" }, continue: true },
96
+ { handle: "filesystem" },
97
+ { src: "/(.*)", dest: "/index" }
98
+ ]
99
+ };
100
+ await writeFile(join(output, "config.json"), `${JSON.stringify(config, null, 2)}
101
+ `);
102
+ const functionBytes = sizeOf(fn);
103
+ const limit = options.maxFunctionBytes ?? VERCEL_FUNCTION_LIMIT;
104
+ if (functionBytes > limit) {
105
+ throw new Error(`The function is ${megabytes(functionBytes)}, larger than Vercel allows (${megabytes(limit)}): move what it doesn't need at run time to devDependencies.`);
106
+ }
107
+ const platform = options.platform ?? process.platform;
108
+ const warnings = platform === "linux" ? [] : [
109
+ `Built on ${PLATFORM_NAMES[platform] ?? platform}: the function's native packages (such as esbuild, which tsx needs) only run on this kind of machine, and Vercel's functions run on Linux. Let Vercel run the build, or build on Linux.`
110
+ ];
111
+ return { functionBytes, staticFiles: countFiles(staticFolder), warnings };
112
+ }
113
+ async function copyDependencies(base, fn) {
114
+ const manifest = JSON.parse(readFileSync(join(base, "package.json"), "utf8"));
115
+ const topLevel = /* @__PURE__ */ new Map();
116
+ const copied = /* @__PURE__ */ new Set();
117
+ const visit = async (name, from, into) => {
118
+ const found = locate(name, from);
119
+ if (found === void 0) return;
120
+ const real = realpathSync(found);
121
+ let destination = join(fn, "node_modules", name);
122
+ const top = topLevel.get(name);
123
+ if (top === void 0) topLevel.set(name, real);
124
+ else if (top !== real) destination = join(into, name);
125
+ if (copied.has(destination)) return;
126
+ copied.add(destination);
127
+ await cp(real, destination, {
128
+ recursive: true,
129
+ dereference: true,
130
+ filter: (source) => source === real || !["node_modules", ".bin", ".git"].includes(basename(source))
131
+ });
132
+ const pkg = JSON.parse(readFileSync(join(real, "package.json"), "utf8"));
133
+ for (const dependency of [...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.optionalDependencies ?? {})]) {
134
+ await visit(dependency, real, join(destination, "node_modules"));
135
+ }
136
+ };
137
+ for (const name of [...Object.keys(manifest.dependencies ?? {}), "tsx"]) await visit(name, base, join(fn, "node_modules"));
138
+ }
139
+ function locate(name, from) {
140
+ for (let dir = from; ; dir = dirname(dir)) {
141
+ const candidate = basename(dir) === "node_modules" ? join(dir, name) : join(dir, "node_modules", name);
142
+ if (existsSync(join(candidate, "package.json"))) return candidate;
143
+ if (dirname(dir) === dir) return void 0;
144
+ }
145
+ }
146
+ function sizeOf(folder) {
147
+ return readdirSync(folder, { withFileTypes: true, recursive: true }).filter((entry) => entry.isFile()).reduce((total, entry) => total + statSync(join(entry.parentPath, entry.name)).size, 0);
148
+ }
149
+ function countFiles(folder) {
150
+ return readdirSync(folder, { withFileTypes: true, recursive: true }).filter((entry) => entry.isFile()).length;
151
+ }
152
+ var megabytes = (bytes) => `${(bytes / 1024 / 1024).toFixed(1)} MB`;
153
+
154
+ // VercelServiceProvider.ts
155
+ import { ConsoleKernel } from "@orieljs/contracts";
156
+ import { ServiceProvider } from "@orieljs/support";
157
+ var megabytes2 = (bytes) => `${(bytes / 1024 / 1024).toFixed(1)} MB`;
158
+ var VercelServiceProvider = class extends ServiceProvider {
159
+ boot() {
160
+ if (!this.app.bound(ConsoleKernel)) return;
161
+ const app = this.app;
162
+ this.app.make(ConsoleKernel).command("vercel:build", async function() {
163
+ try {
164
+ const { staticFiles, functionBytes, warnings } = await buildVercelOutput(app);
165
+ const files = staticFiles === 1 ? "1 static file" : `${staticFiles} static files`;
166
+ this.info(`Wrote .vercel/output: ${files}, a function of ${megabytes2(functionBytes)}.`);
167
+ for (const warning of warnings) this.warn(warning);
168
+ return 0;
169
+ } catch (error) {
170
+ this.error(error instanceof Error ? error.message : String(error));
171
+ return 1;
172
+ }
173
+ }).purpose("Write Vercel's build output (.vercel/output) for the application");
174
+ }
175
+ };
176
+ export {
177
+ LAUNCHER,
178
+ VERCEL_FUNCTION_LIMIT,
179
+ VercelServiceProvider,
180
+ buildVercelOutput
181
+ };
182
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../build.ts","../launcher.ts","../VercelServiceProvider.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from 'node:fs'\nimport { cp, mkdir, rm, writeFile } from 'node:fs/promises'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport type { Application } from '@orieljs/contracts'\nimport { LAUNCHER } from './launcher'\n\nexport interface VercelBuildOptions {\n /** Where the build output goes, relative to the app. Default: `.vercel/output` (where Vercel looks for it). */\n output?: string\n /** The function's Node runtime. Default: `nodejs22.x`. */\n runtime?: string\n /** The largest function Vercel accepts, unzipped. Default: 250 MB. */\n maxFunctionBytes?: number\n /** The machine the build runs on, which decides the native packages copied. Default: `process.platform`. */\n platform?: string\n}\n\nexport interface VercelBuildResult {\n /** The function's size, unzipped. */\n functionBytes: number\n /** The files Vercel serves without the function. */\n staticFiles: number\n /** What the build got right but the deploy may not: a build off Linux. */\n warnings: string[]\n}\n\n/** Vercel's limit on a function's unzipped size. */\nexport const VERCEL_FUNCTION_LIMIT = 250 * 1024 * 1024\n\n/** The app's own code, copied whole: Oriel finds routes, providers and Live components by reading these folders. */\nconst APP_FOLDERS = ['app', 'bootstrap', 'config', 'routes', 'resources', 'lang', 'database']\nconst APP_FILES = ['package.json', 'tsconfig.json']\n/** What the app reads from public/build at run time: the Vite manifest (a scrambled build's class map is in bootstrap/cache). */\nconst BUILD_FILES = ['manifest.json']\nconst VITE_CONFIGS = ['vite.config.ts', 'vite.config.mts', 'vite.config.js', 'vite.config.mjs']\n\nconst isEnvFile = (path: string) => /^\\.env(\\..*)?$/.test(basename(path))\n/** A SQLite file in `database/`: local data, which the function couldn't write to anyway. */\nconst isSqliteFile = (path: string) => /\\.(sqlite3?|db)(-wal|-shm|-journal)?$/.test(basename(path))\nconst PLATFORM_NAMES: Record<string, string> = { darwin: 'macOS', win32: 'Windows' }\n\n/**\n * Writes Vercel's Build Output API v3 folder for an app: `static/` from `public/`, and one Node function holding the\n * app's code, the build files it reads at run time, its production dependencies and the launcher. `.env` files are\n * never copied: the secrets come from Vercel's environment variables.\n */\nexport async function buildVercelOutput(app: Application, options: VercelBuildOptions = {}): Promise<VercelBuildResult> {\n const base = app.basePath()\n const publicPath = app.publicPath()\n if (existsSync(join(publicPath, 'hot'))) {\n throw new Error('The Vite dev server is running (public/hot exists): stop `npm run dev` and build the assets with `npm run build` first.')\n }\n if (VITE_CONFIGS.some((file) => existsSync(join(base, file))) && !existsSync(join(publicPath, 'build/manifest.json'))) {\n throw new Error(\"The assets aren't built (public/build/manifest.json is missing): run `npm run build` first.\")\n }\n\n const output = resolve(base, options.output ?? '.vercel/output')\n await rm(output, { recursive: true, force: true })\n\n const staticFolder = join(output, 'static')\n await mkdir(staticFolder, { recursive: true })\n if (existsSync(publicPath)) {\n await cp(publicPath, staticFolder, { recursive: true, filter: (source) => basename(source) !== 'hot' && !isEnvFile(source) })\n }\n\n const fn = join(output, 'functions/index.func')\n for (const folder of APP_FOLDERS) {\n const filter = (source: string) => !isEnvFile(source) && !(folder === 'database' && isSqliteFile(source))\n if (existsSync(join(base, folder))) await cp(join(base, folder), join(fn, folder), { recursive: true, filter })\n }\n for (const file of APP_FILES) if (existsSync(join(base, file))) await cp(join(base, file), join(fn, file))\n for (const file of BUILD_FILES) {\n const source = join(publicPath, 'build', file)\n if (existsSync(source)) await cp(source, join(fn, relative(base, publicPath), 'build', file))\n }\n await copyDependencies(base, fn)\n await writeFile(join(fn, 'index.mjs'), LAUNCHER)\n const vcConfig = { runtime: options.runtime ?? 'nodejs22.x', handler: 'index.mjs', launcherType: 'Nodejs', shouldAddHelpers: false, supportsResponseStreaming: true }\n await writeFile(join(fn, '.vc-config.json'), `${JSON.stringify(vcConfig, null, 2)}\\n`)\n const config = {\n version: 3,\n routes: [\n // The built assets' names change with their content, so they're cached for a year, as serve() does.\n { src: '^/build/assets/(.*)$', headers: { 'cache-control': 'public, max-age=31536000, immutable' }, continue: true },\n { handle: 'filesystem' },\n { src: '/(.*)', dest: '/index' },\n ],\n }\n await writeFile(join(output, 'config.json'), `${JSON.stringify(config, null, 2)}\\n`)\n\n const functionBytes = sizeOf(fn)\n const limit = options.maxFunctionBytes ?? VERCEL_FUNCTION_LIMIT\n if (functionBytes > limit) {\n throw new Error(`The function is ${megabytes(functionBytes)}, larger than Vercel allows (${megabytes(limit)}): move what it doesn't need at run time to devDependencies.`)\n }\n const platform = options.platform ?? process.platform\n const warnings =\n platform === 'linux'\n ? []\n : [\n `Built on ${PLATFORM_NAMES[platform] ?? platform}: the function's native packages (such as esbuild, which tsx needs) only run on this kind of machine, and Vercel's functions run on Linux. Let Vercel run the build, or build on Linux.`,\n ]\n return { functionBytes, staticFiles: countFiles(staticFolder), warnings }\n}\n\n/**\n * Copies the app's production dependencies (its `dependencies`, and `tsx`, which the launcher uses) with everything\n * they depend on, found as Node finds them. A package needed in two versions keeps the first at the top and nests the\n * other under the package that needs it.\n */\nasync function copyDependencies(base: string, fn: string): Promise<void> {\n const manifest = JSON.parse(readFileSync(join(base, 'package.json'), 'utf8')) as { dependencies?: Record<string, string> }\n const topLevel = new Map<string, string>()\n const copied = new Set<string>()\n\n const visit = async (name: string, from: string, into: string): Promise<void> => {\n const found = locate(name, from)\n if (found === undefined) return\n const real = realpathSync(found)\n let destination = join(fn, 'node_modules', name)\n const top = topLevel.get(name)\n if (top === undefined) topLevel.set(name, real)\n else if (top !== real) destination = join(into, name)\n if (copied.has(destination)) return\n copied.add(destination)\n await cp(real, destination, {\n recursive: true,\n dereference: true,\n filter: (source) => source === real || !['node_modules', '.bin', '.git'].includes(basename(source)),\n })\n const pkg = JSON.parse(readFileSync(join(real, 'package.json'), 'utf8')) as { dependencies?: Record<string, string>; optionalDependencies?: Record<string, string> }\n for (const dependency of [...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.optionalDependencies ?? {})]) {\n await visit(dependency, real, join(destination, 'node_modules'))\n }\n }\n\n for (const name of [...Object.keys(manifest.dependencies ?? {}), 'tsx']) await visit(name, base, join(fn, 'node_modules'))\n}\n\n/** Where Node finds a package from a folder: `node_modules/<name>` in it or any folder above it. */\nfunction locate(name: string, from: string): string | undefined {\n for (let dir = from; ; dir = dirname(dir)) {\n const candidate = basename(dir) === 'node_modules' ? join(dir, name) : join(dir, 'node_modules', name)\n if (existsSync(join(candidate, 'package.json'))) return candidate\n if (dirname(dir) === dir) return undefined\n }\n}\n\nfunction sizeOf(folder: string): number {\n return readdirSync(folder, { withFileTypes: true, recursive: true })\n .filter((entry) => entry.isFile())\n .reduce((total, entry) => total + statSync(join(entry.parentPath, entry.name)).size, 0)\n}\n\nfunction countFiles(folder: string): number {\n return readdirSync(folder, { withFileTypes: true, recursive: true }).filter((entry) => entry.isFile()).length\n}\n\nconst megabytes = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(1)} MB`\n","/**\n * The function's entry (`index.mjs` in `.vercel/output/functions/index.func`): registers tsx as the app's `oriel`\n * file does, boots the app once per function instance, and hands each request to the Node request handler `serve`\n * uses. Public files never reach it: Vercel serves them from `static/`. A boot that fails answers a plain 500, logs\n * the error, and is tried again on the next request. Logs go to stderr unless `LOG_CHANNEL` is set, since the\n * function can't write files, and Vercel's proxy is trusted unless the app lists its own.\n */\nexport const LAUNCHER = `// Oriel on Vercel: boots the app once per function instance and hands it each request.\nimport { fileURLToPath } from 'node:url'\n\nlet ready\n\nasync function boot() {\n // Vercel's disk is read-only, so a log file can't open; stderr is what Vercel's log view shows.\n process.env.LOG_CHANNEL ??= 'stderr'\n if (!process.versions.bun) {\n const { register } = await import('tsx/esm/api')\n register({ tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)) })\n }\n const { createApplication } = await import('./bootstrap/app.ts')\n const { nodeRequestHandler } = await import('@orieljs/framework')\n const { ConfigRepository } = await import('@orieljs/framework/contracts')\n const app = await createApplication()\n await app.boot()\n // Every request comes through Vercel's proxy, which sets the X-Forwarded-* headers itself: trust it, unless the app\n // lists its own proxies, so that URLs keep the browser's https and ip() is the visitor's.\n const config = app.make(ConfigRepository)\n const proxies = config.get('http.trusted_proxies', [])\n if (proxies === undefined || proxies === null || proxies.length === 0) config.set('http.trusted_proxies', '*')\n return nodeRequestHandler(app, { fallbackHost: 'localhost' })\n}\n\nexport default async function handler(req, res) {\n let handle\n try {\n ready ??= boot()\n handle = await ready\n } catch (error) {\n ready = undefined\n console.error(error)\n if (!res.headersSent) {\n res.statusCode = 500\n res.setHeader('content-type', 'text/plain; charset=utf-8')\n }\n res.end('Internal Server Error')\n return\n }\n await handle(req, res)\n}\n`\n","import { ConsoleKernel, type CommandContext } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { buildVercelOutput } from './build'\n\nconst megabytes = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(1)} MB`\n\n/** Registers `oriel vercel:build`, which writes Vercel's build output for the app. */\nexport class VercelServiceProvider extends ServiceProvider {\n override boot(): void {\n if (!this.app.bound(ConsoleKernel)) return\n const app = this.app\n this.app\n .make(ConsoleKernel)\n .command('vercel:build', async function (this: CommandContext) {\n try {\n const { staticFiles, functionBytes, warnings } = await buildVercelOutput(app)\n const files = staticFiles === 1 ? '1 static file' : `${staticFiles} static files`\n this.info(`Wrote .vercel/output: ${files}, a function of ${megabytes(functionBytes)}.`)\n for (const warning of warnings) this.warn(warning)\n return 0\n } catch (error) {\n this.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n })\n .purpose(\"Write Vercel's build output (.vercel/output) for the application\")\n }\n}\n"],"mappings":";AAAA,SAAS,YAAY,aAAa,cAAc,cAAc,gBAAgB;AAC9E,SAAS,IAAI,OAAO,IAAI,iBAAiB;AACzC,SAAS,UAAU,SAAS,MAAM,UAAU,eAAe;;;ACKpD,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ADoBjB,IAAM,wBAAwB,MAAM,OAAO;AAGlD,IAAM,cAAc,CAAC,OAAO,aAAa,UAAU,UAAU,aAAa,QAAQ,UAAU;AAC5F,IAAM,YAAY,CAAC,gBAAgB,eAAe;AAElD,IAA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AM,QAAQ,gBAAgB,IAAI,kBAAkB,GAAG,WAAW;AAClE,aAAK,KAAK,yBAAyB,KAAK,mBAAmBA,WAAU,aAAa,CAAC,GAAG;AACtF,mBAAW,WAAW,SAAU,MAAK,KAAK,OAAO;AACjD,eAAO;AAAA,MACT,SAAS,OAAO;AACd,aAAK,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AACjE,eAAO;AAAA,MACT;AAAA,IACF,CAAC,EACA,QAAQ,kEAAkE;AAAA,EAC/E;AACF;","names":["megabytes"]}
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@orieljs/vercel",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.11",
4
+ "description": "Deploy an Oriel app to Vercel: oriel vercel:build writes Vercel's build output, with the app as a Node function.",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "homepage": "https://orieljs.vercel.app",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/orieljs/framework.git",
12
+ "directory": "src/Oriel/Vercel"
13
+ },
14
+ "engines": {
15
+ "node": ">=22"
16
+ },
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ }
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "LICENSE",
30
+ "NOTICE",
31
+ "TRADEMARKS.md"
32
+ ],
33
+ "dependencies": {
34
+ "@orieljs/contracts": "0.1.0-alpha.11",
35
+ "@orieljs/support": "0.1.0-alpha.11"
36
+ },
37
+ "scripts": {
38
+ "build": "tsup && node ../../../scripts/copy-license.mjs"
39
+ }
6
40
  }