Skip to content
Snippets Groups Projects
Commit 6d48aa00 authored by Martin Koerwien's avatar Martin Koerwien
Browse files

fix: docs and disable omitting workspace name

parent 1de15ef0
Branches master
No related tags found
No related merge requests found
...@@ -190,13 +190,15 @@ Below is an outline of steps to do when modifying the schema: ...@@ -190,13 +190,15 @@ Below is an outline of steps to do when modifying the schema:
2. Add/modify/remove the keys as appropriate, following the same pattern as the other key schemas whenever possible. Consider marking new keys as optional by appending `.default(DEFAULT_VALUE)`. This helps reducing the amount of mandatory keys 2. Add/modify/remove the keys as appropriate, following the same pattern as the other key schemas whenever possible. Consider marking new keys as optional by appending `.default(DEFAULT_VALUE)`. This helps reducing the amount of mandatory keys
3. When committing the changes, don't forget to mark the changes as a breaking change as per the commit message guidelines. 3. When committing the changes, don't forget to mark the changes as a breaking change as per the commit message guidelines.
### Generate a runtime-config file ### Handling runtime-config and user-config files in apps
The Zod configuration is the single point of truth for the environment variable structure. There is a script which The Zod configuration is the single point of truth for the environment variable structure. This script:
can generate runtime-config.js files from the Zod schema and integrate it into the config folder of a Vue app:
``` ```
npm run create-runtime-config <workspace-name> npm run check-config <workspace-name>
``` ```
If `<workspace-name>` is omitted, runtime-config.js files will be created in all app workspaces. first validates the file config/user-config.sample.js against the Zod schema
and prints out all issues. Second, it checks any issues of config/runtime-config.js
and if there are any, offers to generate a correct version of that file that
overwrites the existing one.
...@@ -42,10 +42,11 @@ export function createRuntimeConfig(workspaceName) { ...@@ -42,10 +42,11 @@ export function createRuntimeConfig(workspaceName) {
if (workspaceName) { if (workspaceName) {
pathByWorkspaceName(workspaceName).then(filePath => createSingleRuntimeConfig(filePath, configObject, config)); pathByWorkspaceName(workspaceName).then(filePath => createSingleRuntimeConfig(filePath, configObject, config));
} else { } else {
doForApps((file: string, stats: Stats, folder: string) => { console.log("Please provide workspace name!")
// createSingleRuntimeConfig(`${folder}/${file}`, configObject, config) // doForApps((file: string, stats: Stats, folder: string) => {
writeRuntimeConfig(`${folder}/${file}/config/runtime-config.js`, config); // // createSingleRuntimeConfig(`${folder}/${file}`, configObject, config)
}); // writeRuntimeConfig(`${folder}/${file}/config/runtime-config.js`, config);
// });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment