create-rsc-kit 0.21.3 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates.d.ts +1 -1
- package/dist/templates.js +7 -7
- package/package.json +1 -1
package/dist/templates.d.ts
CHANGED
|
@@ -165,4 +165,4 @@ export declare function backendEnvExample(backend: string): string;
|
|
|
165
165
|
*/
|
|
166
166
|
export declare function backendStep(go: boolean): string;
|
|
167
167
|
/** The example beside it - the one file that is committed. */
|
|
168
|
-
export declare const envExample = "# Copy to .env and fill in. Server variables never reach the browser;\n# a browser-readable one starts with
|
|
168
|
+
export declare const envExample = "# Copy to .env and fill in. Server variables never reach the browser;\n# a browser-readable one starts with VITE_. The schema is src/env.ts.\n#\n# Not NODE_ENV. Vite sets it - development under `vite`, production under\n# `vite build` - and a value written here overrides that: NODE_ENV=development\n# in .env makes a production build emit React's development JSX runtime,\n# which the production server does not have, and every page fails to render.\n# DATABASE_URL=\n# SESSION_SECRET=\n# VITE_SITE_URL=\n";
|
package/dist/templates.js
CHANGED
|
@@ -901,10 +901,10 @@ import { createEnv } from '@t3-oss/env-core'
|
|
|
901
901
|
// or wrong - before anything runs, not as an undefined three calls later.
|
|
902
902
|
//
|
|
903
903
|
// Server variables stay on the server. A variable the browser may read has
|
|
904
|
-
// to start with
|
|
904
|
+
// to start with VITE_. Add a variable: one line in the schema, and every
|
|
905
905
|
// reader is typed.
|
|
906
906
|
//
|
|
907
|
-
// Import this from server code. A client component reads its
|
|
907
|
+
// Import this from server code. A client component reads its VITE_ value
|
|
908
908
|
// from import.meta.env directly: importing this file there ships the
|
|
909
909
|
// validator to the browser with it - about 20 kB gzipped for Zod, to read one
|
|
910
910
|
// string. The value is still checked here, when the server starts.
|
|
@@ -916,11 +916,11 @@ export const env = createEnv({
|
|
|
916
916
|
// DATABASE_URL: ${lib.url},
|
|
917
917
|
// SESSION_SECRET: ${lib.str},
|
|
918
918
|
},
|
|
919
|
-
clientPrefix: '
|
|
919
|
+
clientPrefix: 'VITE_',
|
|
920
920
|
client: {
|
|
921
|
-
//
|
|
921
|
+
// VITE_SITE_URL: ${lib.url},
|
|
922
922
|
},
|
|
923
|
-
// process is the server's. import.meta.env is merged in for the
|
|
923
|
+
// process is the server's. import.meta.env is merged in for the VITE_
|
|
924
924
|
// ones, which Vite fills - and so the file does not throw if a client
|
|
925
925
|
// component imports it anyway.
|
|
926
926
|
runtimeEnv: { ...processEnv, ...import.meta.env },
|
|
@@ -1005,7 +1005,7 @@ export function backendStep(go) {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
/** The example beside it - the one file that is committed. */
|
|
1007
1007
|
export const envExample = `# Copy to .env and fill in. Server variables never reach the browser;
|
|
1008
|
-
# a browser-readable one starts with
|
|
1008
|
+
# a browser-readable one starts with VITE_. The schema is src/env.ts.
|
|
1009
1009
|
#
|
|
1010
1010
|
# Not NODE_ENV. Vite sets it - development under \`vite\`, production under
|
|
1011
1011
|
# \`vite build\` - and a value written here overrides that: NODE_ENV=development
|
|
@@ -1013,5 +1013,5 @@ export const envExample = `# Copy to .env and fill in. Server variables never re
|
|
|
1013
1013
|
# which the production server does not have, and every page fails to render.
|
|
1014
1014
|
# DATABASE_URL=
|
|
1015
1015
|
# SESSION_SECRET=
|
|
1016
|
-
#
|
|
1016
|
+
# VITE_SITE_URL=
|
|
1017
1017
|
`;
|