-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
93 lines (93 loc) · 5.39 KB
/
package.json
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
"name": "serverless-curl-impersonate",
"volta": {
"node": "20.18.1"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
},
"type": "commonjs",
"main": "./build/app.js",
"module": "./build/app.js",
"scripts": {
"git:push": "git push origin main && git push template main",
"build": "pnpm tsc --build",
"command:js": "DEBUG='*' node",
"command:ts": "DEBUG='*' pnpm tsx",
"run:js": "pnpm command:js .",
"run:ts": "pnpm command:ts ./src/app.ts",
"run:deamon": "pnpm nodemon --exec \"pnpm command:ts\" --watch \"./.env\" --watch \"./src\" ./src/app.ts",
"start": "NODE_ENV=production pnpm run:js",
"start:dev": "NODE_ENV=production DEBUG_ENV=true pnpm run:js",
"dev": "NODE_ENV=development DEBUG_ENV=true pnpm run:deamon",
"dev:prod": "NODE_ENV=production DEBUG_ENV=true pnpm run:deamon",
"yc:registry:create": "source ./scripts/pre-env.sh && yc container registry create --name $REGISTRY_NAME",
"yc:registry:get": "source ./scripts/pre-env.sh && yc container registry get $REGISTRY_NAME",
"yc:registry:configure": "yc container registry configure-docker",
"yc:image:build": "source ./scripts/pre-image.sh && docker buildx build --load --platform linux/amd64 --tag $IMAGE_NAME .",
"yc:image:push": "source ./scripts/pre-image.sh && docker image push $IMAGE_NAME",
"yc:container:create": "source ./scripts/projectname-env.sh && yc serverless container create --name $PACKAGE_NAME",
"yc:container:print": "source ./scripts/pre-container.sh && echo \"Your serverless container is available at https://$CONTAINER_ID.containers.yandexcloud.net/\"",
"yc:container:deploy": "source ./scripts/pre-image.sh && yc serverless container revision deploy --container-name $PACKAGE_NAME --image $IMAGE_NAME --cores 1 --memory 1GB --concurrency 1 --execution-timeout 30s --service-account-id $SERVICE_ACCOUNT_ID",
"yc:deploy": "pnpm yc:image:build && pnpm yc:image:push && pnpm yc:container:deploy && pnpm yc:container:print"
},
"comments": {
"---------": "---------",
"_dev:prod": "NODE_ENV=production pnpm _dev:command",
"_cli": "NODE_ENV=development node --experimental-specifier-resolution=node --no-warnings --loader ts-node/esm ./src/cli.ts $url",
"cli": "pnpm _cli",
"-start:dev": "NODE_ENV=development pnpm _command ./build/index.js",
"dev:deamon": "pnpm _pre:nvm 'NODE_ENV=development pnpm _dev:deamon:command'",
"dev:prod:deamon": "pnpm _pre:nvm 'NODE_ENV=production pnpm _dev:deamon:command'",
"": "",
"-dev": "pnpm pre:nvm 'pnpm webhook:reset && pnpm nodemon --exec \"pnpm command --loader ts-node/esm\" ./src/main.ts'",
"docker:dev": "docker compose up",
"------": "------",
"-webhook:set": "pnpm pre:env 'pnpm telegraf -m setWebhook -t \"$BOT_TOKEN\" -D \"{ \\\"url\\\": \\\"https://$CONTAINER_DOMAIN\\\" }\"'",
"-webhook:reset": "pnpm pre:env 'pnpm telegraf -m setWebhook -t \"$BOT_TOKEN\" -D \"{ \\\"url\\\": \\\"\\\" }\"'",
"-ci": "pnpm docker:build",
"-cd": "pnpm ci && pnpm yc:registry:publish && pnpm yc:container:deploy",
"ssh": "ssh raspberrypi",
"ssh2": "pnpm pre:env 'sshpass -p $SERVER_PASSWORD ssh timeweb'",
"purge": "pnpm pre:env 'sshpass -p $SERVER_PASSWORD ssh timeweb \"cd /root/yandex-voice-translate-bot && ls --almost-all | grep -xv node_modules | xargs rm -rf\"'",
"-deploy": "rsync -avzc --exclude=.DS_Store --exclude=.git --exclude=node_modules --exclude=build --exclude=.pnpm/cache --exclude='*.mp3' --exclude='*.mp4' --exclude='*.log' . raspberrypi2:~/yandex-voice-translate-bot",
"deploy2": "pnpm pre:env 'sshpass -p $SERVER_PASSWORD rsync -avzc --exclude=.git --exclude=node_modules --exclude=build --exclude=.pnpm/install-state.gz --exclude=.pnpm/cache --exclude=*.mp3 --exclude=*.mp4 . timeweb:/root/yandex-voice-translate-bot'",
"deploy:ffmpeg": "pnpm pre:env 'sshpass -p $SERVER_PASSWORD rsync -avzc ../ffmpeg-dist timeweb:/root/ffmpeg-dist'",
"docker": "docker compose --env-file ./.env --env-file ./image-translate/.env -f ./compose.yml",
"docker:build": "pnpm docker build && pnpm docker:down && pnpm docker:image:clean",
"docker:up": "pnpm docker up --detach",
"docker:logs": "pnpm docker logs --follow --timestamps --since='6h' --tail='1000'",
"docker:top": "pnpm docker top",
"docker:shell": "pnpm docker exec yandex_voice_translate_bot bash",
"docker:run": "pnpm docker run -it yandex_voice_translate_bot bash",
"docker:down": "pnpm docker down",
"docker:stop": "pnpm docker stop",
"docker:restart": "pnpm docker:down && pnpm docker:up",
"docker:down:clean": "pnpm docker down --rmi=all --volumes",
"docker:image:clean": "docker image rm -f $(docker image ls -aqf dangling=true) || echo ''",
"docker:container:clean": "docker rm $(docker ps --filter=status=exited --filter=status=dead -q)",
"docker:cache:info": "docker system df",
"docker:cache:clean": "docker system prune --volumes",
"yarn:cache:clean": "rm -rf ~/.yarn/cache && rm -rf ~/Library/Caches/Yarn/v6"
},
"dependencies": {
"curl-wrap": "1.0.3",
"debug": "^4.3.4",
"dotenv": "16.4.7",
"express": "4.18.2",
"raw-body": "3.0.0",
"serialize-error": "11.0.3"
},
"devDependencies": {
"@types/debug": "^4.1.12",
"@types/express": "4.17.17",
"@types/node": "18.15.3",
"husky": "8.0.3",
"nodemon": "2.0.20",
"ts-node": "10.9.1",
"tsx": "4.19.2",
"typescript": "5.4.5",
"yarnhook": "0.6.0"
}
}