Skip to content

Commit c8cd6ef

Browse files
committed
a bit more script cleanup
1 parent 727f5a3 commit c8cd6ef

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

scripts/scripts.mjs

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,15 @@ import { join, resolve } from "path";
1818
case "start":
1919
await run("tsup", {});
2020
await run("node --trace-warnings --trace-uncaught mws.dev.mjs", {
21-
DEVHTTPS: "yes",
22-
PORT: "5000",
2321
DEVSERVER: true ? "watch" : "build",
2422
ENABLE_EXTERNAL_PLUGINS: "1",
2523
ENABLE_DOCS_ROUTE: arg === "docs" ? "1" : "",
2624
});
2725
break;
28-
29-
case "live":
30-
await run_bin({
31-
DEVHTTPS: "yes",
32-
PORT: "5000",
33-
});
34-
break;
3526
case "build":
3627
await run("tsup", {});
37-
await run_bin({
38-
CLIENT_BUILD: "1"
39-
});
40-
break;
41-
case "build-prod": {
42-
if(!process.env.SKIP_TSUP) await run("tsup", {});
43-
await run_bin({ CLIENT_BUILD: "1", BUILD_ENV: "production" });
44-
await run("tsup", { BUILD_ENV: "runtime" });
45-
if(!process.env.SKIP_AUDIT) await run("npm audit", {}).catch(() => {});
28+
await run_bin({ CLIENT_BUILD: "1" });
4629
break;
47-
}
4830
case "prisma:generate": {
4931
await run("prisma validate", { "DATABASE_URL": "postgres://test" });
5032
await run("prisma format", {});
@@ -97,34 +79,6 @@ import { join, resolve } from "path";
9779
});
9880
break;
9981
}
100-
case "prisma:generate:oldjsclient": {
101-
const prismaFolder = "prisma";
102-
console.log("Generating Prisma client...");
103-
// remove the old client - cross-platform
104-
removeRecursive(join(prismaFolder, "client"));
105-
await start(`prisma generate --schema=${prismaFolder}/schema.prisma`, [], {
106-
PRISMA_CLIENT_FORCE_WASM: "true"
107-
});
108-
console.log("Formatting Prisma client...");
109-
await start(`prettier --write ${prismaFolder}/client/*.js ${prismaFolder}/client/*/*.js`);
110-
// remove the .node files, we don't need them in the client - cross-platform
111-
console.log("Removing .node files from Prisma client...");
112-
readdirSync(`${prismaFolder}/client`).forEach(file => {
113-
if(file.endsWith(".node")) {
114-
const filePath = join(`${prismaFolder}/client`, file);
115-
console.log(`Removing ${filePath}`);
116-
if(existsSync(filePath)) rmSync(filePath, { force: true });
117-
}
118-
});
119-
console.log("Updating Prisma client package.json...");
120-
/** @type {any} */
121-
const pkg = JSON.parse(readFileSync(join(prismaFolder, "client/package.json")).toString());
122-
pkg.name = "@tiddlywiki/mws-prisma";
123-
pkg.private = true;
124-
writeFileSync(join(prismaFolder, "client/package.json"), JSON.stringify(pkg, null, 2));
125-
console.log("Prisma client generated.");
126-
break;
127-
}
12882
case "prisma:migrate":
12983
await start("prisma migrate dev", [
13084
"--schema", "prisma/schema.prisma",

0 commit comments

Comments
 (0)