@cloudflare/vitest-plugin 1.1.13 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,11 +96,21 @@ type D1Migration = {
96
96
  };
97
97
  //#endregion
98
98
  //#region src/pool/d1.d.ts
99
+ type ReadD1MigrationsOptions = {
100
+ projectPath?: string;
101
+ migrationsDir?: string;
102
+ migrationsPattern?: string;
103
+ };
99
104
  /**
100
- * Reads all migrations in `migrationsPath`, ordered by migration number.
101
- * Each migration will have its contents split into an array of SQL queries.
105
+ * Reads D1 migration files, ordered by migration number. Each migration has
106
+ * its contents split into an array of SQL queries.
107
+ *
108
+ * Pass a directory path to keep the historical behaviour of reading top-level
109
+ * `*.sql` files in that directory. Pass options to discover files the same way
110
+ * Wrangler does, including nested layouts such as
111
+ * `0001_init/migration.sql` via `migrationsPattern`.
102
112
  */
103
- declare function readD1Migrations(migrationsPath: string): Promise<D1Migration[]>;
113
+ declare function readD1Migrations(migrationsPathOrOptions: string | ReadD1MigrationsOptions): Promise<D1Migration[]>;
104
114
  //#endregion
105
115
  //#region src/pool/pages.d.ts
106
116
  declare function poolWorkerStarted(): void;
@@ -126,5 +136,5 @@ declare function maybeGetResolvedMainPath(project: TestProject, options: Workers
126
136
  declare function connectToMiniflareSocket(mf: Miniflare, workerName: string): Promise<miniflare0.WebSocket>;
127
137
  declare function assertCompatibleVitestVersion(ctx: Vitest): void;
128
138
  //#endregion
129
- export { type D1Migration, assertCompatibleVitestVersion, buildPagesASSETSBinding, cloudflarePool, cloudflareTest, connectToMiniflareSocket, getDurableObjectDesignators, getProjectMiniflare, getRunnerName, maybeGetResolvedMainPath, poolWorkerStarted, poolWorkerStopped, readD1Migrations, structuredSerializableParse, structuredSerializableStringify };
139
+ export { type D1Migration, ReadD1MigrationsOptions, assertCompatibleVitestVersion, buildPagesASSETSBinding, cloudflarePool, cloudflareTest, connectToMiniflareSocket, getDurableObjectDesignators, getProjectMiniflare, getRunnerName, maybeGetResolvedMainPath, poolWorkerStarted, poolWorkerStopped, readD1Migrations, structuredSerializableParse, structuredSerializableStringify };
130
140
  //# sourceMappingURL=index.d.mts.map