diff --git a/packages/zero-schema/src/build-schema.ts b/packages/zero-schema/src/build-schema.ts index bd74b228b..495c7964c 100644 --- a/packages/zero-schema/src/build-schema.ts +++ b/packages/zero-schema/src/build-schema.ts @@ -18,11 +18,15 @@ async function main() { const dirname = path.dirname(fileURLToPath(import.meta.url)); const absoluteConfigPath = path.resolve(config.schema.path); - const relativePath = path.join( + let relativePath = path.join( path.relative(dirname, path.dirname(absoluteConfigPath)), path.basename(absoluteConfigPath), ); + // tsImport doesn't expect to receive slashes in the Windows format when running + // on Windows. They need to be converted to *nix format. + relativePath = relativePath.replace(/\\/g, "/"); + try { const module = await tsImport(relativePath, import.meta.url); await writeFile(config.schema.output, await stringifySchema(module)); diff --git a/packages/zero/src/zero-cache-dev.ts b/packages/zero/src/zero-cache-dev.ts index 5293d54b5..3d839748e 100644 --- a/packages/zero/src/zero-cache-dev.ts +++ b/packages/zero/src/zero-cache-dev.ts @@ -84,6 +84,7 @@ async function main() { log(`Running ${buildSchemaScript}.`); schemaProcess = spawn(buildSchemaScript, buildSchemaArgs ?? [], { stdio: 'inherit', + shell: true, }); schemaProcess.on('exit', (code: number) => { @@ -94,6 +95,7 @@ async function main() { ); zeroCacheProcess = spawn(zeroCacheScript, zeroCacheArgs || [], { stdio: 'inherit', + shell: true, }); zeroCacheProcess.on('exit', () => { logError(`${zeroCacheScript} exited. Exiting.`);