storyloco 1.9.0 → 1.9.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/package.json +1 -1
- package/packages/vite/dist/index.d.ts +1 -1
- package/packages/vite/dist/index.js +1 -1
- package/packages/vite/dist/schema.plugin.js +5 -4
- /package/packages/vite/dist/{parser.d.ts → custom_fields_parser.d.ts} +0 -0
- /package/packages/vite/dist/{parser.js → custom_fields_parser.js} +0 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as storyblok_schema } from
|
|
1
|
+
export { default as storyblok_schema } from "./schema.plugin.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Reexport your entry components here
|
|
2
|
-
export { default as storyblok_schema } from
|
|
2
|
+
export { default as storyblok_schema } from "./schema.plugin.js";
|
|
@@ -85,13 +85,13 @@ export default function storyblok_schema({ output_path, interval_ms, storyblok_p
|
|
|
85
85
|
const env = loadEnv(server.config.mode, process.cwd(), "");
|
|
86
86
|
const x = await exec();
|
|
87
87
|
interval_ms = interval_ms ?? 60000; // 1 minute
|
|
88
|
-
// ensure output_path
|
|
89
|
-
output_path = output_path?.replace(/\/?$/, "
|
|
88
|
+
// ensure output_path does not end with a slash
|
|
89
|
+
output_path = output_path?.replace(/\/?$/, "") ?? "src/lib";
|
|
90
90
|
storyblok_personal_access_token =
|
|
91
91
|
storyblok_personal_access_token ?? env.STORYBLOK_PERSONAL_ACCESS_TOKEN;
|
|
92
92
|
storyblok_space_id = storyblok_space_id ?? env.STORYBLOK_SPACE_ID;
|
|
93
93
|
const components_file = path.join(".svelte-kit/storyblok/components", storyblok_space_id, "components.json");
|
|
94
|
-
const schema_ts_file = path.join(
|
|
94
|
+
const schema_ts_file = path.join(output_path, filename ?? "components.schema.ts");
|
|
95
95
|
const seconds = interval_ms / 1000;
|
|
96
96
|
logger.info(`Regenerating Storyblok component types every ${seconds} ${seconds === 1 ? "second" : "seconds"}`);
|
|
97
97
|
generate();
|
|
@@ -126,10 +126,11 @@ export default function storyblok_schema({ output_path, interval_ms, storyblok_p
|
|
|
126
126
|
await mkdir(path.dirname(components_file), { recursive: true });
|
|
127
127
|
// Write the data to the components file
|
|
128
128
|
await writeFile(components_file, JSON.stringify(new_components, null, 2));
|
|
129
|
+
const here = (str) => path.join("node_modules/storyloco/packages/vite/src/lib", str);
|
|
129
130
|
// Generate types
|
|
130
131
|
logger.start("Generating TypeScript definitions...");
|
|
131
132
|
await $ `chmod u+w ${schema_ts_file}`.quiet().nothrow();
|
|
132
|
-
await $ `${x} storyblok ts generate -s ${storyblok_space_id} -p .svelte-kit/storyblok --compiler-options
|
|
133
|
+
await $ `${x} storyblok@4.2.0 ts generate -s ${storyblok_space_id} -p .svelte-kit/storyblok --compiler-options ${here("compiler_options.js")} --custom-fields-parser ${here("custom_fields_parser.js")} --strict`;
|
|
133
134
|
logger.succeed("TypeScript definitions generated.");
|
|
134
135
|
// Get generated files
|
|
135
136
|
const component_types = await readFile(`.svelte-kit/storyblok/types/${storyblok_space_id}/storyblok-components.d.ts`, "utf-8");
|
|
File without changes
|
|
File without changes
|