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
15 changes: 15 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@
"no-prototype-builtins": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "node:path",
"message": "Use `pathe` instead. It re-exports the same API but always emits forward slashes, which avoids cross-platform breakage when paths are embedded in module specifiers, generated source, or compared against Vite's normalized watcher events. If you genuinely need format-specific behavior, import `node:path/win32` or `node:path/posix` explicitly."
},
{
"name": "path",
"message": "Use `pathe` instead of the unprefixed `path` import (and prefer `node:path/win32` / `node:path/posix` for explicit format-specific behavior)."
Comment on lines +172 to +176

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure why the message is different for both 🤷‍♂️

}
]
}
],
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
Expand Down
1 change: 1 addition & 0 deletions packages/create-void/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"devDependencies": {
"@clack/prompts": "catalog:",
"@types/node": "catalog:",
"pathe": "catalog:",
"picocolors": "^1.1.1",
"tsdown": "catalog:"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-void/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node

import { existsSync, mkdirSync, readdirSync, writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
import * as p from '@clack/prompts';
import { resolve } from 'pathe';
import pc from 'picocolors';
import { detectPM, pmExec, pmInstall, run } from './pm.ts';

Expand Down
1 change: 1 addition & 0 deletions packages/create-void/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
'fast-string-width',
'fast-wrap-ansi',
'sisteransi',
'pathe',
'picocolors',
],
},
Expand Down
1 change: 1 addition & 0 deletions packages/md/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"markdown-it-attrs": "^4.3.1",
"markdown-it-container": "^4.0.0",
"markdown-it-emoji": "^3.0.0",
"pathe": "catalog:",
"shiki": "^4.0.2",
"tinyglobby": "^0.2.16"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/md/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHash } from 'node:crypto';
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
import { dirname, join, relative, resolve } from 'node:path';
import { dirname, join, relative, resolve } from 'pathe';
import { glob } from 'tinyglobby';
import { normalizePath, type Plugin, type ResolvedConfig, type ViteDevServer } from 'vite';
import { generateMdTypes } from './codegen/md-types.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/md/src/plugins/snippet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync, readFileSync, statSync } from 'node:fs';
import { resolve, dirname } from 'node:path';
import type MarkdownExit from 'markdown-exit';
import type { RuleBlock, Token } from 'markdown-exit';
import { resolve, dirname } from 'pathe';

const rawPathRegexp =
/^(.+?(?:(?:\.([a-z0-9]+))?))(?:(#[\w-]+))?(?: ?(?:\{(\d+(?:[,-]\d+)*)? ?(\S+)? ?(\S+)?}))? ?(?:\[(.+)\])?$/;
Expand Down
2 changes: 1 addition & 1 deletion packages/md/test/integration/markdown-blog.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execSync } from 'node:child_process';
import { join } from 'node:path';
import spawn from 'cross-spawn';
import { join } from 'pathe';
import { chromium, type Browser, type Page } from 'playwright';
import { describe, expect, it, beforeAll, afterAll } from 'vitest';
import { getPort, waitForServer, killChild } from '../../../../test/integration-helpers.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/md/test/unit/md-types.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { join } from 'pathe';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { generateMdTypes } from '../../src/codegen/md-types.ts';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/plugin-islands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync } from 'node:fs';
import { dirname, resolve, relative } from 'node:path';
import { dirname, resolve, relative } from 'pathe';
import { normalizePath, type Plugin, type ResolvedConfig } from 'vite';
import { scanPages, resolveEffectiveLayoutChain } from 'void/pages';
import type { PageScanResult } from 'void/pages';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/plugin-pages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readdirSync } from 'node:fs';
import { dirname } from 'node:path';
import { dirname } from 'pathe';
import type { Plugin, ResolvedConfig } from 'vite';
import { resolveStaticPageDataBuildOptions, scanPages } from 'void/pages';
import type { PageScanResult, StaticPageDataBuildOptions } from 'void/pages';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/test/integration/react-pages-client.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'node:child_process';
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import spawn from 'cross-spawn';
import { join } from 'pathe';
import { chromium, type Browser, type Page } from 'playwright';
import { describe, expect, it, beforeAll, afterAll } from 'vitest';
import { getPort, waitForServer, killChild } from '../../../../test/integration-helpers.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/test/unit/plugin-islands.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mkdirSync, writeFileSync, rmSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import { describe, expect, it, beforeEach, afterEach } from 'vitest';
import { islandsPlugin } from '../../src/plugin-islands.ts';

Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/plugin-islands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync } from 'node:fs';
import { dirname, resolve, relative } from 'node:path';
import { dirname, resolve, relative } from 'pathe';
import { normalizePath, type Plugin, type ResolvedConfig } from 'vite';
import { scanPages, resolveEffectiveLayoutChain } from 'void/pages';
import type { PageScanResult } from 'void/pages';
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/plugin-pages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readdirSync } from 'node:fs';
import { dirname } from 'node:path';
import { dirname } from 'pathe';
import type { Plugin, ResolvedConfig } from 'vite';
import { resolveStaticPageDataBuildOptions, scanPages } from 'void/pages';
import type { PageScanResult, StaticPageDataBuildOptions } from 'void/pages';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'node:child_process';
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import spawn from 'cross-spawn';
import { join } from 'pathe';
import { chromium, type Browser, type Page } from 'playwright';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import { getPort, waitForServer, killChild } from '../../../../test/integration-helpers.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/test/unit/plugin-islands.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mkdirSync, writeFileSync, rmSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import { describe, expect, it, beforeEach, afterEach } from 'vitest';
import { islandsPlugin } from '../../src/plugin-islands.ts';

Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/plugin-islands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync } from 'node:fs';
import { dirname, resolve, relative } from 'node:path';
import { dirname, resolve, relative } from 'pathe';
import { normalizePath, type Plugin, type ResolvedConfig } from 'vite';
import { scanPages, resolveEffectiveLayoutChain } from 'void/pages';
import type { PageScanResult } from 'void/pages';
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/plugin-pages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readdirSync } from 'node:fs';
import { dirname } from 'node:path';
import { dirname } from 'pathe';
import type { Plugin, ResolvedConfig } from 'vite';
import { resolveStaticPageDataBuildOptions, scanPages } from 'void/pages';
import type { PageScanResult, StaticPageDataBuildOptions } from 'void/pages';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'node:child_process';
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import spawn from 'cross-spawn';
import { join } from 'pathe';
import { chromium, type Browser, type Page } from 'playwright';
import { describe, expect, it, beforeAll, afterAll } from 'vitest';
import { getPort, waitForServer, killChild } from '../../../../test/integration-helpers.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/test/unit/plugin-islands.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mkdirSync, writeFileSync, rmSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import { describe, expect, it, beforeEach, afterEach } from 'vitest';
import { islandsPlugin } from '../../src/plugin-islands.ts';

Expand Down
2 changes: 1 addition & 1 deletion packages/void/scripts/sync-skill-docs.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'pathe';
import { globSync } from 'tinyglobby';

const scriptsDir = dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/auth/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { join } from 'pathe';
import type { VoidAuthConfig } from '../runtime/auth.ts';

const AUTH_CONFIG_CANDIDATES = [
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/auth/node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join } from 'node:path';
import { join } from 'pathe';
import { loadEnv } from 'vite';
import { readConfig } from '../config.ts';
import { getMiniflareDatabasePath } from '../migrations/runner.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/agents.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { join } from 'pathe';

export function getPackageDir(): string {
let dir = join(fileURLToPath(import.meta.url), '..');
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { Entry } from '@napi-rs/keyring';
import { join } from 'pathe';
import { pc } from './output.ts';
import { isVoidInternalStaging } from './project.ts';

Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node

import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { log } from '@clack/prompts';
import { join } from 'pathe';
import { getPackageDir } from './agents.ts';
import { parseDeployArgs } from './args.ts';
import { authSubcommands, parseAuthArgs } from './auth-args.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/db.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { execFileSync } from 'node:child_process';
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from 'node:fs';
import { extname, join, relative, resolve } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { intro, outro, log } from '@clack/prompts';
import { extname, join, relative, resolve } from 'pathe';
import { readConfig, getDatabaseDialect, type DatabaseDialect } from '../config.ts';
import {
collectMigrations,
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
symlinkSync,
} from 'node:fs';
import { tmpdir } from 'node:os';
import { join, relative, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { join, relative, resolve } from 'pathe';

const drizzleKitBin = join(fileURLToPath(import.meta.resolve('drizzle-kit')), '..', 'bin.cjs');
const deployDriftCheckDir = join('.void', 'deploy-drift-check');
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/env-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* Void helpers.
*/
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { log, outro } from '@clack/prompts';
import { join } from 'pathe';
import { findEnvFile } from '../codegen/env-types.ts';
import { loadUserEnvFile } from '../host/load-user-env.ts';
import type { StandardSchemaV1 } from '../standard-schema.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/env-scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* wrong guess only costs the user a single-line edit.
*/
import { existsSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import { expandDotenv, parseDotenvFile as sharedParseDotenvFile } from '../shared/dotenv.ts';

/** Dotenv files we harvest keys from, in trust order (first wins per key). */
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/env-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Used by both `void deploy` (hard error on missing prod env) and
* `void env check` (CI/pre-push validation).
*/
import { join } from 'node:path';
import { join } from 'pathe';
import { findEnvFile } from '../codegen/env-types.ts';
import { loadUserEnvFile } from '../host/load-user-env.ts';
import { voidWarn } from '../log.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mkdirSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { intro, outro, log, note } from '@clack/prompts';
import { join } from 'pathe';
import { findEnvFile, generateEnvTypes } from '../codegen/env-types.ts';
import { getToken } from './auth.ts';
import { PlatformClient } from './client.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
unlinkSync,
writeFileSync,
} from 'node:fs';
import { join, dirname, relative } from 'node:path';
import { fileURLToPath } from 'node:url';
import { intro, outro, log, select, isCancel, cancel } from '@clack/prompts';
import { join, dirname, relative } from 'pathe';
import { ensureProjectTsconfig } from '../codegen/project-tsconfig.ts';
import { readConfig, getDatabaseDialect } from '../config.ts';
import { writeDrizzleConfig } from '../drizzle/config.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/headers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import {
convertFallbacksConfig,
convertHeadersConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/help.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { note, outro } from '@clack/prompts';
import { join } from 'pathe';
import { getPackageDir } from './agents.ts';
import { asciiArts } from './ascii.ts';
import { categoryTitle, helpLine, pc, sectionTitle } from './output.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
unlinkSync,
} from 'node:fs';
import { createRequire } from 'node:module';
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { parseArgs } from 'node:util';
import { intro, outro, log, confirm, isCancel, cancel, note, select } from '@clack/prompts';
import { parse, type ParseError } from 'jsonc-parser';
import MagicString from 'magic-string';
import { basename, dirname, isAbsolute, join, relative, resolve } from 'pathe';
import { createProjectTsconfig, ensureProjectTsconfig } from '../codegen/project-tsconfig.ts';
import { getDatabaseDialect, readConfig, type DatabaseDialect } from '../config.ts';
import { writeDrizzleConfig } from '../drizzle/config.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/mcp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync, readdirSync, readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { createInterface } from 'node:readline';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'pathe';
import { getToken } from './auth.ts';
import { PlatformClient } from './client.ts';
import { writeProjectConfig } from './project.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/package.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync, readFileSync, readdirSync } from 'node:fs';
import { extname, join, relative } from 'node:path';
import { hash as blake3hash } from 'blake3-jit';
import ignore from 'ignore';
import { extname, join, relative } from 'pathe';
import type { InferredBindings } from '../inference/walk.ts';
import type { MigrationFile } from '../migrations/validate.ts';
import type { WebSocketRouteDefinition } from '../router/websocket.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/preset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { join, resolve } from 'pathe';
import { hasSsrEntry } from '../ssr/entry.ts';

/** Build output conventions for a known SSG (static site generator). */
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFileSync, writeFileSync, mkdirSync, rmSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { join, dirname } from 'pathe';

export interface ProjectConfig {
projectId: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/resolve-project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import type { ProjectResponse } from './client.ts';
import type { ProjectConfig } from './project.ts';

Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
readlinkSync,
symlinkSync,
} from 'node:fs';
import { join, relative } from 'node:path';
import { log } from '@clack/prompts';
import { join, relative } from 'pathe';
import { detectAgents, getPackageDir, type AgentConfig } from './agents.ts';

interface SkillInfo {
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/wrangler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
import { join } from 'node:path';
import { parse, type ParseError } from 'jsonc-parser';
import { join } from 'pathe';
import type { VoidConfig } from '../config.ts';
import type { InferredBindings } from '../inference/walk.ts';
import type { WebSocketRouteDefinition } from '../router/websocket.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/cli/yarn-pnp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readdirSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { dirname, join } from 'pathe';

/**
* Read PnP runtime files at a single directory without walking
Expand Down
2 changes: 1 addition & 1 deletion packages/void/src/codegen/db-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mkdirSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { join } from 'pathe';
import type { SchemaLocation } from '../drizzle/discover.ts';

export const DRIZZLE_OPERATORS =
Expand Down
Loading