@wwchen/stack 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/user-create.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function userCreate(cli, args) {
|
|
|
27
27
|
const user = await users.add(email, admin ? "admin" : "user");
|
|
28
28
|
cli.log(preview
|
|
29
29
|
? `created ${user.email}${admin ? " as an admin" : ""} on ${PREVIEW}: sign in on a preview with a magic link. \`stack neon reset-preview\` drops it.`
|
|
30
|
-
: `created ${user.email}${admin ? " as an admin" : ""}. They sign in
|
|
30
|
+
: `created ${user.email}${admin ? " as an admin" : ""}. They can sign in now.`);
|
|
31
31
|
return 0;
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
package/dist/env/define-env.d.ts
CHANGED
|
@@ -30,9 +30,7 @@ export interface EnvSpec<S extends z.ZodRawShape> {
|
|
|
30
30
|
* build is not a boot: production requirements, groups and a missing `DATABASE_URL` are not
|
|
31
31
|
* enforced (a placeholder stands in), but defaults still apply. With `NODE_ENV=production`,
|
|
32
32
|
* `SKIP_ENV_VALIDATION` is ignored outside the build phase.
|
|
33
|
-
* - When the schema has `APP_URL` and it is unset, it is derived on Vercel: from
|
|
34
|
-
* VERCEL_PROJECT_PRODUCTION_URL in production, from VERCEL_BRANCH_URL / VERCEL_URL on a preview,
|
|
35
|
-
* so apps that extend the stack schema get it for free.
|
|
33
|
+
* - When the schema has `APP_URL` and it is unset, it is derived on Vercel: from VERCEL_PROJECT_PRODUCTION_URL in production, from VERCEL_BRANCH_URL / VERCEL_URL on a preview, so apps that extend the stack schema get it for free.
|
|
36
34
|
* - Throws one `ConfigError` listing every problem.
|
|
37
35
|
*/
|
|
38
36
|
export declare function defineEnv<S extends z.ZodRawShape>(spec: EnvSpec<S>, rawSource?: EnvSource): z.infer<z.ZodObject<S>>;
|
package/dist/env/define-env.js
CHANGED
|
@@ -49,17 +49,10 @@ function resolve(name, source, problems) {
|
|
|
49
49
|
return value;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* On Vercel an unset APP_URL is derived from the platform's own hostnames, so a new project boots
|
|
53
|
-
* before anyone knows its domain. Deliberately not a schema default: the derived value is placed in
|
|
54
|
-
* the source, so it satisfies the production requirement on Vercel and nowhere else. An explicit
|
|
55
|
-
* APP_URL (or APP_URL_FILE) always wins.
|
|
52
|
+
* On Vercel an unset APP_URL is derived from the platform's own hostnames, so a new project boots before anyone knows its domain. Deliberately not a schema default: the derived value is placed in the source, so it satisfies the production requirement on Vercel and nowhere else. An explicit APP_URL (or APP_URL_FILE) always wins.
|
|
56
53
|
*
|
|
57
|
-
* - Production: `VERCEL_PROJECT_PRODUCTION_URL`, the project's production domain (its shortest
|
|
58
|
-
*
|
|
59
|
-
* the address people use.
|
|
60
|
-
* - Preview: the branch alias first, the deployment URL only without one. Deployment Protection's
|
|
61
|
-
* Vercel sign-in is per hostname, so a magic link pointing at the other hostname makes the owner
|
|
62
|
-
* sign in to Vercel again first.
|
|
54
|
+
* - Production: `VERCEL_PROJECT_PRODUCTION_URL`, the project's production domain (its shortest custom domain, else its `vercel.app` one). Never `VERCEL_URL`, which names one deployment, not the address people use.
|
|
55
|
+
* - Preview: the branch alias first, the deployment URL only without one. Deployment Protection's Vercel sign-in is per hostname, so a magic link pointing at the other hostname makes the owner sign in to Vercel again first.
|
|
63
56
|
*/
|
|
64
57
|
function withVercelAppUrl(source) {
|
|
65
58
|
if (!isBlank(source.APP_URL) || !isBlank(source.APP_URL_FILE))
|
|
@@ -81,9 +74,7 @@ function withVercelAppUrl(source) {
|
|
|
81
74
|
* build is not a boot: production requirements, groups and a missing `DATABASE_URL` are not
|
|
82
75
|
* enforced (a placeholder stands in), but defaults still apply. With `NODE_ENV=production`,
|
|
83
76
|
* `SKIP_ENV_VALIDATION` is ignored outside the build phase.
|
|
84
|
-
* - When the schema has `APP_URL` and it is unset, it is derived on Vercel: from
|
|
85
|
-
* VERCEL_PROJECT_PRODUCTION_URL in production, from VERCEL_BRANCH_URL / VERCEL_URL on a preview,
|
|
86
|
-
* so apps that extend the stack schema get it for free.
|
|
77
|
+
* - When the schema has `APP_URL` and it is unset, it is derived on Vercel: from VERCEL_PROJECT_PRODUCTION_URL in production, from VERCEL_BRANCH_URL / VERCEL_URL on a preview, so apps that extend the stack schema get it for free.
|
|
87
78
|
* - Throws one `ConfigError` listing every problem.
|
|
88
79
|
*/
|
|
89
80
|
export function defineEnv(spec, rawSource = process.env) {
|