create-svc 0.1.67 → 0.1.69
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/package.json
CHANGED
package/src/scaffold.test.ts
CHANGED
|
@@ -146,6 +146,9 @@ test("scaffolds all runtime/framework variants with shared cloudrun config", asy
|
|
|
146
146
|
expect(previewWorkflow).toContain("steps.pr.outputs.number");
|
|
147
147
|
expect(previewWorkflow).toContain("NEON_API_KEY");
|
|
148
148
|
expect(previewWorkflow).toContain("CLOUDFLARE_API_TOKEN");
|
|
149
|
+
if (variant.runtime === "go") {
|
|
150
|
+
expect(previewWorkflow).toContain("ariga/setup-atlas");
|
|
151
|
+
}
|
|
149
152
|
|
|
150
153
|
const previewCleanupWorkflow = await Bun.file(join(generatedRoot, ".github", "workflows", "preview-cleanup.yml")).text();
|
|
151
154
|
expect(previewCleanupWorkflow).toContain("pull_request:");
|
|
@@ -155,6 +158,9 @@ test("scaffolds all runtime/framework variants with shared cloudrun config", asy
|
|
|
155
158
|
const deployWorkflow = await Bun.file(join(generatedRoot, ".github", "workflows", "deploy.yml")).text();
|
|
156
159
|
expect(deployWorkflow).toContain("branches:");
|
|
157
160
|
expect(deployWorkflow).toContain("- main");
|
|
161
|
+
if (variant.runtime === "go") {
|
|
162
|
+
expect(deployWorkflow).toContain("ariga/setup-atlas");
|
|
163
|
+
}
|
|
158
164
|
expect(deployWorkflow).toContain("gcloud components install beta --quiet");
|
|
159
165
|
expect(deployWorkflow).toContain("bun install -g create-svc@latest");
|
|
160
166
|
expect(deployWorkflow).toContain("service deploy --ci");
|
|
@@ -166,6 +172,9 @@ test("scaffolds all runtime/framework variants with shared cloudrun config", asy
|
|
|
166
172
|
expect(personalWorkflow).toContain("workflow_dispatch:");
|
|
167
173
|
expect(personalWorkflow).toContain("service deploy --ci --environment personal --name");
|
|
168
174
|
expect(personalWorkflow).toContain("service deploy --ci --destroy --environment personal --name");
|
|
175
|
+
if (variant.runtime === "go") {
|
|
176
|
+
expect(personalWorkflow).toContain("ariga/setup-atlas");
|
|
177
|
+
}
|
|
169
178
|
|
|
170
179
|
if (variant.runtime === "go") {
|
|
171
180
|
const goMod = await Bun.file(join(generatedRoot, "go.mod")).text();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import { mkdir, readdir } from "node:fs/promises";
|
|
3
|
+
import { mkdir, readdir, stat } from "node:fs/promises";
|
|
4
4
|
import { ensureAuthClient, ensureAuthResourceServer, runAuthCommand, runAuthDoctor } from "../authctl";
|
|
5
5
|
import { stopLocalDev } from "../local-dev";
|
|
6
6
|
import { bootstrap, prepareGcpProject } from "./bootstrap";
|
|
@@ -259,7 +259,7 @@ async function runDoctor() {
|
|
|
259
259
|
return "gcx available";
|
|
260
260
|
});
|
|
261
261
|
await record(results, "dashboard artifacts", "warn", async () => {
|
|
262
|
-
if (!(await
|
|
262
|
+
if (!(await directoryExists("./grafana")) && !(await directoryExists("./dashboards"))) {
|
|
263
263
|
throw new Error("no grafana/ or dashboards/ directory found");
|
|
264
264
|
}
|
|
265
265
|
return "dashboard directory found";
|
|
@@ -441,6 +441,14 @@ async function findFiles(root: string, suffix = ""): Promise<string[]> {
|
|
|
441
441
|
return files;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
async function directoryExists(path: string) {
|
|
445
|
+
try {
|
|
446
|
+
return (await stat(path)).isDirectory();
|
|
447
|
+
} catch {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
444
452
|
if (import.meta.main) {
|
|
445
453
|
await main();
|
|
446
454
|
}
|