@aamini/config 0.0.2 → 0.0.4
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.
- package/README.md +32 -0
- package/dist/{internal-D6reJqHH.mjs → internal-Dshd0hdM.mjs} +3 -21
- package/dist/internal-Dshd0hdM.mjs.map +1 -0
- package/dist/test/browser.d.mts +3 -2
- package/dist/test/browser.mjs +21 -27
- package/dist/test/browser.mjs.map +1 -1
- package/dist/test/db.d.mts +3 -2
- package/dist/test/db.mjs +42 -46
- package/dist/test/db.mjs.map +1 -1
- package/dist/test/server.d.mts +3 -2
- package/dist/test/server.mjs +18 -23
- package/dist/test/server.mjs.map +1 -1
- package/dist/vite.shared.d.mts +248 -4
- package/dist/vite.shared.mjs +10 -11
- package/dist/vite.shared.mjs.map +1 -1
- package/dist/vitest.shared.d.mts +2 -2
- package/package.json +1 -1
- package/test/browser.ts +24 -27
- package/test/db.ts +49 -53
- package/test/internal.ts +5 -1
- package/test/server.ts +22 -26
- package/vite.shared.ts +9 -7
- package/dist/internal-D6reJqHH.mjs.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @aamini/config
|
|
2
|
+
|
|
3
|
+
Shared configuration and test fixtures for aamini apps.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **`createAppConfig(root)`** — full Vite+ app config with React, Tailwind,
|
|
8
|
+
SVGR, TanStack Start, Nitro
|
|
9
|
+
- **`baseConfigFor(import.meta.url)`** — one-liner for app `vite.config.ts`
|
|
10
|
+
- **Test fixtures** (`test/server`, `test/browser`, `test/db`) — Vitest fixtures
|
|
11
|
+
with auto-detected MSW handlers
|
|
12
|
+
- **`test/db`** — PostgreSQL testcontainer + drizzle + MSW integration fixture
|
|
13
|
+
- **Playwright config** — shared Playwright configuration
|
|
14
|
+
- **`msw.ts`** — re-exports to ensure singleton MSW instances
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
// vite.config.ts
|
|
20
|
+
import { baseConfigFor } from '@aamini/config'
|
|
21
|
+
export default baseConfigFor(import.meta.url)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
// app.test.ts
|
|
26
|
+
import { test } from '@aamini/config/test/server'
|
|
27
|
+
test('handles API', async ({ server }) => { ... })
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Handler files are auto-discovered from the consuming app's working directory:
|
|
31
|
+
`__mocks__/handlers.ts` → `__mocks__/handlers.js` → `src/mocks/handlers.ts` →
|
|
32
|
+
`src/mocks/handlers.js`
|
|
@@ -8,6 +8,7 @@ const HANDLER_LOCATIONS = [
|
|
|
8
8
|
"src/mocks/handlers.js"
|
|
9
9
|
];
|
|
10
10
|
function findHandlerPath() {
|
|
11
|
+
if (typeof process === "undefined") return "";
|
|
11
12
|
const cwd = process.cwd();
|
|
12
13
|
for (const location of HANDLER_LOCATIONS) {
|
|
13
14
|
const fullPath = resolve(cwd, location);
|
|
@@ -15,26 +16,7 @@ function findHandlerPath() {
|
|
|
15
16
|
}
|
|
16
17
|
throw new Error(`No MSW handlers found. Expected one of:\n${HANDLER_LOCATIONS.map((l) => ` - ${resolve(cwd, l)}`).join("\n")}`);
|
|
17
18
|
}
|
|
18
|
-
function createProxy(getTarget) {
|
|
19
|
-
return new Proxy({}, {
|
|
20
|
-
get(_, prop) {
|
|
21
|
-
return Reflect.get(getTarget(), prop, getTarget());
|
|
22
|
-
},
|
|
23
|
-
apply(target, thisArg, args) {
|
|
24
|
-
return Reflect.apply(getTarget(), thisArg, args);
|
|
25
|
-
},
|
|
26
|
-
has(_, prop) {
|
|
27
|
-
return prop in getTarget();
|
|
28
|
-
},
|
|
29
|
-
ownKeys() {
|
|
30
|
-
return Reflect.ownKeys(getTarget());
|
|
31
|
-
},
|
|
32
|
-
getOwnPropertyDescriptor(_, prop) {
|
|
33
|
-
return Reflect.getOwnPropertyDescriptor(getTarget(), prop);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
19
|
//#endregion
|
|
38
|
-
export { findHandlerPath as
|
|
20
|
+
export { findHandlerPath as t };
|
|
39
21
|
|
|
40
|
-
//# sourceMappingURL=internal-
|
|
22
|
+
//# sourceMappingURL=internal-Dshd0hdM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-Dshd0hdM.mjs","names":[],"sources":["../test/internal.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nexport const HANDLER_LOCATIONS = [\n\t'__mocks__/handlers.ts',\n\t'__mocks__/handlers.js',\n\t'src/mocks/handlers.ts',\n\t'src/mocks/handlers.js',\n]\n\nexport function findHandlerPath(): string {\n\tif (typeof process === 'undefined') {\n\t\treturn ''\n\t}\n\tconst cwd = process.cwd()\n\tfor (const location of HANDLER_LOCATIONS) {\n\t\tconst fullPath = resolve(cwd, location)\n\t\tif (existsSync(fullPath)) return fullPath\n\t}\n\tthrow new Error(\n\t\t`No MSW handlers found. Expected one of:\\n${HANDLER_LOCATIONS.map((l) => ` - ${resolve(cwd, l)}`).join('\\n')}`,\n\t)\n}\n\nexport function createProxy<T extends object>(getTarget: () => T): T {\n\tconst handlers: ProxyHandler<object> = {\n\t\tget(_, prop) {\n\t\t\treturn Reflect.get(getTarget(), prop, getTarget())\n\t\t},\n\t\tapply(target, thisArg, args) {\n\t\t\treturn Reflect.apply(getTarget() as any, thisArg, args)\n\t\t},\n\t\thas(_, prop) {\n\t\t\treturn prop in getTarget()\n\t\t},\n\t\townKeys() {\n\t\t\treturn Reflect.ownKeys(getTarget())\n\t\t},\n\t\tgetOwnPropertyDescriptor(_, prop) {\n\t\t\treturn Reflect.getOwnPropertyDescriptor(getTarget(), prop)\n\t\t},\n\t}\n\tconst proxyTarget = () => {}\n\treturn new Proxy(proxyTarget, handlers) as T\n}\n"],"mappings":";;;AAGA,MAAa,oBAAoB;CAChC;CACA;CACA;CACA;CACA;AAED,SAAgB,kBAA0B;CACzC,IAAI,OAAO,YAAY,aACtB,OAAO;CAER,MAAM,MAAM,QAAQ,KAAK;CACzB,KAAK,MAAM,YAAY,mBAAmB;EACzC,MAAM,WAAW,QAAQ,KAAK,SAAS;EACvC,IAAI,WAAW,SAAS,EAAE,OAAO;;CAElC,MAAM,IAAI,MACT,4CAA4C,kBAAkB,KAAK,MAAM,OAAO,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,GAC7G"}
|
package/dist/test/browser.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { SetupWorker } from "msw/browser";
|
|
2
|
+
import { TestAPI, afterEach, beforeEach, describe, expect, vi } from "vitest";
|
|
2
3
|
|
|
3
4
|
//#region test/browser.d.ts
|
|
4
5
|
interface MswBrowserFixture {
|
|
5
6
|
worker: SetupWorker;
|
|
6
7
|
_cleanup: void;
|
|
7
8
|
}
|
|
8
|
-
declare const test:
|
|
9
|
+
declare const test: TestAPI<MswBrowserFixture>;
|
|
9
10
|
//#endregion
|
|
10
|
-
export { MswBrowserFixture, test };
|
|
11
|
+
export { MswBrowserFixture, afterEach, beforeEach, describe, expect, test, vi };
|
|
11
12
|
//# sourceMappingURL=browser.d.mts.map
|
package/dist/test/browser.mjs
CHANGED
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
import { n as findHandlerPath, t as createProxy } from "../internal-D6reJqHH.mjs";
|
|
2
1
|
import { setupWorker } from "msw/browser";
|
|
3
|
-
import { test as test$1 } from "vitest";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test as test$1, vi } from "vitest";
|
|
4
3
|
//#region test/browser.ts
|
|
5
4
|
let workerSingleton;
|
|
6
5
|
async function ensureWorker() {
|
|
7
6
|
if (!workerSingleton) {
|
|
8
|
-
const { default: handlers } = await import(
|
|
7
|
+
const { default: handlers } = await import("@test/handlers");
|
|
9
8
|
workerSingleton = setupWorker(...handlers);
|
|
10
9
|
}
|
|
11
10
|
return workerSingleton;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
worker
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, { auto: true }]
|
|
32
|
-
});
|
|
33
|
-
return extended;
|
|
34
|
-
}
|
|
35
|
-
const test = createProxy(getTest);
|
|
12
|
+
const test = test$1.extend({
|
|
13
|
+
worker: [async ({}, use) => {
|
|
14
|
+
const worker = await ensureWorker();
|
|
15
|
+
await worker.start({
|
|
16
|
+
quiet: true,
|
|
17
|
+
onUnhandledRequest: "bypass"
|
|
18
|
+
});
|
|
19
|
+
await use(worker);
|
|
20
|
+
worker.stop();
|
|
21
|
+
}, {
|
|
22
|
+
auto: true,
|
|
23
|
+
scope: "worker"
|
|
24
|
+
}],
|
|
25
|
+
_cleanup: [async ({ worker }, use) => {
|
|
26
|
+
await use();
|
|
27
|
+
worker.resetHandlers();
|
|
28
|
+
}, { auto: true }]
|
|
29
|
+
});
|
|
36
30
|
//#endregion
|
|
37
|
-
export { test };
|
|
31
|
+
export { afterEach, beforeEach, describe, expect, test, vi };
|
|
38
32
|
|
|
39
33
|
//# sourceMappingURL=browser.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.mjs","names":["baseTest"],"sources":["../../test/browser.ts"],"sourcesContent":["// oxlint-disable no-empty-pattern\nimport { setupWorker, type SetupWorker } from 'msw/browser'\nimport { test as baseTest } from 'vitest'\nimport {
|
|
1
|
+
{"version":3,"file":"browser.mjs","names":["baseTest"],"sources":["../../test/browser.ts"],"sourcesContent":["// oxlint-disable typescript-eslint/triple-slash-reference\n/// <reference path=\"../virtual-modules.d.ts\" />\n// oxlint-disable no-empty-pattern\nimport { setupWorker, type SetupWorker } from 'msw/browser'\nimport { test as baseTest } from 'vitest'\nimport type { TestAPI } from 'vitest'\n\nexport interface MswBrowserFixture {\n\tworker: SetupWorker\n\t_cleanup: void\n}\n\nlet workerSingleton: SetupWorker | undefined\n\nasync function ensureWorker(): Promise<SetupWorker> {\n\tif (!workerSingleton) {\n\t\tconst { default: handlers } = await import('@test/handlers')\n\t\tworkerSingleton = setupWorker(...handlers)\n\t}\n\treturn workerSingleton\n}\n\nconst extended = baseTest.extend<MswBrowserFixture>({\n\tworker: [\n\t\tasync ({}, use) => {\n\t\t\tconst worker = await ensureWorker()\n\t\t\tawait worker.start({ quiet: true, onUnhandledRequest: 'bypass' })\n\t\t\tawait use(worker)\n\t\t\tworker.stop()\n\t\t},\n\t\t{ auto: true, scope: 'worker' },\n\t],\n\t_cleanup: [\n\t\tasync ({ worker }, use) => {\n\t\t\tawait use()\n\t\t\tworker.resetHandlers()\n\t\t},\n\t\t{ auto: true },\n\t],\n})\n\nexport { afterEach, beforeEach, describe, expect, vi } from 'vitest'\n\nexport const test = extended as TestAPI<MswBrowserFixture>\n"],"mappings":";;;AAYA,IAAI;AAEJ,eAAe,eAAqC;CACnD,IAAI,CAAC,iBAAiB;EACrB,MAAM,EAAE,SAAS,aAAa,MAAM,OAAO;EAC3C,kBAAkB,YAAY,GAAG,SAAS;;CAE3C,OAAO;;AAwBR,MAAa,OArBIA,OAAS,OAA0B;CACnD,QAAQ,CACP,OAAO,IAAI,QAAQ;EAClB,MAAM,SAAS,MAAM,cAAc;EACnC,MAAM,OAAO,MAAM;GAAE,OAAO;GAAM,oBAAoB;GAAU,CAAC;EACjE,MAAM,IAAI,OAAO;EACjB,OAAO,MAAM;IAEd;EAAE,MAAM;EAAM,OAAO;EAAU,CAC/B;CACD,UAAU,CACT,OAAO,EAAE,UAAU,QAAQ;EAC1B,MAAM,KAAK;EACX,OAAO,eAAe;IAEvB,EAAE,MAAM,MAAM,CACd;CACD,CAImB"}
|
package/dist/test/db.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Database } from "./database.mjs";
|
|
2
|
+
import { TestAPI, afterEach, beforeEach, describe, expect, vi } from "vitest";
|
|
2
3
|
import { SetupServer } from "msw/node";
|
|
3
4
|
|
|
4
5
|
//#region test/db.d.ts
|
|
@@ -8,8 +9,8 @@ interface DbFixture {
|
|
|
8
9
|
db: Database;
|
|
9
10
|
seedFunction: (db: Database) => Promise<void>;
|
|
10
11
|
}
|
|
11
|
-
declare const test:
|
|
12
|
+
declare const test: TestAPI<DbFixture>;
|
|
12
13
|
declare function initDb(seedFunction: (db: Database) => Promise<void>): void;
|
|
13
14
|
//#endregion
|
|
14
|
-
export { DbFixture, initDb, test };
|
|
15
|
+
export { DbFixture, afterEach, beforeEach, describe, expect, initDb, test, vi };
|
|
15
16
|
//# sourceMappingURL=db.d.mts.map
|
package/dist/test/db.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as findHandlerPath, t as createProxy } from "../internal-D6reJqHH.mjs";
|
|
2
1
|
import { seedDatabase } from "./database.mjs";
|
|
2
|
+
import { t as findHandlerPath } from "../internal-Dshd0hdM.mjs";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
|
-
import { test as test$1 } from "vitest";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, test as test$1, vi } from "vitest";
|
|
5
5
|
import { setupServer } from "msw/node";
|
|
6
6
|
//#region test/db.ts
|
|
7
7
|
const DEFAULT_SCHEMA_PATH = "src/db/tables.ts";
|
|
@@ -15,52 +15,48 @@ async function ensureMswServer() {
|
|
|
15
15
|
}
|
|
16
16
|
return mswServer;
|
|
17
17
|
}
|
|
18
|
-
let extended
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
server:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
return extended;
|
|
58
|
-
}
|
|
59
|
-
const test = createProxy(getTest);
|
|
18
|
+
let extended = test$1.extend({
|
|
19
|
+
server: [async ({}, use) => {
|
|
20
|
+
const server = await ensureMswServer();
|
|
21
|
+
server.listen({ onUnhandledRequest: "bypass" });
|
|
22
|
+
await use(server);
|
|
23
|
+
server.close();
|
|
24
|
+
}, {
|
|
25
|
+
auto: true,
|
|
26
|
+
scope: "worker"
|
|
27
|
+
}],
|
|
28
|
+
_cleanup: [async ({ server }, use) => {
|
|
29
|
+
await use();
|
|
30
|
+
server.resetHandlers();
|
|
31
|
+
}, { auto: true }],
|
|
32
|
+
seedFunction: [async ({}, use) => use(async () => {}), { scope: "file" }],
|
|
33
|
+
db: [async ({ seedFunction }, use) => {
|
|
34
|
+
const { PostgreSqlContainer } = await import("@testcontainers/postgresql");
|
|
35
|
+
const { drizzle } = await import("drizzle-orm/node-postgres");
|
|
36
|
+
const { Wait } = await import("testcontainers");
|
|
37
|
+
const { Pool } = await import("pg");
|
|
38
|
+
const schemaPath = resolve(process.cwd(), DEFAULT_SCHEMA_PATH);
|
|
39
|
+
const migrationsFolder = resolve(process.cwd(), DEFAULT_MIGRATIONS_PATH);
|
|
40
|
+
const container = await new PostgreSqlContainer(DEFAULT_IMAGE).withWaitStrategy(Wait.forHealthCheck()).start();
|
|
41
|
+
const db = drizzle({ client: new Pool({ connectionString: container.getConnectionUri() }) });
|
|
42
|
+
try {
|
|
43
|
+
await seedDatabase(db, {
|
|
44
|
+
schemaPath,
|
|
45
|
+
migrationsFolder,
|
|
46
|
+
seedFunction
|
|
47
|
+
});
|
|
48
|
+
await use(db);
|
|
49
|
+
} finally {
|
|
50
|
+
await db.$client.end();
|
|
51
|
+
await container.stop();
|
|
52
|
+
}
|
|
53
|
+
}, { scope: "file" }]
|
|
54
|
+
});
|
|
55
|
+
const test = extended;
|
|
60
56
|
function initDb(seedFunction) {
|
|
61
|
-
|
|
57
|
+
extended = extended.override({ seedFunction: [async ({}, use) => use(seedFunction), { scope: "file" }] });
|
|
62
58
|
}
|
|
63
59
|
//#endregion
|
|
64
|
-
export { initDb, test };
|
|
60
|
+
export { afterEach, beforeEach, describe, expect, initDb, test, vi };
|
|
65
61
|
|
|
66
62
|
//# sourceMappingURL=db.mjs.map
|
package/dist/test/db.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.mjs","names":["baseTest"],"sources":["../../test/db.ts"],"sourcesContent":["// oxlint-disable no-empty-pattern\nimport { setupServer, SetupServer } from 'msw/node'\nimport { resolve } from 'node:path'\nimport { test as baseTest } from 'vitest'\nimport type { Database } from './database'\nimport { seedDatabase } from './database'\nimport {
|
|
1
|
+
{"version":3,"file":"db.mjs","names":["baseTest"],"sources":["../../test/db.ts"],"sourcesContent":["// oxlint-disable no-empty-pattern\nimport { setupServer, SetupServer } from 'msw/node'\nimport { resolve } from 'node:path'\nimport { test as baseTest } from 'vitest'\nimport type { TestAPI } from 'vitest'\nimport type { Database } from './database'\nimport { seedDatabase } from './database'\nimport { findHandlerPath } from './internal'\n\nconst DEFAULT_SCHEMA_PATH = 'src/db/tables.ts'\nconst DEFAULT_MIGRATIONS_PATH = 'src/db/migrations'\nconst DEFAULT_IMAGE = 'postgres:17'\n\nexport interface DbFixture {\n\tserver: SetupServer\n\t_cleanup: void\n\tdb: Database\n\tseedFunction: (db: Database) => Promise<void>\n}\n\nlet mswServer: SetupServer | undefined\n\nasync function ensureMswServer(): Promise<SetupServer> {\n\tif (!mswServer) {\n\t\tconst { default: handlers } = await import(findHandlerPath())\n\t\tmswServer = setupServer(...handlers)\n\t}\n\treturn mswServer\n}\n\nlet extended = baseTest.extend<DbFixture>({\n\tserver: [\n\t\tasync ({}, use) => {\n\t\t\tconst server = await ensureMswServer()\n\t\t\tserver.listen({ onUnhandledRequest: 'bypass' })\n\t\t\tawait use(server)\n\t\t\tserver.close()\n\t\t},\n\t\t{ auto: true, scope: 'worker' },\n\t],\n\t_cleanup: [\n\t\tasync ({ server }, use) => {\n\t\t\tawait use()\n\t\t\tserver.resetHandlers()\n\t\t},\n\t\t{ auto: true },\n\t],\n\tseedFunction: [async ({}, use) => use(async () => {}), { scope: 'file' }],\n\tdb: [\n\t\tasync ({ seedFunction }: Pick<DbFixture, 'seedFunction'>, use) => {\n\t\t\tconst { PostgreSqlContainer } = await import('@testcontainers/postgresql')\n\t\t\tconst { drizzle } = await import('drizzle-orm/node-postgres')\n\t\t\tconst { Wait } = await import('testcontainers')\n\t\t\tconst { Pool } = await import('pg')\n\n\t\t\tconst schemaPath = resolve(process.cwd(), DEFAULT_SCHEMA_PATH)\n\t\t\tconst migrationsFolder = resolve(process.cwd(), DEFAULT_MIGRATIONS_PATH)\n\n\t\t\tconst container = await new PostgreSqlContainer(DEFAULT_IMAGE)\n\t\t\t\t.withWaitStrategy(Wait.forHealthCheck())\n\t\t\t\t.start()\n\t\t\tconst db = drizzle({\n\t\t\t\tclient: new Pool({ connectionString: container.getConnectionUri() }),\n\t\t\t}) as Database\n\n\t\t\ttry {\n\t\t\t\tawait seedDatabase(db, { schemaPath, migrationsFolder, seedFunction })\n\t\t\t\tawait use(db)\n\t\t\t} finally {\n\t\t\t\tawait db.$client.end()\n\t\t\t\tawait container.stop()\n\t\t\t}\n\t\t},\n\t\t{ scope: 'file' },\n\t],\n})\n\nexport { afterEach, beforeEach, describe, expect, vi } from 'vitest'\n\nexport const test = extended as TestAPI<DbFixture>\n\nexport function initDb(seedFunction: (db: Database) => Promise<void>) {\n\textended = extended.override({\n\t\tseedFunction: [async ({}, use) => use(seedFunction), { scope: 'file' }],\n\t}) as typeof extended\n}\n"],"mappings":";;;;;;AASA,MAAM,sBAAsB;AAC5B,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAStB,IAAI;AAEJ,eAAe,kBAAwC;CACtD,IAAI,CAAC,WAAW;EACf,MAAM,EAAE,SAAS,aAAa,MAAM,OAAO,iBAAiB;EAC5D,YAAY,YAAY,GAAG,SAAS;;CAErC,OAAO;;AAGR,IAAI,WAAWA,OAAS,OAAkB;CACzC,QAAQ,CACP,OAAO,IAAI,QAAQ;EAClB,MAAM,SAAS,MAAM,iBAAiB;EACtC,OAAO,OAAO,EAAE,oBAAoB,UAAU,CAAC;EAC/C,MAAM,IAAI,OAAO;EACjB,OAAO,OAAO;IAEf;EAAE,MAAM;EAAM,OAAO;EAAU,CAC/B;CACD,UAAU,CACT,OAAO,EAAE,UAAU,QAAQ;EAC1B,MAAM,KAAK;EACX,OAAO,eAAe;IAEvB,EAAE,MAAM,MAAM,CACd;CACD,cAAc,CAAC,OAAO,IAAI,QAAQ,IAAI,YAAY,GAAG,EAAE,EAAE,OAAO,QAAQ,CAAC;CACzE,IAAI,CACH,OAAO,EAAE,gBAAiD,QAAQ;EACjE,MAAM,EAAE,wBAAwB,MAAM,OAAO;EAC7C,MAAM,EAAE,YAAY,MAAM,OAAO;EACjC,MAAM,EAAE,SAAS,MAAM,OAAO;EAC9B,MAAM,EAAE,SAAS,MAAM,OAAO;EAE9B,MAAM,aAAa,QAAQ,QAAQ,KAAK,EAAE,oBAAoB;EAC9D,MAAM,mBAAmB,QAAQ,QAAQ,KAAK,EAAE,wBAAwB;EAExE,MAAM,YAAY,MAAM,IAAI,oBAAoB,cAAc,CAC5D,iBAAiB,KAAK,gBAAgB,CAAC,CACvC,OAAO;EACT,MAAM,KAAK,QAAQ,EAClB,QAAQ,IAAI,KAAK,EAAE,kBAAkB,UAAU,kBAAkB,EAAE,CAAC,EACpE,CAAC;EAEF,IAAI;GACH,MAAM,aAAa,IAAI;IAAE;IAAY;IAAkB;IAAc,CAAC;GACtE,MAAM,IAAI,GAAG;YACJ;GACT,MAAM,GAAG,QAAQ,KAAK;GACtB,MAAM,UAAU,MAAM;;IAGxB,EAAE,OAAO,QAAQ,CACjB;CACD,CAAC;AAIF,MAAa,OAAO;AAEpB,SAAgB,OAAO,cAA+C;CACrE,WAAW,SAAS,SAAS,EAC5B,cAAc,CAAC,OAAO,IAAI,QAAQ,IAAI,aAAa,EAAE,EAAE,OAAO,QAAQ,CAAC,EACvE,CAAC"}
|
package/dist/test/server.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TestAPI, afterEach, beforeEach, describe, expect, vi } from "vitest";
|
|
1
2
|
import { SetupServer } from "msw/node";
|
|
2
3
|
|
|
3
4
|
//#region test/server.d.ts
|
|
@@ -5,7 +6,7 @@ interface MswServerFixture {
|
|
|
5
6
|
server: SetupServer;
|
|
6
7
|
_cleanup: void;
|
|
7
8
|
}
|
|
8
|
-
declare const test:
|
|
9
|
+
declare const test: TestAPI<MswServerFixture>;
|
|
9
10
|
//#endregion
|
|
10
|
-
export { MswServerFixture, test };
|
|
11
|
+
export { MswServerFixture, afterEach, beforeEach, describe, expect, test, vi };
|
|
11
12
|
//# sourceMappingURL=server.d.mts.map
|
package/dist/test/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { test as test$1 } from "vitest";
|
|
1
|
+
import { t as findHandlerPath } from "../internal-Dshd0hdM.mjs";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test as test$1, vi } from "vitest";
|
|
3
3
|
import { setupServer } from "msw/node";
|
|
4
4
|
//#region test/server.ts
|
|
5
5
|
let mswServer;
|
|
@@ -10,27 +10,22 @@ async function ensureMswServer() {
|
|
|
10
10
|
}
|
|
11
11
|
return mswServer;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
server:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, { auto: true }]
|
|
29
|
-
});
|
|
30
|
-
return extended;
|
|
31
|
-
}
|
|
32
|
-
const test = createProxy(getTest);
|
|
13
|
+
const test = test$1.extend({
|
|
14
|
+
server: [async ({}, use) => {
|
|
15
|
+
const server = await ensureMswServer();
|
|
16
|
+
server.listen({ onUnhandledRequest: "bypass" });
|
|
17
|
+
await use(server);
|
|
18
|
+
server.close();
|
|
19
|
+
}, {
|
|
20
|
+
auto: true,
|
|
21
|
+
scope: "worker"
|
|
22
|
+
}],
|
|
23
|
+
_cleanup: [async ({ server }, use) => {
|
|
24
|
+
await use();
|
|
25
|
+
server.resetHandlers();
|
|
26
|
+
}, { auto: true }]
|
|
27
|
+
});
|
|
33
28
|
//#endregion
|
|
34
|
-
export { test };
|
|
29
|
+
export { afterEach, beforeEach, describe, expect, test, vi };
|
|
35
30
|
|
|
36
31
|
//# sourceMappingURL=server.mjs.map
|
package/dist/test/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","names":["baseTest"],"sources":["../../test/server.ts"],"sourcesContent":["// oxlint-disable no-empty-pattern\nimport { setupServer, type SetupServer } from 'msw/node'\nimport { test as baseTest } from 'vitest'\nimport {
|
|
1
|
+
{"version":3,"file":"server.mjs","names":["baseTest"],"sources":["../../test/server.ts"],"sourcesContent":["// oxlint-disable no-empty-pattern\nimport { setupServer, type SetupServer } from 'msw/node'\nimport { test as baseTest } from 'vitest'\nimport type { TestAPI } from 'vitest'\nimport { findHandlerPath } from './internal'\n\nexport interface MswServerFixture {\n\tserver: SetupServer\n\t_cleanup: void\n}\n\nlet mswServer: SetupServer | undefined\n\nasync function ensureMswServer(): Promise<SetupServer> {\n\tif (!mswServer) {\n\t\tconst { default: handlers } = await import(findHandlerPath())\n\t\tmswServer = setupServer(...handlers)\n\t}\n\treturn mswServer\n}\n\nconst extended = baseTest.extend<MswServerFixture>({\n\tserver: [\n\t\tasync ({}, use) => {\n\t\t\tconst server = await ensureMswServer()\n\t\t\tserver.listen({ onUnhandledRequest: 'bypass' })\n\t\t\tawait use(server)\n\t\t\tserver.close()\n\t\t},\n\t\t{ auto: true, scope: 'worker' },\n\t],\n\t_cleanup: [\n\t\tasync ({ server }, use) => {\n\t\t\tawait use()\n\t\t\tserver.resetHandlers()\n\t\t},\n\t\t{ auto: true },\n\t],\n})\n\nexport { afterEach, beforeEach, describe, expect, vi } from 'vitest'\n\nexport const test = extended as TestAPI<MswServerFixture>\n"],"mappings":";;;;AAWA,IAAI;AAEJ,eAAe,kBAAwC;CACtD,IAAI,CAAC,WAAW;EACf,MAAM,EAAE,SAAS,aAAa,MAAM,OAAO,iBAAiB;EAC5D,YAAY,YAAY,GAAG,SAAS;;CAErC,OAAO;;AAwBR,MAAa,OArBIA,OAAS,OAAyB;CAClD,QAAQ,CACP,OAAO,IAAI,QAAQ;EAClB,MAAM,SAAS,MAAM,iBAAiB;EACtC,OAAO,OAAO,EAAE,oBAAoB,UAAU,CAAC;EAC/C,MAAM,IAAI,OAAO;EACjB,OAAO,OAAO;IAEf;EAAE,MAAM;EAAM,OAAO;EAAU,CAC/B;CACD,UAAU,CACT,OAAO,EAAE,UAAU,QAAQ;EAC1B,MAAM,KAAK;EACX,OAAO,eAAe;IAEvB,EAAE,MAAM,MAAM,CACd;CACD,CAImB"}
|
package/dist/vite.shared.d.mts
CHANGED
|
@@ -5,8 +5,252 @@ interface ProjectOverrides {
|
|
|
5
5
|
server?: TestProjectConfiguration;
|
|
6
6
|
browser?: TestProjectConfiguration;
|
|
7
7
|
}
|
|
8
|
-
declare function createAppConfig(root: string, projectOverrides?: ProjectOverrides, overrides?: TestProjectInlineConfiguration):
|
|
9
|
-
|
|
8
|
+
declare function createAppConfig(root: string, projectOverrides?: ProjectOverrides, overrides?: TestProjectInlineConfiguration): {
|
|
9
|
+
fmt: {
|
|
10
|
+
singleQuote: boolean;
|
|
11
|
+
semi: boolean;
|
|
12
|
+
useTabs: boolean;
|
|
13
|
+
experimentalTailwindcss: {};
|
|
14
|
+
printWidth: number;
|
|
15
|
+
experimentalSortPackageJson: boolean;
|
|
16
|
+
proseWrap: string;
|
|
17
|
+
ignorePatterns: string[];
|
|
18
|
+
overrides: {
|
|
19
|
+
files: string[];
|
|
20
|
+
options: {
|
|
21
|
+
useTabs: boolean;
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
lint: {
|
|
26
|
+
plugins: string[];
|
|
27
|
+
categories: {};
|
|
28
|
+
options: {
|
|
29
|
+
typeAware: boolean;
|
|
30
|
+
typeCheck: boolean;
|
|
31
|
+
};
|
|
32
|
+
rules: {
|
|
33
|
+
'no-empty-pattern': string;
|
|
34
|
+
'no-console': (string | {
|
|
35
|
+
allow: string[];
|
|
36
|
+
})[];
|
|
37
|
+
};
|
|
38
|
+
settings: {
|
|
39
|
+
'jsx-a11y': {
|
|
40
|
+
components: {};
|
|
41
|
+
attributes: {};
|
|
42
|
+
};
|
|
43
|
+
react: {
|
|
44
|
+
formComponents: any[];
|
|
45
|
+
linkComponents: any[];
|
|
46
|
+
};
|
|
47
|
+
jsdoc: {
|
|
48
|
+
ignorePrivate: boolean;
|
|
49
|
+
ignoreInternal: boolean;
|
|
50
|
+
ignoreReplacesDocs: boolean;
|
|
51
|
+
overrideReplacesDocs: boolean;
|
|
52
|
+
augmentsExtendsReplacesDocs: boolean;
|
|
53
|
+
implementsReplacesDocs: boolean;
|
|
54
|
+
exemptDestructuredRootsFromChecks: boolean;
|
|
55
|
+
tagNamePreference: {};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
env: {
|
|
59
|
+
builtin: boolean;
|
|
60
|
+
};
|
|
61
|
+
globals: {};
|
|
62
|
+
ignorePatterns: string[];
|
|
63
|
+
overrides: ({
|
|
64
|
+
files: string[];
|
|
65
|
+
rules: {
|
|
66
|
+
'eslint/no-restricted-imports': (string | {
|
|
67
|
+
patterns: {
|
|
68
|
+
group: string[];
|
|
69
|
+
message: string;
|
|
70
|
+
}[];
|
|
71
|
+
})[];
|
|
72
|
+
'react/self-closing-comp'?: undefined;
|
|
73
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
74
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
75
|
+
'no-console'?: undefined;
|
|
76
|
+
};
|
|
77
|
+
plugins?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
files: string[];
|
|
80
|
+
rules: {
|
|
81
|
+
'eslint/no-restricted-imports': (string | {
|
|
82
|
+
paths: {
|
|
83
|
+
name: string;
|
|
84
|
+
message: string;
|
|
85
|
+
}[];
|
|
86
|
+
})[];
|
|
87
|
+
'react/self-closing-comp'?: undefined;
|
|
88
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
89
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
90
|
+
'no-console'?: undefined;
|
|
91
|
+
};
|
|
92
|
+
plugins?: undefined;
|
|
93
|
+
} | {
|
|
94
|
+
files: string[];
|
|
95
|
+
plugins: string[];
|
|
96
|
+
rules: {
|
|
97
|
+
'react/self-closing-comp': string;
|
|
98
|
+
'eslint/no-restricted-imports'?: undefined;
|
|
99
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
100
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
101
|
+
'no-console'?: undefined;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
files: string[];
|
|
105
|
+
plugins: string[];
|
|
106
|
+
rules: {
|
|
107
|
+
'@typescript-eslint/no-explicit-any': string;
|
|
108
|
+
'vitest/no-standalone-expect': (string | {
|
|
109
|
+
additionalTestBlockFunctions: string[];
|
|
110
|
+
})[];
|
|
111
|
+
'eslint/no-restricted-imports'?: undefined;
|
|
112
|
+
'react/self-closing-comp'?: undefined;
|
|
113
|
+
'no-console'?: undefined;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
files: string[];
|
|
117
|
+
rules: {
|
|
118
|
+
'no-console': string;
|
|
119
|
+
'eslint/no-restricted-imports'?: undefined;
|
|
120
|
+
'react/self-closing-comp'?: undefined;
|
|
121
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
122
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
123
|
+
};
|
|
124
|
+
plugins?: undefined;
|
|
125
|
+
})[];
|
|
126
|
+
};
|
|
127
|
+
staged: {
|
|
128
|
+
'*.{js,ts,tsx}': string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
declare function baseConfigFor(configUrl: string | URL): {
|
|
132
|
+
fmt: {
|
|
133
|
+
singleQuote: boolean;
|
|
134
|
+
semi: boolean;
|
|
135
|
+
useTabs: boolean;
|
|
136
|
+
experimentalTailwindcss: {};
|
|
137
|
+
printWidth: number;
|
|
138
|
+
experimentalSortPackageJson: boolean;
|
|
139
|
+
proseWrap: string;
|
|
140
|
+
ignorePatterns: string[];
|
|
141
|
+
overrides: {
|
|
142
|
+
files: string[];
|
|
143
|
+
options: {
|
|
144
|
+
useTabs: boolean;
|
|
145
|
+
};
|
|
146
|
+
}[];
|
|
147
|
+
};
|
|
148
|
+
lint: {
|
|
149
|
+
plugins: string[];
|
|
150
|
+
categories: {};
|
|
151
|
+
options: {
|
|
152
|
+
typeAware: boolean;
|
|
153
|
+
typeCheck: boolean;
|
|
154
|
+
};
|
|
155
|
+
rules: {
|
|
156
|
+
'no-empty-pattern': string;
|
|
157
|
+
'no-console': (string | {
|
|
158
|
+
allow: string[];
|
|
159
|
+
})[];
|
|
160
|
+
};
|
|
161
|
+
settings: {
|
|
162
|
+
'jsx-a11y': {
|
|
163
|
+
components: {};
|
|
164
|
+
attributes: {};
|
|
165
|
+
};
|
|
166
|
+
react: {
|
|
167
|
+
formComponents: any[];
|
|
168
|
+
linkComponents: any[];
|
|
169
|
+
};
|
|
170
|
+
jsdoc: {
|
|
171
|
+
ignorePrivate: boolean;
|
|
172
|
+
ignoreInternal: boolean;
|
|
173
|
+
ignoreReplacesDocs: boolean;
|
|
174
|
+
overrideReplacesDocs: boolean;
|
|
175
|
+
augmentsExtendsReplacesDocs: boolean;
|
|
176
|
+
implementsReplacesDocs: boolean;
|
|
177
|
+
exemptDestructuredRootsFromChecks: boolean;
|
|
178
|
+
tagNamePreference: {};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
env: {
|
|
182
|
+
builtin: boolean;
|
|
183
|
+
};
|
|
184
|
+
globals: {};
|
|
185
|
+
ignorePatterns: string[];
|
|
186
|
+
overrides: ({
|
|
187
|
+
files: string[];
|
|
188
|
+
rules: {
|
|
189
|
+
'eslint/no-restricted-imports': (string | {
|
|
190
|
+
patterns: {
|
|
191
|
+
group: string[];
|
|
192
|
+
message: string;
|
|
193
|
+
}[];
|
|
194
|
+
})[];
|
|
195
|
+
'react/self-closing-comp'?: undefined;
|
|
196
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
197
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
198
|
+
'no-console'?: undefined;
|
|
199
|
+
};
|
|
200
|
+
plugins?: undefined;
|
|
201
|
+
} | {
|
|
202
|
+
files: string[];
|
|
203
|
+
rules: {
|
|
204
|
+
'eslint/no-restricted-imports': (string | {
|
|
205
|
+
paths: {
|
|
206
|
+
name: string;
|
|
207
|
+
message: string;
|
|
208
|
+
}[];
|
|
209
|
+
})[];
|
|
210
|
+
'react/self-closing-comp'?: undefined;
|
|
211
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
212
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
213
|
+
'no-console'?: undefined;
|
|
214
|
+
};
|
|
215
|
+
plugins?: undefined;
|
|
216
|
+
} | {
|
|
217
|
+
files: string[];
|
|
218
|
+
plugins: string[];
|
|
219
|
+
rules: {
|
|
220
|
+
'react/self-closing-comp': string;
|
|
221
|
+
'eslint/no-restricted-imports'?: undefined;
|
|
222
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
223
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
224
|
+
'no-console'?: undefined;
|
|
225
|
+
};
|
|
226
|
+
} | {
|
|
227
|
+
files: string[];
|
|
228
|
+
plugins: string[];
|
|
229
|
+
rules: {
|
|
230
|
+
'@typescript-eslint/no-explicit-any': string;
|
|
231
|
+
'vitest/no-standalone-expect': (string | {
|
|
232
|
+
additionalTestBlockFunctions: string[];
|
|
233
|
+
})[];
|
|
234
|
+
'eslint/no-restricted-imports'?: undefined;
|
|
235
|
+
'react/self-closing-comp'?: undefined;
|
|
236
|
+
'no-console'?: undefined;
|
|
237
|
+
};
|
|
238
|
+
} | {
|
|
239
|
+
files: string[];
|
|
240
|
+
rules: {
|
|
241
|
+
'no-console': string;
|
|
242
|
+
'eslint/no-restricted-imports'?: undefined;
|
|
243
|
+
'react/self-closing-comp'?: undefined;
|
|
244
|
+
'@typescript-eslint/no-explicit-any'?: undefined;
|
|
245
|
+
'vitest/no-standalone-expect'?: undefined;
|
|
246
|
+
};
|
|
247
|
+
plugins?: undefined;
|
|
248
|
+
})[];
|
|
249
|
+
};
|
|
250
|
+
staged: {
|
|
251
|
+
'*.{js,ts,tsx}': string;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
10
254
|
declare const workspaceConfig: {
|
|
11
255
|
fmt: {
|
|
12
256
|
singleQuote: boolean;
|
|
@@ -43,8 +287,8 @@ declare const workspaceConfig: {
|
|
|
43
287
|
attributes: {};
|
|
44
288
|
};
|
|
45
289
|
react: {
|
|
46
|
-
formComponents:
|
|
47
|
-
linkComponents:
|
|
290
|
+
formComponents: any[];
|
|
291
|
+
linkComponents: any[];
|
|
48
292
|
};
|
|
49
293
|
jsdoc: {
|
|
50
294
|
ignorePrivate: boolean;
|
package/dist/vite.shared.mjs
CHANGED
|
@@ -61,7 +61,7 @@ function stylesPlugin(root) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
const stylesSetup =
|
|
64
|
+
const stylesSetup = "@aamini/config/setup/styles";
|
|
65
65
|
function mergeProjectConfig(base, overrides = {}) {
|
|
66
66
|
return mergeConfig(base, overrides);
|
|
67
67
|
}
|
|
@@ -81,14 +81,10 @@ function createBaseConfig(root, overrides = {}, projectOverrides = {}) {
|
|
|
81
81
|
replacement: resolve(root, "src")
|
|
82
82
|
}]
|
|
83
83
|
},
|
|
84
|
-
plugins: [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
include: "**/*.svg",
|
|
89
|
-
svgrOptions: { exportType: "default" }
|
|
90
|
-
})
|
|
91
|
-
],
|
|
84
|
+
plugins: [tailwindcss(), svgr({
|
|
85
|
+
include: "**/*.svg",
|
|
86
|
+
svgrOptions: { exportType: "default" }
|
|
87
|
+
})],
|
|
92
88
|
test: {
|
|
93
89
|
passWithNoTests: true,
|
|
94
90
|
exclude: [
|
|
@@ -173,7 +169,10 @@ function createFrameworkConfig(root) {
|
|
|
173
169
|
});
|
|
174
170
|
}
|
|
175
171
|
function createAppConfig(root, projectOverrides = {}, overrides = {}) {
|
|
176
|
-
return
|
|
172
|
+
return {
|
|
173
|
+
...workspaceConfig,
|
|
174
|
+
...mergeConfig(createFrameworkConfig(root), createBaseConfig(root, overrides, projectOverrides))
|
|
175
|
+
};
|
|
177
176
|
}
|
|
178
177
|
function baseConfigFor(configUrl) {
|
|
179
178
|
return createAppConfig(dirname(fileURLToPath(configUrl)));
|
|
@@ -193,7 +192,7 @@ const workspaceConfig = {
|
|
|
193
192
|
"**/dist/**",
|
|
194
193
|
"**/env.d.ts",
|
|
195
194
|
"pnpm-lock.yaml",
|
|
196
|
-
"routeTree.gen.ts",
|
|
195
|
+
"**/routeTree.gen.ts",
|
|
197
196
|
"infra/manifests/gitops/flux-system/gotk-components.yaml",
|
|
198
197
|
"infra/charts/**/templates/**/*.{yml,yaml}",
|
|
199
198
|
"**/charts/**",
|
package/dist/vite.shared.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.shared.mjs","names":["defineVitestConfig","defineConfig"],"sources":["../vite.shared.ts"],"sourcesContent":["import { nitro } from 'nitro/vite'\nimport { devtools } from '@tanstack/devtools-vite'\nimport { tanstackStart } from '@tanstack/react-start/plugin/vite'\nimport viteReact, { reactCompilerPreset } from '@vitejs/plugin-react'\nimport tailwindcss from '@tailwindcss/vite'\nimport babel from '@rolldown/plugin-babel'\nimport svgr from 'vite-plugin-svgr'\nimport { existsSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Plugin } from 'vite'\nimport {\n\tdefineConfig as defineVitestConfig,\n\tmergeConfig,\n\ttype TestProjectConfiguration,\n\ttype TestProjectInlineConfiguration,\n} from 'vitest/config'\nimport { defineConfig } from 'vite'\nimport { playwright } from 'vite-plus/test/browser-playwright'\n\nconst HANDLER_LOCATIONS = [\n\t'__mocks__/handlers.ts',\n\t'__mocks__/handlers.js',\n\t'src/mocks/handlers.ts',\n\t'src/mocks/handlers.js',\n]\n\nconst STYLES_LOCATIONS = ['src/styles.css', 'src/index.css', 'src/app.css']\n\nfunction mswHandlersPlugin(root: string): Plugin {\n\tconst virtualModuleId = '@test/handlers'\n\tconst resolvedVirtualModuleId = '\\0' + virtualModuleId\n\n\treturn {\n\t\tname: 'msw-handlers-resolver',\n\t\tresolveId(id) {\n\t\t\tif (id === virtualModuleId) {\n\t\t\t\treturn resolvedVirtualModuleId\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t\tload(id) {\n\t\t\tif (id === resolvedVirtualModuleId) {\n\t\t\t\tfor (const location of HANDLER_LOCATIONS) {\n\t\t\t\t\tconst fullPath = resolve(root, location)\n\t\t\t\t\tif (existsSync(fullPath)) {\n\t\t\t\t\t\treturn `export { default } from '${fullPath}'`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No MSW handlers found. Expected one of:\\n${HANDLER_LOCATIONS.map((l) => ` - ${resolve(root, l)}`).join('\\n')}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t}\n}\n\nfunction stylesPlugin(root: string): Plugin {\n\tconst virtualModuleId = '@test/styles'\n\tconst resolvedVirtualModuleId = '\\0' + virtualModuleId\n\n\treturn {\n\t\tname: 'styles-resolver',\n\t\tresolveId(id) {\n\t\t\tif (id === virtualModuleId) {\n\t\t\t\treturn resolvedVirtualModuleId\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t\tload(id) {\n\t\t\tif (id === resolvedVirtualModuleId) {\n\t\t\t\tfor (const location of STYLES_LOCATIONS) {\n\t\t\t\t\tconst fullPath = resolve(root, location)\n\t\t\t\t\tif (existsSync(fullPath)) {\n\t\t\t\t\t\treturn `import '${fullPath}'`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No styles file found. Expected one of:\\n${STYLES_LOCATIONS.map((l) => ` - ${resolve(root, l)}`).join('\\n')}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t}\n}\n\nconst stylesSetup = new URL('setup/styles.ts', import.meta.url).pathname\n\nfunction mergeProjectConfig(\n\tbase: TestProjectConfiguration,\n\toverrides: TestProjectConfiguration = {},\n): TestProjectConfiguration {\n\treturn mergeConfig(\n\t\tbase as Record<string, any>,\n\t\toverrides as Record<string, any>,\n\t) as TestProjectConfiguration\n}\n\ninterface ProjectOverrides {\n\tserver?: TestProjectConfiguration\n\tbrowser?: TestProjectConfiguration\n}\n\nfunction createBaseConfig(\n\troot: string,\n\toverrides: TestProjectInlineConfiguration = {},\n\tprojectOverrides: ProjectOverrides = {},\n) {\n\tconst localSetup = resolve(root, 'vitest.setup.ts')\n\tconst hasLocalSetup = existsSync(localSetup)\n\n\treturn mergeConfig(\n\t\tdefineVitestConfig({\n\t\t\troot,\n\t\t\tresolve: {\n\t\t\t\ttsconfigPaths: true,\n\t\t\t\tdedupe: ['react', 'react-dom'],\n\t\t\t\talias: [\n\t\t\t\t\t{ find: '@/mocks', replacement: resolve(root, '__mocks__') },\n\t\t\t\t\t{ find: '@', replacement: resolve(root, 'src') },\n\t\t\t\t],\n\t\t\t},\n\t\t\tplugins: [\n\t\t\t\ttailwindcss(),\n\t\t\t\tviteReact(),\n\t\t\t\tsvgr({\n\t\t\t\t\tinclude: '**/*.svg',\n\t\t\t\t\tsvgrOptions: { exportType: 'default' },\n\t\t\t\t}),\n\t\t\t],\n\t\t\ttest: {\n\t\t\t\tpassWithNoTests: true,\n\t\t\t\texclude: [\n\t\t\t\t\t'**/node_modules/**',\n\t\t\t\t\t'**/dist/**',\n\t\t\t\t\t'**/.output/**',\n\t\t\t\t\t'**/.vercel/**',\n\t\t\t\t\t'**/cypress/**',\n\t\t\t\t\t'**/.{idea,git,cache,output,temp}/**',\n\t\t\t\t\t'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',\n\t\t\t\t\t'**/e2e/**',\n\t\t\t\t],\n\t\t\t\tprojects: [\n\t\t\t\t\t{\n\t\t\t\t\t\textends: true,\n\t\t\t\t\t\ttest: {\n\t\t\t\t\t\t\tname: 'unit',\n\t\t\t\t\t\t\tinclude: ['src/**/*.test.unit.ts'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tmergeProjectConfig(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\textends: true,\n\t\t\t\t\t\t\tplugins: [mswHandlersPlugin(root)],\n\t\t\t\t\t\t\ttest: {\n\t\t\t\t\t\t\t\tname: 'server',\n\t\t\t\t\t\t\t\tinclude: ['src/**/*.test.ts'],\n\t\t\t\t\t\t\t\texclude: ['src/**/*.test.unit.ts', 'src/**/*.test.tsx'],\n\t\t\t\t\t\t\t\ttestTimeout: 30_000,\n\t\t\t\t\t\t\t\tfileParallelism: false,\n\t\t\t\t\t\t\t\tsetupFiles: hasLocalSetup ? [localSetup] : [],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} satisfies TestProjectConfiguration,\n\t\t\t\t\t\tprojectOverrides.server ?? {},\n\t\t\t\t\t),\n\t\t\t\t\tmergeProjectConfig(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\textends: true,\n\t\t\t\t\t\t\tplugins: [mswHandlersPlugin(root), stylesPlugin(root)],\n\t\t\t\t\t\t\ttest: {\n\t\t\t\t\t\t\t\tname: 'browser',\n\t\t\t\t\t\t\t\tinclude: ['src/**/*.test.tsx', 'tests/**/*.test.tsx'],\n\t\t\t\t\t\t\t\tsetupFiles: [stylesSetup],\n\t\t\t\t\t\t\t\tbrowser: {\n\t\t\t\t\t\t\t\t\tinstances: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tbrowser: 'chromium',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tprovider: playwright(),\n\t\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\t\theadless: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} satisfies TestProjectConfiguration,\n\t\t\t\t\t\tprojectOverrides.browser ?? {},\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t},\n\t\t}),\n\t\toverrides,\n\t)\n}\n\nconst isVitest = process.env.VITEST === 'true'\n\nfunction createFrameworkConfig(root: string) {\n\treturn defineConfig({\n\t\troot,\n\t\tresolve: {\n\t\t\ttsconfigPaths: true,\n\t\t\tdedupe: ['react', 'react-dom'],\n\t\t\talias: [\n\t\t\t\t{ find: '@/mocks', replacement: resolve(root, '__mocks__') },\n\t\t\t\t{ find: '@', replacement: resolve(root, 'src') },\n\t\t\t],\n\t\t},\n\t\tssr: {\n\t\t\tnoExternal: ['recharts'],\n\t\t},\n\t\tplugins: [\n\t\t\t...(isVitest ? [] : [devtools(), nitro(), tanstackStart()]),\n\t\t\ttailwindcss(),\n\t\t\tviteReact(),\n\t\t\tbabel({ presets: [reactCompilerPreset()] }),\n\t\t\tsvgr({\n\t\t\t\tinclude: '**/*.svg',\n\t\t\t\tsvgrOptions: { exportType: 'default' },\n\t\t\t}),\n\t\t],\n\t})\n}\n\n// Creates a full app config with customized test project overrides\nexport function createAppConfig(\n\troot: string,\n\tprojectOverrides: ProjectOverrides = {},\n\toverrides: TestProjectInlineConfiguration = {},\n) {\n\treturn mergeConfig(\n\t\tcreateFrameworkConfig(root),\n\t\tcreateBaseConfig(root, overrides, projectOverrides),\n\t)\n}\n\n// Helper to create config from import.meta.url\nexport function baseConfigFor(configUrl: string | URL) {\n\tconst root = dirname(fileURLToPath(configUrl))\n\treturn createAppConfig(root)\n}\n\n// Workspace-level Vite+ config shared by monorepo roots.\nexport const workspaceConfig = {\n\tfmt: {\n\t\tsingleQuote: true,\n\t\tsemi: false,\n\t\tuseTabs: true,\n\t\texperimentalTailwindcss: {},\n\t\tprintWidth: 80,\n\t\texperimentalSortPackageJson: false,\n\t\tproseWrap: 'always',\n\t\tignorePatterns: [\n\t\t\t'**/.vercel',\n\t\t\t'**/.output',\n\t\t\t'**/dist/**',\n\t\t\t'**/env.d.ts',\n\t\t\t'pnpm-lock.yaml',\n\t\t\t'routeTree.gen.ts',\n\t\t\t'infra/manifests/gitops/flux-system/gotk-components.yaml',\n\t\t\t'infra/charts/**/templates/**/*.{yml,yaml}',\n\t\t\t'**/charts/**',\n\t\t\t'**/*.yaml',\n\t\t\t'**/*.yml',\n\t\t],\n\t\toverrides: [\n\t\t\t{\n\t\t\t\tfiles: ['*.{yaml,yml}'],\n\t\t\t\toptions: {\n\t\t\t\t\tuseTabs: false,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tlint: {\n\t\tplugins: [\n\t\t\t'eslint',\n\t\t\t'unicorn',\n\t\t\t'typescript',\n\t\t\t'oxc',\n\t\t\t'react',\n\t\t\t'react-perf',\n\t\t\t'import',\n\t\t\t'jsdoc',\n\t\t\t'jsx-a11y',\n\t\t\t'node',\n\t\t\t'promise',\n\t\t],\n\t\tcategories: {},\n\t\toptions: {\n\t\t\ttypeAware: true,\n\t\t\ttypeCheck: true,\n\t\t},\n\t\trules: {\n\t\t\t'no-empty-pattern': 'off',\n\t\t\t'no-console': ['error', { allow: ['warn', 'error'] }],\n\t\t},\n\t\tsettings: {\n\t\t\t'jsx-a11y': {\n\t\t\t\tcomponents: {},\n\t\t\t\tattributes: {},\n\t\t\t},\n\t\t\treact: {\n\t\t\t\tformComponents: [],\n\t\t\t\tlinkComponents: [],\n\t\t\t},\n\t\t\tjsdoc: {\n\t\t\t\tignorePrivate: false,\n\t\t\t\tignoreInternal: false,\n\t\t\t\tignoreReplacesDocs: true,\n\t\t\t\toverrideReplacesDocs: true,\n\t\t\t\taugmentsExtendsReplacesDocs: false,\n\t\t\t\timplementsReplacesDocs: false,\n\t\t\t\texemptDestructuredRootsFromChecks: false,\n\t\t\t\ttagNamePreference: {},\n\t\t\t},\n\t\t},\n\t\tenv: {\n\t\t\tbuiltin: true,\n\t\t},\n\t\tglobals: {},\n\t\tignorePatterns: ['**/dist/**'],\n\t\toverrides: [\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.unit.ts'],\n\t\t\t\trules: {\n\t\t\t\t\t'eslint/no-restricted-imports': [\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpatterns: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tgroup: ['@aamini/config-testing/test/*'],\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Unit tests should not import test fixtures. Use plain vitest imports instead.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.tsx'],\n\t\t\t\trules: {\n\t\t\t\t\t'eslint/no-restricted-imports': [\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpaths: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: '@aamini/config-testing/test/server',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Browser tests (*.test.tsx) should use test/browser, not test/server.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: '@aamini/config-testing/test/db',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Browser tests (*.test.tsx) should use test/browser, not test/db.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.ts'],\n\t\t\t\trules: {\n\t\t\t\t\t'eslint/no-restricted-imports': [\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpaths: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: '@aamini/config-testing/test/browser',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Server tests (*.test.ts) should use test/server or test/db, not test/browser.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['apps/**'],\n\t\t\t\tplugins: ['typescript', 'react'],\n\t\t\t\trules: {\n\t\t\t\t\t'react/self-closing-comp': 'error',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.ts', '**/*.test.tsx'],\n\t\t\t\tplugins: ['typescript', 'vitest'],\n\t\t\t\trules: {\n\t\t\t\t\t'@typescript-eslint/no-explicit-any': 'off',\n\t\t\t\t\t'vitest/no-standalone-expect': [\n\t\t\t\t\t\t'warn',\n\t\t\t\t\t\t{ additionalTestBlockFunctions: ['test', 'test.skip'] },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/scripts/**', '**/src/lib/imdb/**'],\n\t\t\t\trules: {\n\t\t\t\t\t'no-console': 'off',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tstaged: {\n\t\t'*.{js,ts,tsx}': 'vp check --fix',\n\t},\n}\n"],"mappings":"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GACD;IACC,OAAO,CAAC,gBAAgB;IACxB,OAAO,EACN,gCAAgC,CAC/B,SACA,EACC,OAAO,CACN;KACC,MAAM;KACN,SACC;KACD,EACD;KACC,MAAM;KACN,SACC;KACD,CACD,EACD,CACD,EACD;IACD;GACD;IACC,OAAO,CAAC,eAAe;IACvB,OAAO,EACN,gCAAgC,CAC/B,SACA,EACC,OAAO,CACN;KACC,MAAM;KACN,SACC;KACD,CACD,EACD,CACD,EACD;IACD;GACD;IACC,OAAO,CAAC,UAAU;IAClB,SAAS,CAAC,cAAc,QAAQ;IAChC,OAAO,EACN,2BAA2B,SAC3B;IACD;GACD;IACC,OAAO,CAAC,gBAAgB,gBAAgB;IACxC,SAAS,CAAC,cAAc,SAAS;IACjC,OAAO;KACN,sCAAsC;KACtC,+BAA+B,CAC9B,QACA,EAAE,8BAA8B,CAAC,QAAQ,YAAY,EAAE,CACvD;KACD;IACD;GACD;IACC,OAAO,CAAC,iBAAiB,qBAAqB;IAC9C,OAAO,EACN,cAAc,OACd;IACD;GACD;EACD;CACD,QAAQ,EACP,iBAAiB,kBACjB;CACD"}
|
|
1
|
+
{"version":3,"file":"vite.shared.mjs","names":["defineVitestConfig","defineConfig"],"sources":["../vite.shared.ts"],"sourcesContent":["import { nitro } from 'nitro/vite'\nimport { devtools } from '@tanstack/devtools-vite'\nimport { tanstackStart } from '@tanstack/react-start/plugin/vite'\nimport viteReact, { reactCompilerPreset } from '@vitejs/plugin-react'\nimport tailwindcss from '@tailwindcss/vite'\nimport babel from '@rolldown/plugin-babel'\nimport svgr from 'vite-plugin-svgr'\nimport { existsSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Plugin } from 'vite'\nimport {\n\tdefineConfig as defineVitestConfig,\n\tmergeConfig,\n\ttype TestProjectConfiguration,\n\ttype TestProjectInlineConfiguration,\n} from 'vitest/config'\nimport { defineConfig } from 'vite'\nimport { playwright } from 'vite-plus/test/browser-playwright'\n\nconst HANDLER_LOCATIONS = [\n\t'__mocks__/handlers.ts',\n\t'__mocks__/handlers.js',\n\t'src/mocks/handlers.ts',\n\t'src/mocks/handlers.js',\n]\n\nconst STYLES_LOCATIONS = ['src/styles.css', 'src/index.css', 'src/app.css']\n\nfunction mswHandlersPlugin(root: string): Plugin {\n\tconst virtualModuleId = '@test/handlers'\n\tconst resolvedVirtualModuleId = '\\0' + virtualModuleId\n\n\treturn {\n\t\tname: 'msw-handlers-resolver',\n\t\tresolveId(id) {\n\t\t\tif (id === virtualModuleId) {\n\t\t\t\treturn resolvedVirtualModuleId\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t\tload(id) {\n\t\t\tif (id === resolvedVirtualModuleId) {\n\t\t\t\tfor (const location of HANDLER_LOCATIONS) {\n\t\t\t\t\tconst fullPath = resolve(root, location)\n\t\t\t\t\tif (existsSync(fullPath)) {\n\t\t\t\t\t\treturn `export { default } from '${fullPath}'`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No MSW handlers found. Expected one of:\\n${HANDLER_LOCATIONS.map((l) => ` - ${resolve(root, l)}`).join('\\n')}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t}\n}\n\nfunction stylesPlugin(root: string): Plugin {\n\tconst virtualModuleId = '@test/styles'\n\tconst resolvedVirtualModuleId = '\\0' + virtualModuleId\n\n\treturn {\n\t\tname: 'styles-resolver',\n\t\tresolveId(id) {\n\t\t\tif (id === virtualModuleId) {\n\t\t\t\treturn resolvedVirtualModuleId\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t\tload(id) {\n\t\t\tif (id === resolvedVirtualModuleId) {\n\t\t\t\tfor (const location of STYLES_LOCATIONS) {\n\t\t\t\t\tconst fullPath = resolve(root, location)\n\t\t\t\t\tif (existsSync(fullPath)) {\n\t\t\t\t\t\treturn `import '${fullPath}'`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No styles file found. Expected one of:\\n${STYLES_LOCATIONS.map((l) => ` - ${resolve(root, l)}`).join('\\n')}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\t}\n}\n\nconst stylesSetup = '@aamini/config/setup/styles'\n\nfunction mergeProjectConfig(\n\tbase: TestProjectConfiguration,\n\toverrides: TestProjectConfiguration = {},\n): TestProjectConfiguration {\n\treturn mergeConfig(\n\t\tbase as Record<string, any>,\n\t\toverrides as Record<string, any>,\n\t) as TestProjectConfiguration\n}\n\ninterface ProjectOverrides {\n\tserver?: TestProjectConfiguration\n\tbrowser?: TestProjectConfiguration\n}\n\nfunction createBaseConfig(\n\troot: string,\n\toverrides: TestProjectInlineConfiguration = {},\n\tprojectOverrides: ProjectOverrides = {},\n) {\n\tconst localSetup = resolve(root, 'vitest.setup.ts')\n\tconst hasLocalSetup = existsSync(localSetup)\n\n\treturn mergeConfig(\n\t\tdefineVitestConfig({\n\t\t\troot,\n\t\t\tresolve: {\n\t\t\t\ttsconfigPaths: true,\n\t\t\t\tdedupe: ['react', 'react-dom'],\n\t\t\t\talias: [\n\t\t\t\t\t{ find: '@/mocks', replacement: resolve(root, '__mocks__') },\n\t\t\t\t\t{ find: '@', replacement: resolve(root, 'src') },\n\t\t\t\t],\n\t\t\t},\n\t\t\tplugins: [\n\t\t\t\ttailwindcss(),\n\t\t\t\tsvgr({\n\t\t\t\t\tinclude: '**/*.svg',\n\t\t\t\t\tsvgrOptions: { exportType: 'default' },\n\t\t\t\t}),\n\t\t\t],\n\t\t\ttest: {\n\t\t\t\tpassWithNoTests: true,\n\t\t\t\texclude: [\n\t\t\t\t\t'**/node_modules/**',\n\t\t\t\t\t'**/dist/**',\n\t\t\t\t\t'**/.output/**',\n\t\t\t\t\t'**/.vercel/**',\n\t\t\t\t\t'**/cypress/**',\n\t\t\t\t\t'**/.{idea,git,cache,output,temp}/**',\n\t\t\t\t\t'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',\n\t\t\t\t\t'**/e2e/**',\n\t\t\t\t],\n\t\t\t\tprojects: [\n\t\t\t\t\t{\n\t\t\t\t\t\textends: true,\n\t\t\t\t\t\ttest: {\n\t\t\t\t\t\t\tname: 'unit',\n\t\t\t\t\t\t\tinclude: ['src/**/*.test.unit.ts'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tmergeProjectConfig(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\textends: true,\n\t\t\t\t\t\t\tplugins: [mswHandlersPlugin(root)],\n\t\t\t\t\t\t\ttest: {\n\t\t\t\t\t\t\t\tname: 'server',\n\t\t\t\t\t\t\t\tinclude: ['src/**/*.test.ts'],\n\t\t\t\t\t\t\t\texclude: ['src/**/*.test.unit.ts', 'src/**/*.test.tsx'],\n\t\t\t\t\t\t\t\ttestTimeout: 30_000,\n\t\t\t\t\t\t\t\tfileParallelism: false,\n\t\t\t\t\t\t\t\tsetupFiles: hasLocalSetup ? [localSetup] : [],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} satisfies TestProjectConfiguration,\n\t\t\t\t\t\tprojectOverrides.server ?? {},\n\t\t\t\t\t),\n\t\t\t\t\tmergeProjectConfig(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\textends: true,\n\t\t\t\t\t\t\tplugins: [mswHandlersPlugin(root), stylesPlugin(root)],\n\t\t\t\t\t\t\ttest: {\n\t\t\t\t\t\t\t\tname: 'browser',\n\t\t\t\t\t\t\t\tinclude: ['src/**/*.test.tsx', 'tests/**/*.test.tsx'],\n\t\t\t\t\t\t\t\tsetupFiles: [stylesSetup],\n\t\t\t\t\t\t\t\tbrowser: {\n\t\t\t\t\t\t\t\t\tinstances: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tbrowser: 'chromium',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tprovider: playwright(),\n\t\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\t\theadless: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} satisfies TestProjectConfiguration,\n\t\t\t\t\t\tprojectOverrides.browser ?? {},\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t},\n\t\t}),\n\t\toverrides,\n\t)\n}\n\nconst isVitest = process.env.VITEST === 'true'\n\nfunction createFrameworkConfig(root: string) {\n\treturn defineConfig({\n\t\troot,\n\t\tresolve: {\n\t\t\ttsconfigPaths: true,\n\t\t\tdedupe: ['react', 'react-dom'],\n\t\t\talias: [\n\t\t\t\t{ find: '@/mocks', replacement: resolve(root, '__mocks__') },\n\t\t\t\t{ find: '@', replacement: resolve(root, 'src') },\n\t\t\t],\n\t\t},\n\t\tssr: {\n\t\t\tnoExternal: ['recharts'],\n\t\t},\n\t\tplugins: [\n\t\t\t...(isVitest ? [] : [devtools(), nitro(), tanstackStart()]),\n\t\t\ttailwindcss(),\n\t\t\tviteReact(),\n\t\t\tbabel({ presets: [reactCompilerPreset()] }),\n\t\t\tsvgr({\n\t\t\t\tinclude: '**/*.svg',\n\t\t\t\tsvgrOptions: { exportType: 'default' },\n\t\t\t}),\n\t\t],\n\t})\n}\n\n// Creates a full app config with customized test project overrides\nexport function createAppConfig(\n\troot: string,\n\tprojectOverrides: ProjectOverrides = {},\n\toverrides: TestProjectInlineConfiguration = {},\n) {\n\treturn {\n\t\t...workspaceConfig,\n\t\t...mergeConfig(\n\t\t\tcreateFrameworkConfig(root),\n\t\t\tcreateBaseConfig(root, overrides, projectOverrides),\n\t\t),\n\t}\n}\n\n// Helper to create config from import.meta.url\nexport function baseConfigFor(configUrl: string | URL) {\n\tconst root = dirname(fileURLToPath(configUrl))\n\treturn createAppConfig(root)\n}\n\n// Workspace-level Vite+ config shared by monorepo roots.\nexport const workspaceConfig = {\n\tfmt: {\n\t\tsingleQuote: true,\n\t\tsemi: false,\n\t\tuseTabs: true,\n\t\texperimentalTailwindcss: {},\n\t\tprintWidth: 80,\n\t\texperimentalSortPackageJson: false,\n\t\tproseWrap: 'always',\n\t\tignorePatterns: [\n\t\t\t'**/.vercel',\n\t\t\t'**/.output',\n\t\t\t'**/dist/**',\n\t\t\t'**/env.d.ts',\n\t\t\t'pnpm-lock.yaml',\n\t\t\t'**/routeTree.gen.ts',\n\t\t\t'infra/manifests/gitops/flux-system/gotk-components.yaml',\n\t\t\t'infra/charts/**/templates/**/*.{yml,yaml}',\n\t\t\t'**/charts/**',\n\t\t\t'**/*.yaml',\n\t\t\t'**/*.yml',\n\t\t],\n\t\toverrides: [\n\t\t\t{\n\t\t\t\tfiles: ['*.{yaml,yml}'],\n\t\t\t\toptions: {\n\t\t\t\t\tuseTabs: false,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tlint: {\n\t\tplugins: [\n\t\t\t'eslint',\n\t\t\t'unicorn',\n\t\t\t'typescript',\n\t\t\t'oxc',\n\t\t\t'react',\n\t\t\t'react-perf',\n\t\t\t'import',\n\t\t\t'jsdoc',\n\t\t\t'jsx-a11y',\n\t\t\t'node',\n\t\t\t'promise',\n\t\t],\n\t\tcategories: {},\n\t\toptions: {\n\t\t\ttypeAware: true,\n\t\t\ttypeCheck: true,\n\t\t},\n\t\trules: {\n\t\t\t'no-empty-pattern': 'off',\n\t\t\t'no-console': ['error', { allow: ['warn', 'error'] }],\n\t\t},\n\t\tsettings: {\n\t\t\t'jsx-a11y': {\n\t\t\t\tcomponents: {},\n\t\t\t\tattributes: {},\n\t\t\t},\n\t\t\treact: {\n\t\t\t\tformComponents: [],\n\t\t\t\tlinkComponents: [],\n\t\t\t},\n\t\t\tjsdoc: {\n\t\t\t\tignorePrivate: false,\n\t\t\t\tignoreInternal: false,\n\t\t\t\tignoreReplacesDocs: true,\n\t\t\t\toverrideReplacesDocs: true,\n\t\t\t\taugmentsExtendsReplacesDocs: false,\n\t\t\t\timplementsReplacesDocs: false,\n\t\t\t\texemptDestructuredRootsFromChecks: false,\n\t\t\t\ttagNamePreference: {},\n\t\t\t},\n\t\t},\n\t\tenv: {\n\t\t\tbuiltin: true,\n\t\t},\n\t\tglobals: {},\n\t\tignorePatterns: ['**/dist/**'],\n\t\toverrides: [\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.unit.ts'],\n\t\t\t\trules: {\n\t\t\t\t\t'eslint/no-restricted-imports': [\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpatterns: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tgroup: ['@aamini/config-testing/test/*'],\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Unit tests should not import test fixtures. Use plain vitest imports instead.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.tsx'],\n\t\t\t\trules: {\n\t\t\t\t\t'eslint/no-restricted-imports': [\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpaths: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: '@aamini/config-testing/test/server',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Browser tests (*.test.tsx) should use test/browser, not test/server.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: '@aamini/config-testing/test/db',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Browser tests (*.test.tsx) should use test/browser, not test/db.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.ts'],\n\t\t\t\trules: {\n\t\t\t\t\t'eslint/no-restricted-imports': [\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpaths: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: '@aamini/config-testing/test/browser',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t'Server tests (*.test.ts) should use test/server or test/db, not test/browser.',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['apps/**'],\n\t\t\t\tplugins: ['typescript', 'react'],\n\t\t\t\trules: {\n\t\t\t\t\t'react/self-closing-comp': 'error',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.ts', '**/*.test.tsx'],\n\t\t\t\tplugins: ['typescript', 'vitest'],\n\t\t\t\trules: {\n\t\t\t\t\t'@typescript-eslint/no-explicit-any': 'off',\n\t\t\t\t\t'vitest/no-standalone-expect': [\n\t\t\t\t\t\t'warn',\n\t\t\t\t\t\t{ additionalTestBlockFunctions: ['test', 'test.skip'] },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/scripts/**', '**/src/lib/imdb/**'],\n\t\t\t\trules: {\n\t\t\t\t\t'no-console': 'off',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tstaged: {\n\t\t'*.{js,ts,tsx}': 'vp check --fix',\n\t},\n}\n"],"mappings":"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AAgB;IACxB,OAAO,EACN,gCAAgC,CAC/B,SACA,EACC,OAAO,CACN;KACC,MAAM;KACN,SACC;KACD,EACD;KACC,MAAM;KACN,SACC;KACD,CACD,EACD,CACD,EACD;IACD;GACD;IACC,OAAO,CAAC,eAAe;IACvB,OAAO,EACN,gCAAgC,CAC/B,SACA,EACC,OAAO,CACN;KACC,MAAM;KACN,SACC;KACD,CACD,EACD,CACD,EACD;IACD;GACD;IACC,OAAO,CAAC,UAAU;IAClB,SAAS,CAAC,cAAc,QAAQ;IAChC,OAAO,EACN,2BAA2B,SAC3B;IACD;GACD;IACC,OAAO,CAAC,gBAAgB,gBAAgB;IACxC,SAAS,CAAC,cAAc,SAAS;IACjC,OAAO;KACN,sCAAsC;KACtC,+BAA+B,CAC9B,QACA,EAAE,8BAA8B,CAAC,QAAQ,YAAY,EAAE,CACvD;KACD;IACD;GACD;IACC,OAAO,CAAC,iBAAiB,qBAAqB;IAC9C,OAAO,EACN,cAAc,OACd;IACD;GACD;EACD;CACD,QAAQ,EACP,iBAAiB,kBACjB;CACD"}
|
package/dist/vitest.shared.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ interface ProjectOverrides {
|
|
|
5
5
|
server?: TestProjectConfiguration;
|
|
6
6
|
browser?: TestProjectConfiguration;
|
|
7
7
|
}
|
|
8
|
-
declare const createBaseConfig: (overrides: TestProjectInlineConfiguration, projectOverrides?: ProjectOverrides) => any
|
|
9
|
-
declare const baseConfig: any
|
|
8
|
+
declare const createBaseConfig: (overrides: TestProjectInlineConfiguration, projectOverrides?: ProjectOverrides) => Record<string, any>;
|
|
9
|
+
declare const baseConfig: Record<string, any>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { baseConfig, createBaseConfig };
|
|
12
12
|
//# sourceMappingURL=vitest.shared.d.mts.map
|
package/package.json
CHANGED
package/test/browser.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
// oxlint-disable typescript-eslint/triple-slash-reference
|
|
2
|
+
/// <reference path="../virtual-modules.d.ts" />
|
|
1
3
|
// oxlint-disable no-empty-pattern
|
|
2
4
|
import { setupWorker, type SetupWorker } from 'msw/browser'
|
|
3
5
|
import { test as baseTest } from 'vitest'
|
|
4
|
-
import {
|
|
6
|
+
import type { TestAPI } from 'vitest'
|
|
5
7
|
|
|
6
8
|
export interface MswBrowserFixture {
|
|
7
9
|
worker: SetupWorker
|
|
@@ -12,36 +14,31 @@ let workerSingleton: SetupWorker | undefined
|
|
|
12
14
|
|
|
13
15
|
async function ensureWorker(): Promise<SetupWorker> {
|
|
14
16
|
if (!workerSingleton) {
|
|
15
|
-
const { default: handlers } = await import(
|
|
17
|
+
const { default: handlers } = await import('@test/handlers')
|
|
16
18
|
workerSingleton = setupWorker(...handlers)
|
|
17
19
|
}
|
|
18
20
|
return workerSingleton
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
const extended = baseTest.extend<MswBrowserFixture>({
|
|
24
|
+
worker: [
|
|
25
|
+
async ({}, use) => {
|
|
26
|
+
const worker = await ensureWorker()
|
|
27
|
+
await worker.start({ quiet: true, onUnhandledRequest: 'bypass' })
|
|
28
|
+
await use(worker)
|
|
29
|
+
worker.stop()
|
|
30
|
+
},
|
|
31
|
+
{ auto: true, scope: 'worker' },
|
|
32
|
+
],
|
|
33
|
+
_cleanup: [
|
|
34
|
+
async ({ worker }, use) => {
|
|
35
|
+
await use()
|
|
36
|
+
worker.resetHandlers()
|
|
37
|
+
},
|
|
38
|
+
{ auto: true },
|
|
39
|
+
],
|
|
40
|
+
})
|
|
22
41
|
|
|
23
|
-
|
|
24
|
-
if (!extended) {
|
|
25
|
-
extended = baseTest.extend<MswBrowserFixture>({
|
|
26
|
-
worker: [
|
|
27
|
-
async ({}, use) => {
|
|
28
|
-
const worker = await ensureWorker()
|
|
29
|
-
await worker.start({ quiet: true, onUnhandledRequest: 'bypass' })
|
|
30
|
-
await use(worker)
|
|
31
|
-
worker.stop()
|
|
32
|
-
},
|
|
33
|
-
{ auto: true, scope: 'worker' },
|
|
34
|
-
],
|
|
35
|
-
_cleanup: [
|
|
36
|
-
async ({ worker }, use) => {
|
|
37
|
-
await use()
|
|
38
|
-
worker.resetHandlers()
|
|
39
|
-
},
|
|
40
|
-
{ auto: true },
|
|
41
|
-
],
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
return extended
|
|
45
|
-
}
|
|
42
|
+
export { afterEach, beforeEach, describe, expect, vi } from 'vitest'
|
|
46
43
|
|
|
47
|
-
export const test =
|
|
44
|
+
export const test = extended as TestAPI<MswBrowserFixture>
|
package/test/db.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { setupServer, SetupServer } from 'msw/node'
|
|
3
3
|
import { resolve } from 'node:path'
|
|
4
4
|
import { test as baseTest } from 'vitest'
|
|
5
|
+
import type { TestAPI } from 'vitest'
|
|
5
6
|
import type { Database } from './database'
|
|
6
7
|
import { seedDatabase } from './database'
|
|
7
|
-
import {
|
|
8
|
+
import { findHandlerPath } from './internal'
|
|
8
9
|
|
|
9
10
|
const DEFAULT_SCHEMA_PATH = 'src/db/tables.ts'
|
|
10
11
|
const DEFAULT_MIGRATIONS_PATH = 'src/db/migrations'
|
|
@@ -27,64 +28,59 @@ async function ensureMswServer(): Promise<SetupServer> {
|
|
|
27
28
|
return mswServer
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
let extended
|
|
31
|
+
let extended = baseTest.extend<DbFixture>({
|
|
32
|
+
server: [
|
|
33
|
+
async ({}, use) => {
|
|
34
|
+
const server = await ensureMswServer()
|
|
35
|
+
server.listen({ onUnhandledRequest: 'bypass' })
|
|
36
|
+
await use(server)
|
|
37
|
+
server.close()
|
|
38
|
+
},
|
|
39
|
+
{ auto: true, scope: 'worker' },
|
|
40
|
+
],
|
|
41
|
+
_cleanup: [
|
|
42
|
+
async ({ server }, use) => {
|
|
43
|
+
await use()
|
|
44
|
+
server.resetHandlers()
|
|
45
|
+
},
|
|
46
|
+
{ auto: true },
|
|
47
|
+
],
|
|
48
|
+
seedFunction: [async ({}, use) => use(async () => {}), { scope: 'file' }],
|
|
49
|
+
db: [
|
|
50
|
+
async ({ seedFunction }: Pick<DbFixture, 'seedFunction'>, use) => {
|
|
51
|
+
const { PostgreSqlContainer } = await import('@testcontainers/postgresql')
|
|
52
|
+
const { drizzle } = await import('drizzle-orm/node-postgres')
|
|
53
|
+
const { Wait } = await import('testcontainers')
|
|
54
|
+
const { Pool } = await import('pg')
|
|
31
55
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
extended = baseTest.extend<DbFixture>({
|
|
35
|
-
server: [
|
|
36
|
-
async ({}, use) => {
|
|
37
|
-
const server = await ensureMswServer()
|
|
38
|
-
server.listen({ onUnhandledRequest: 'bypass' })
|
|
39
|
-
await use(server)
|
|
40
|
-
server.close()
|
|
41
|
-
},
|
|
42
|
-
{ auto: true, scope: 'worker' },
|
|
43
|
-
],
|
|
44
|
-
_cleanup: [
|
|
45
|
-
async ({ server }, use) => {
|
|
46
|
-
await use()
|
|
47
|
-
server.resetHandlers()
|
|
48
|
-
},
|
|
49
|
-
{ auto: true },
|
|
50
|
-
],
|
|
51
|
-
seedFunction: [async ({}, use) => use(async () => {}), { scope: 'file' }],
|
|
52
|
-
db: [
|
|
53
|
-
async ({ seedFunction }: Pick<DbFixture, 'seedFunction'>, use) => {
|
|
54
|
-
const { PostgreSqlContainer } = await import('@testcontainers/postgresql')
|
|
55
|
-
const { drizzle } = await import('drizzle-orm/node-postgres')
|
|
56
|
-
const { Wait } = await import('testcontainers')
|
|
57
|
-
const { Pool } = await import('pg')
|
|
56
|
+
const schemaPath = resolve(process.cwd(), DEFAULT_SCHEMA_PATH)
|
|
57
|
+
const migrationsFolder = resolve(process.cwd(), DEFAULT_MIGRATIONS_PATH)
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const container = await new PostgreSqlContainer(DEFAULT_IMAGE)
|
|
60
|
+
.withWaitStrategy(Wait.forHealthCheck())
|
|
61
|
+
.start()
|
|
62
|
+
const db = drizzle({
|
|
63
|
+
client: new Pool({ connectionString: container.getConnectionUri() }),
|
|
64
|
+
}) as Database
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
try {
|
|
67
|
+
await seedDatabase(db, { schemaPath, migrationsFolder, seedFunction })
|
|
68
|
+
await use(db)
|
|
69
|
+
} finally {
|
|
70
|
+
await db.$client.end()
|
|
71
|
+
await container.stop()
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{ scope: 'file' },
|
|
75
|
+
],
|
|
76
|
+
})
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
await seedDatabase(db, { schemaPath, migrationsFolder, seedFunction })
|
|
71
|
-
await use(db)
|
|
72
|
-
} finally {
|
|
73
|
-
await db.$client.end()
|
|
74
|
-
await container.stop()
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{ scope: 'file' },
|
|
78
|
-
],
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
return extended
|
|
82
|
-
}
|
|
78
|
+
export { afterEach, beforeEach, describe, expect, vi } from 'vitest'
|
|
83
79
|
|
|
84
|
-
export const test =
|
|
80
|
+
export const test = extended as TestAPI<DbFixture>
|
|
85
81
|
|
|
86
82
|
export function initDb(seedFunction: (db: Database) => Promise<void>) {
|
|
87
|
-
|
|
83
|
+
extended = extended.override({
|
|
88
84
|
seedFunction: [async ({}, use) => use(seedFunction), { scope: 'file' }],
|
|
89
|
-
})
|
|
85
|
+
}) as typeof extended
|
|
90
86
|
}
|
package/test/internal.ts
CHANGED
|
@@ -9,6 +9,9 @@ export const HANDLER_LOCATIONS = [
|
|
|
9
9
|
]
|
|
10
10
|
|
|
11
11
|
export function findHandlerPath(): string {
|
|
12
|
+
if (typeof process === 'undefined') {
|
|
13
|
+
return ''
|
|
14
|
+
}
|
|
12
15
|
const cwd = process.cwd()
|
|
13
16
|
for (const location of HANDLER_LOCATIONS) {
|
|
14
17
|
const fullPath = resolve(cwd, location)
|
|
@@ -37,5 +40,6 @@ export function createProxy<T extends object>(getTarget: () => T): T {
|
|
|
37
40
|
return Reflect.getOwnPropertyDescriptor(getTarget(), prop)
|
|
38
41
|
},
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
const proxyTarget = () => {}
|
|
44
|
+
return new Proxy(proxyTarget, handlers) as T
|
|
41
45
|
}
|
package/test/server.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// oxlint-disable no-empty-pattern
|
|
2
2
|
import { setupServer, type SetupServer } from 'msw/node'
|
|
3
3
|
import { test as baseTest } from 'vitest'
|
|
4
|
-
import {
|
|
4
|
+
import type { TestAPI } from 'vitest'
|
|
5
|
+
import { findHandlerPath } from './internal'
|
|
5
6
|
|
|
6
7
|
export interface MswServerFixture {
|
|
7
8
|
server: SetupServer
|
|
@@ -18,30 +19,25 @@ async function ensureMswServer(): Promise<SetupServer> {
|
|
|
18
19
|
return mswServer
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const extended = baseTest.extend<MswServerFixture>({
|
|
23
|
+
server: [
|
|
24
|
+
async ({}, use) => {
|
|
25
|
+
const server = await ensureMswServer()
|
|
26
|
+
server.listen({ onUnhandledRequest: 'bypass' })
|
|
27
|
+
await use(server)
|
|
28
|
+
server.close()
|
|
29
|
+
},
|
|
30
|
+
{ auto: true, scope: 'worker' },
|
|
31
|
+
],
|
|
32
|
+
_cleanup: [
|
|
33
|
+
async ({ server }, use) => {
|
|
34
|
+
await use()
|
|
35
|
+
server.resetHandlers()
|
|
36
|
+
},
|
|
37
|
+
{ auto: true },
|
|
38
|
+
],
|
|
39
|
+
})
|
|
22
40
|
|
|
23
|
-
|
|
24
|
-
if (!extended) {
|
|
25
|
-
extended = baseTest.extend<MswServerFixture>({
|
|
26
|
-
server: [
|
|
27
|
-
async ({}, use) => {
|
|
28
|
-
const server = await ensureMswServer()
|
|
29
|
-
server.listen({ onUnhandledRequest: 'bypass' })
|
|
30
|
-
await use(server)
|
|
31
|
-
server.close()
|
|
32
|
-
},
|
|
33
|
-
{ auto: true, scope: 'worker' },
|
|
34
|
-
],
|
|
35
|
-
_cleanup: [
|
|
36
|
-
async ({ server }, use) => {
|
|
37
|
-
await use()
|
|
38
|
-
server.resetHandlers()
|
|
39
|
-
},
|
|
40
|
-
{ auto: true },
|
|
41
|
-
],
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
return extended
|
|
45
|
-
}
|
|
41
|
+
export { afterEach, beforeEach, describe, expect, vi } from 'vitest'
|
|
46
42
|
|
|
47
|
-
export const test =
|
|
43
|
+
export const test = extended as TestAPI<MswServerFixture>
|
package/vite.shared.ts
CHANGED
|
@@ -85,7 +85,7 @@ function stylesPlugin(root: string): Plugin {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
const stylesSetup =
|
|
88
|
+
const stylesSetup = '@aamini/config/setup/styles'
|
|
89
89
|
|
|
90
90
|
function mergeProjectConfig(
|
|
91
91
|
base: TestProjectConfiguration,
|
|
@@ -123,7 +123,6 @@ function createBaseConfig(
|
|
|
123
123
|
},
|
|
124
124
|
plugins: [
|
|
125
125
|
tailwindcss(),
|
|
126
|
-
viteReact(),
|
|
127
126
|
svgr({
|
|
128
127
|
include: '**/*.svg',
|
|
129
128
|
svgrOptions: { exportType: 'default' },
|
|
@@ -228,10 +227,13 @@ export function createAppConfig(
|
|
|
228
227
|
projectOverrides: ProjectOverrides = {},
|
|
229
228
|
overrides: TestProjectInlineConfiguration = {},
|
|
230
229
|
) {
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
return {
|
|
231
|
+
...workspaceConfig,
|
|
232
|
+
...mergeConfig(
|
|
233
|
+
createFrameworkConfig(root),
|
|
234
|
+
createBaseConfig(root, overrides, projectOverrides),
|
|
235
|
+
),
|
|
236
|
+
}
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
// Helper to create config from import.meta.url
|
|
@@ -256,7 +258,7 @@ export const workspaceConfig = {
|
|
|
256
258
|
'**/dist/**',
|
|
257
259
|
'**/env.d.ts',
|
|
258
260
|
'pnpm-lock.yaml',
|
|
259
|
-
'routeTree.gen.ts',
|
|
261
|
+
'**/routeTree.gen.ts',
|
|
260
262
|
'infra/manifests/gitops/flux-system/gotk-components.yaml',
|
|
261
263
|
'infra/charts/**/templates/**/*.{yml,yaml}',
|
|
262
264
|
'**/charts/**',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-D6reJqHH.mjs","names":[],"sources":["../test/internal.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nexport const HANDLER_LOCATIONS = [\n\t'__mocks__/handlers.ts',\n\t'__mocks__/handlers.js',\n\t'src/mocks/handlers.ts',\n\t'src/mocks/handlers.js',\n]\n\nexport function findHandlerPath(): string {\n\tconst cwd = process.cwd()\n\tfor (const location of HANDLER_LOCATIONS) {\n\t\tconst fullPath = resolve(cwd, location)\n\t\tif (existsSync(fullPath)) return fullPath\n\t}\n\tthrow new Error(\n\t\t`No MSW handlers found. Expected one of:\\n${HANDLER_LOCATIONS.map((l) => ` - ${resolve(cwd, l)}`).join('\\n')}`,\n\t)\n}\n\nexport function createProxy<T extends object>(getTarget: () => T): T {\n\tconst handlers: ProxyHandler<object> = {\n\t\tget(_, prop) {\n\t\t\treturn Reflect.get(getTarget(), prop, getTarget())\n\t\t},\n\t\tapply(target, thisArg, args) {\n\t\t\treturn Reflect.apply(getTarget() as any, thisArg, args)\n\t\t},\n\t\thas(_, prop) {\n\t\t\treturn prop in getTarget()\n\t\t},\n\t\townKeys() {\n\t\t\treturn Reflect.ownKeys(getTarget())\n\t\t},\n\t\tgetOwnPropertyDescriptor(_, prop) {\n\t\t\treturn Reflect.getOwnPropertyDescriptor(getTarget(), prop)\n\t\t},\n\t}\n\treturn new Proxy({}, handlers) as T\n}\n"],"mappings":";;;AAGA,MAAa,oBAAoB;CAChC;CACA;CACA;CACA;CACA;AAED,SAAgB,kBAA0B;CACzC,MAAM,MAAM,QAAQ,KAAK;CACzB,KAAK,MAAM,YAAY,mBAAmB;EACzC,MAAM,WAAW,QAAQ,KAAK,SAAS;EACvC,IAAI,WAAW,SAAS,EAAE,OAAO;;CAElC,MAAM,IAAI,MACT,4CAA4C,kBAAkB,KAAK,MAAM,OAAO,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,GAC7G;;AAGF,SAAgB,YAA8B,WAAuB;CAkBpE,OAAO,IAAI,MAAM,EAAE,EAAE;EAhBpB,IAAI,GAAG,MAAM;GACZ,OAAO,QAAQ,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;;EAEnD,MAAM,QAAQ,SAAS,MAAM;GAC5B,OAAO,QAAQ,MAAM,WAAW,EAAS,SAAS,KAAK;;EAExD,IAAI,GAAG,MAAM;GACZ,OAAO,QAAQ,WAAW;;EAE3B,UAAU;GACT,OAAO,QAAQ,QAAQ,WAAW,CAAC;;EAEpC,yBAAyB,GAAG,MAAM;GACjC,OAAO,QAAQ,yBAAyB,WAAW,EAAE,KAAK;;EAG/B,CAAC"}
|