Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/void/src/codegen/env-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type EnvTypesResult = {
* @param outDir Absolute path to the project's `.void/` directory.
*/
export function generateEnvTypes(envFileAbs: string, outDir: string): EnvTypesResult {
const importPath = relative(outDir, envFileAbs).replace(/\\/g, '/');
const importPath = relative(outDir, envFileAbs);
const lines: Array<string> = [];

lines.push('// Auto-generated by void — do not edit');
Expand Down
4 changes: 2 additions & 2 deletions packages/void/src/codegen/project-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export function createProjectTsconfig(
const isDir = existsSync(pathsConfig.schemaDir) && !existsSync(pathsConfig.schemaFile);

// Paths are relative to .void/ (where this tsconfig lives), so use ../
const schemaRel = relative(outDir, pathsConfig.schemaDir).replace(/\\/g, '/');
const schemaFileRel = relative(outDir, pathsConfig.schemaFile).replace(/\\/g, '/');
const schemaRel = relative(outDir, pathsConfig.schemaDir);
const schemaFileRel = relative(outDir, pathsConfig.schemaFile);
paths['@schema'] = [isDir ? `${schemaRel}/index.ts` : schemaFileRel];
paths['@schema/*'] = [`${schemaRel}/*`];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/void/src/drizzle/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ export function writeDrizzleConfig(
? {
dialect: 'postgresql',
schema: schemaSpecifier(schema, root),
out: `./${relative(root, paths.migrationsDir).replace(/\\/g, '/')}`,
out: `./${relative(root, paths.migrationsDir)}`,
migrations: { prefix: 'timestamp' },
dbCredentials: { url: dbPath },
}
: {
dialect: 'sqlite',
schema: schemaSpecifier(schema, root),
out: `./${relative(root, paths.migrationsDir).replace(/\\/g, '/')}`,
out: `./${relative(root, paths.migrationsDir)}`,
migrations: { prefix: 'timestamp' },
dbCredentials: { url: dbPath },
};
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/drizzle/discover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export function schemaSpecifier(location: SchemaLocation, root?: string): string
if (!root) {
return location.type === 'file' ? './db/schema.ts' : './db/schema/*.ts';
}
const rel = relative(root, location.path).replace(/\\/g, '/');
const rel = relative(root, location.path);
return location.type === 'file' ? `./${rel}` : `./${rel}/*.ts`;
}
2 changes: 1 addition & 1 deletion packages/void/src/ssr/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function resolveSingleEntry(
): ResolvedEntry | null {
const matches = entries
.map((entryName) => ({
relativePath: relative(root, join(paths.ssrDir, entryName)).replace(/\\/g, '/'),
relativePath: relative(root, join(paths.ssrDir, entryName)),
absolutePath: join(paths.ssrDir, entryName),
}))
.filter((entry) => existsSync(entry.absolutePath));
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/sveltekit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function resolveTsconfigEntry(baseDir: string, entry: string): string {
}

function relativeFrom(fromDir: string, target: string): string {
const value = relative(fromDir, target).replace(/\\/g, '/');
const value = relative(fromDir, target);
return value.startsWith('.') ? value : `./${value}`;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/void/test/unit/prerender.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('collectPrerenderWorkerModules', () => {

expect(
modules.map(({ path, type }) => ({
path: relative(workerDir, path).replace(/\\/g, '/'),
path: relative(workerDir, path),
type,
})),
).toEqual([
Expand Down