-
Notifications
You must be signed in to change notification settings - Fork 19
/
package-scripts.js
55 lines (52 loc) · 1.72 KB
/
package-scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
const npsUtils = require("nps-utils");
const dotenv = require("dotenv");
const config = dotenv.config();
if (config.error) {
throw config.error;
}
let requiredEnvVariables = ["OPENAI_API_KEY"];
requiredEnvVariables.forEach((variable) => {
if (!process.env[variable]) {
console.error(`Missing environment variable: ${variable}`);
process.exit(1);
}
});
module.exports = {
scripts: {
initialize: {
py: "virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements.txt",
database: "symphony/database/setup.sh",
default: npsUtils.concurrent.nps("initialize.py", "initialize.database"),
},
describe: {
ts: "node -r @swc-node/register symphony/server/typescript/describe.ts",
py: "source venv/bin/activate && python symphony/server/python/describe.py",
},
serve: {
ts: "node -r @swc-node/register symphony/server/typescript/serve.ts",
py: "source venv/bin/activate && python symphony/server/python/serve.py",
all: npsUtils.concurrent.nps("serve.ts", "serve.py"),
},
jig: "node -r @swc-node/register symphony/server/jig.ts",
watch: "node -r @swc-node/register symphony/server/watch.ts",
client: "yarn vite --port 3000",
service: "node -r @swc-node/register symphony/server/service.ts",
database: "postgrest symphony/database/postgrest.conf",
start: npsUtils.concurrent.nps(
"client",
"service",
"database",
"serve.all",
"jig",
"watch"
),
lint: "eslint .",
clean: {
ts: "rm -rf node_modules",
py: "rm -rf venv",
database: "symphony/database/destroy.sh",
all: npsUtils.concurrent.nps("clean.ts", "clean.py"),
default: "yarn nps clean.all",
},
},
};