@ykdz/template 0.0.32 → 0.0.35
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/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +40 -14
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.d.ts +1 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.js +17 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +1 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +9 -10
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +6 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +6 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment-diagnostics.yml +81 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment.yml +55 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-diagnostics.yml +64 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +24 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/github-cli.Dockerfile +9 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/src/readiness.ts +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/test/global-setup.ts +21 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +6 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/vitest.config.ts +7 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/drizzle.config.ts +5 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/playwright.config.ts +103 -22
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/test/playwright-teardown.ts +12 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/vite.config.ts +39 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/playwright.config.ts +50 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/playwright.config.ts +61 -8
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.d.ts +19 -0
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.js +68 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +3 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +7 -0
- package/node_modules/@ykdz/template-core/dist/project-github.d.ts +50 -6
- package/node_modules/@ykdz/template-core/dist/project-github.js +83 -47
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +15 -1
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +162 -1
- package/package.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-playwright.yml +0 -20
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-rust.yml +0 -23
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.dynamic.template +0 -19
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/scripts/prepare-database.ts +0 -45
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/run-playwright.ts +0 -151
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/scripts/run-playwright.ts +0 -62
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/scripts/run-playwright.ts +0 -103
package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/scripts/run-playwright.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { createServer } from "node:net";
|
|
3
|
-
|
|
4
|
-
async function availablePort(): Promise<string> {
|
|
5
|
-
return await new Promise((resolve, reject) => {
|
|
6
|
-
const server = createServer();
|
|
7
|
-
|
|
8
|
-
server.once("error", reject);
|
|
9
|
-
server.listen(0, "127.0.0.1", () => {
|
|
10
|
-
const address = server.address();
|
|
11
|
-
|
|
12
|
-
if (typeof address !== "object" || address === null) {
|
|
13
|
-
server.close(() => {
|
|
14
|
-
reject(new Error("Could not allocate a Playwright web port"));
|
|
15
|
-
});
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const port = String(address.port);
|
|
20
|
-
server.close((error) => {
|
|
21
|
-
if (error) {
|
|
22
|
-
reject(error);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
resolve(port);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async function playwrightEnv(): Promise<NodeJS.ProcessEnv> {
|
|
33
|
-
return {
|
|
34
|
-
...process.env,
|
|
35
|
-
PLAYWRIGHT_WEB_PORT:
|
|
36
|
-
process.env.PLAYWRIGHT_WEB_PORT ?? (await availablePort()),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const env = await playwrightEnv();
|
|
41
|
-
delete env.NO_COLOR;
|
|
42
|
-
|
|
43
|
-
const command = process.platform === "win32" ? "playwright.cmd" : "playwright";
|
|
44
|
-
const child = spawn(command, ["test", ...process.argv.slice(2)], {
|
|
45
|
-
env,
|
|
46
|
-
stdio: "inherit",
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
child.once("error", (error: Error) => {
|
|
50
|
-
console.error(error);
|
|
51
|
-
process.exitCode = 1;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
child.once("exit", (code: number | null, signal: NodeJS.Signals | null) => {
|
|
55
|
-
if (signal) {
|
|
56
|
-
console.error(`Playwright exited with signal ${signal}`);
|
|
57
|
-
process.exitCode = 1;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
process.exitCode = code ?? 1;
|
|
62
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { createServer } from "node:net";
|
|
3
|
-
|
|
4
|
-
async function listenOnAvailablePort(): Promise<{
|
|
5
|
-
readonly port: string;
|
|
6
|
-
readonly server: ReturnType<typeof createServer>;
|
|
7
|
-
}> {
|
|
8
|
-
return await new Promise((resolve, reject) => {
|
|
9
|
-
const server = createServer();
|
|
10
|
-
|
|
11
|
-
server.once("error", reject);
|
|
12
|
-
server.listen(0, "127.0.0.1", () => {
|
|
13
|
-
const address = server.address();
|
|
14
|
-
|
|
15
|
-
if (typeof address !== "object" || address === null) {
|
|
16
|
-
server.close(() => {
|
|
17
|
-
reject(new Error("Could not allocate a Playwright server port"));
|
|
18
|
-
});
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
resolve({ port: String(address.port), server });
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function availablePorts(count: number): Promise<string[]> {
|
|
28
|
-
const leases: Array<{
|
|
29
|
-
readonly port: string;
|
|
30
|
-
readonly server: ReturnType<typeof createServer>;
|
|
31
|
-
}> = [];
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
for (let index = 0; index < count; index += 1) {
|
|
35
|
-
leases.push(await listenOnAvailablePort());
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return leases.map((lease) => lease.port);
|
|
39
|
-
} finally {
|
|
40
|
-
await Promise.all(
|
|
41
|
-
leases.map(
|
|
42
|
-
(lease) =>
|
|
43
|
-
new Promise<void>((resolve, reject) => {
|
|
44
|
-
lease.server.close((error) => {
|
|
45
|
-
if (error) {
|
|
46
|
-
reject(error);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
resolve();
|
|
51
|
-
});
|
|
52
|
-
}),
|
|
53
|
-
),
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
async function playwrightEnv(): Promise<NodeJS.ProcessEnv> {
|
|
59
|
-
const missingPortNames = [
|
|
60
|
-
process.env.PLAYWRIGHT_API_PORT === undefined
|
|
61
|
-
? "PLAYWRIGHT_API_PORT"
|
|
62
|
-
: undefined,
|
|
63
|
-
process.env.PLAYWRIGHT_WEB_PORT === undefined
|
|
64
|
-
? "PLAYWRIGHT_WEB_PORT"
|
|
65
|
-
: undefined,
|
|
66
|
-
].filter((name) => name !== undefined);
|
|
67
|
-
const ports = await availablePorts(missingPortNames.length);
|
|
68
|
-
const allocatedPorts = Object.fromEntries(
|
|
69
|
-
missingPortNames.map((name, index) => [name, ports[index]]),
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
...process.env,
|
|
74
|
-
PLAYWRIGHT_API_PORT:
|
|
75
|
-
process.env.PLAYWRIGHT_API_PORT ?? allocatedPorts.PLAYWRIGHT_API_PORT,
|
|
76
|
-
PLAYWRIGHT_WEB_PORT:
|
|
77
|
-
process.env.PLAYWRIGHT_WEB_PORT ?? allocatedPorts.PLAYWRIGHT_WEB_PORT,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const env = await playwrightEnv();
|
|
82
|
-
delete env.NO_COLOR;
|
|
83
|
-
|
|
84
|
-
const command = process.platform === "win32" ? "playwright.cmd" : "playwright";
|
|
85
|
-
const child = spawn(command, ["test", ...process.argv.slice(2)], {
|
|
86
|
-
env,
|
|
87
|
-
stdio: "inherit",
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
child.once("error", (error: Error) => {
|
|
91
|
-
console.error(error);
|
|
92
|
-
process.exitCode = 1;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
child.once("exit", (code: number | null, signal: NodeJS.Signals | null) => {
|
|
96
|
-
if (signal) {
|
|
97
|
-
console.error(`Playwright exited with signal ${signal}`);
|
|
98
|
-
process.exitCode = 1;
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
process.exitCode = code ?? 1;
|
|
103
|
-
});
|