Skip to content

Commit 65b250e

Browse files
committed
chore(sv-testing): remove deprecated exports from public API; docs use eslint.config.js path
Made-with: Cursor
1 parent aeaf437 commit 65b250e

3 files changed

Lines changed: 7 additions & 43 deletions

File tree

documentation/docs/50-api/20-sv-utils.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Return `false` from any transform callback to abort - the original content is re
137137
import { transforms } from '@sveltejs/sv-utils';
138138

139139
sv.file(
140-
file.eslintConfig,
140+
'eslint.config.js',
141141
transforms.script(({ ast, js }) => {
142142
const { value: existing } = js.exports.createDefault(ast, { fallback: myConfig });
143143
if (existing !== myConfig) {

packages/sv/api-surface-testing.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,13 @@
33
<!-- auto-generated by scripts/generate-api-surface.js - do not edit -->
44

55
```ts
6-
declare function addPnpmBuildDependencies(
7-
cwd: string,
8-
packageManager: AgentName | null | undefined,
9-
allowedPackages: string[]
10-
): Promise<void>;
116
type ProjectVariant = 'kit-js' | 'kit-ts' | 'vite-js' | 'vite-ts';
127
declare const variants: ProjectVariant[];
138
type CreateProject = (options: {
149
testId: string;
1510
variant: ProjectVariant;
1611
clean?: boolean;
1712
}) => string;
18-
type SetupOptions = {
19-
cwd: string;
20-
variants: readonly ProjectVariant[];
21-
clean?: boolean;
22-
};
23-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
24-
declare function setup({ cwd, clean, variants }: SetupOptions): {
25-
templatesDir: string;
26-
};
27-
type CreateOptions = {
28-
cwd: string;
29-
testName: string;
30-
templatesDir: string;
31-
};
32-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
33-
declare function createProject({ cwd, testName, templatesDir }: CreateOptions): CreateProject;
34-
type PreviewOptions = {
35-
cwd: string;
36-
command?: string;
37-
};
38-
/** @deprecated Internal helper used by `prepareServer` - will be removed from public API in a future version. */
39-
declare function startPreview({ cwd, command }: PreviewOptions): Promise<{
40-
url: string;
41-
close: () => Promise<void>;
42-
}>;
4313
declare module 'vitest' {
4414
interface ProvidedContext {
4515
testDir: string;
@@ -112,13 +82,9 @@ export {
11282
ProjectVariant,
11383
SetupTestOptions,
11484
VitestContext,
115-
addPnpmBuildDependencies,
116-
createProject,
11785
createSetupTest,
11886
prepareServer,
119-
setup,
12087
setupGlobal,
121-
startPreview,
12288
variants
12389
};
12490
```

packages/sv/src/testing.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { add, type AddonMap, type OptionMap } from './core/engine.ts';
1010
import { addPnpmBuildDependencies } from './core/package-manager.ts';
1111
import { create } from './create/index.ts';
1212

13-
/** @deprecated Internal helper - will be removed from public API in a future version. */
14-
export { addPnpmBuildDependencies } from './core/package-manager.ts';
1513
export type ProjectVariant = 'kit-js' | 'kit-ts' | 'vite-js' | 'vite-ts';
1614
export const variants: ProjectVariant[] = ['kit-js', 'kit-ts', 'vite-js', 'vite-ts'];
1715

@@ -30,8 +28,8 @@ type SetupOptions = {
3028
/** @default false */
3129
clean?: boolean;
3230
};
33-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
34-
export function setup({ cwd, clean = false, variants }: SetupOptions): { templatesDir: string } {
31+
32+
function setup({ cwd, clean = false, variants }: SetupOptions): { templatesDir: string } {
3533
const workingDir = path.resolve(cwd);
3634
if (clean && fs.existsSync(workingDir)) {
3735
fs.rmSync(workingDir, { force: true, recursive: true });
@@ -61,8 +59,8 @@ export function setup({ cwd, clean = false, variants }: SetupOptions): { templat
6159
}
6260

6361
type CreateOptions = { cwd: string; testName: string; templatesDir: string };
64-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
65-
export function createProject({ cwd, testName, templatesDir }: CreateOptions): CreateProject {
62+
63+
function createProject({ cwd, testName, templatesDir }: CreateOptions): CreateProject {
6664
// create the reference dir
6765
const testDir = path.resolve(cwd, testName);
6866
fs.mkdirSync(testDir, { recursive: true });
@@ -78,8 +76,8 @@ export function createProject({ cwd, testName, templatesDir }: CreateOptions): C
7876
}
7977

8078
type PreviewOptions = { cwd: string; command?: string };
81-
/** @deprecated Internal helper used by `prepareServer` - will be removed from public API in a future version. */
82-
export async function startPreview({
79+
80+
async function startPreview({
8381
cwd,
8482
command = 'npm run preview'
8583
}: PreviewOptions): Promise<{ url: string; close: () => Promise<void> }> {

0 commit comments

Comments
 (0)