Skip to content

Commit a294ebb

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

File tree

3 files changed

+7
-35
lines changed

3 files changed

+7
-35
lines changed

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 & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,6 @@ type CreateProject = (options: {
1010
variant: ProjectVariant;
1111
clean?: boolean;
1212
}) => string;
13-
type SetupOptions = {
14-
cwd: string;
15-
variants: readonly ProjectVariant[];
16-
clean?: boolean;
17-
};
18-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
19-
declare function setup({ cwd, clean, variants }: SetupOptions): {
20-
templatesDir: string;
21-
};
22-
type CreateOptions = {
23-
cwd: string;
24-
testName: string;
25-
templatesDir: string;
26-
};
27-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
28-
declare function createProject({ cwd, testName, templatesDir }: CreateOptions): CreateProject;
29-
type PreviewOptions = {
30-
cwd: string;
31-
command?: string;
32-
};
33-
/** @deprecated Internal helper used by `prepareServer` - will be removed from public API in a future version. */
34-
declare function startPreview({ cwd, command }: PreviewOptions): Promise<{
35-
url: string;
36-
close: () => Promise<void>;
37-
}>;
3813
declare module 'vitest' {
3914
interface ProvidedContext {
4015
testDir: string;
@@ -102,12 +77,9 @@ export {
10277
ProjectVariant,
10378
SetupTestOptions,
10479
VitestContext,
105-
createProject,
10680
createSetupTest,
10781
prepareServer,
108-
setup,
10982
setupGlobal,
110-
startPreview,
11183
variants
11284
};
11385
```

packages/sv/src/testing.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ type SetupOptions = {
2828
/** @default false */
2929
clean?: boolean;
3030
};
31-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
32-
export function setup({ cwd, clean = false, variants }: SetupOptions): { templatesDir: string } {
31+
32+
function setup({ cwd, clean = false, variants }: SetupOptions): { templatesDir: string } {
3333
const workingDir = path.resolve(cwd);
3434
if (clean && fs.existsSync(workingDir)) {
3535
fs.rmSync(workingDir, { force: true, recursive: true });
@@ -59,8 +59,8 @@ export function setup({ cwd, clean = false, variants }: SetupOptions): { templat
5959
}
6060

6161
type CreateOptions = { cwd: string; testName: string; templatesDir: string };
62-
/** @deprecated Internal helper used by `createSetupTest` - will be removed from public API in a future version. */
63-
export function createProject({ cwd, testName, templatesDir }: CreateOptions): CreateProject {
62+
63+
function createProject({ cwd, testName, templatesDir }: CreateOptions): CreateProject {
6464
// create the reference dir
6565
const testDir = path.resolve(cwd, testName);
6666
fs.mkdirSync(testDir, { recursive: true });
@@ -76,8 +76,8 @@ export function createProject({ cwd, testName, templatesDir }: CreateOptions): C
7676
}
7777

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

0 commit comments

Comments
 (0)