-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.json
More file actions
101 lines (101 loc) · 6.31 KB
/
package.json
File metadata and controls
101 lines (101 loc) · 6.31 KB
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
94
95
96
97
98
99
100
101
{
"name": "nowdatabase",
"version": "1.0.0",
"description": "NOW - New and Old Worlds - Database of fossil mammals",
"main": "index.js",
"scripts": {
"setup": "npm run install:all && npm run prisma && npm run config",
"install:all": "npm i && cd backend && npm i && cd ../frontend && npm i && cd ..",
"start": "docker compose -f docker-compose.yml up",
"start:anon": "docker compose -f docker-compose.anon.yml up",
"start:anon:api": "docker compose -f docker-compose.anon.yml up db-anon",
"dev": "docker compose -f docker-compose.dev.yml up",
"dev:db-test": "docker compose -f docker-compose.dev.yml up -d db-test",
"dev:db-test:down": "docker compose -f docker-compose.dev.yml stop db-test",
"dev:down": "docker compose -f docker-compose.dev.yml down -v",
"anon:down": "docker compose -f docker-compose.anon.yml down -v",
"check": "echo \"Running checks for both services and cypress tests...\" && npm run tsc && npm run lint && echo \"All good! :)\"",
"check:backend": "npm run tsc:backend && npm run lint:backend",
"check:frontend": "npm run tsc:frontend && npm run lint:frontend",
"check:cypress": "npm run lint:cypress",
"lint": "npm run lint:backend && npm run lint:frontend && npm run lint:cypress",
"lint:backend": "cd backend && npm run lint",
"lint:frontend": "cd frontend && npm run lint",
"lint:cypress": "eslint --cache --report-unused-disable-directives --max-warnings 0 \"cypress/e2e/**/*.{cy,spec}.{js,ts,tsx}\"",
"lint:staged": "npx lint-staged",
"tsc": "npm run tsc:backend && npm run tsc:frontend",
"tsc:backend": "cd backend && npx tsc --noEmit",
"tsc:frontend": "cd frontend && npx tsc --noEmit",
"test:backend": "npm run test:unit:backend && npm run test:api",
"test:api": "npm run test:api:build && npm run test:api:run",
"test:api:build": "docker build -t nowdb-api-tests . -f backend/dev.Dockerfile --target api-tests",
"test:api:run": "npm run test:api:run:base -- -it nowdb-api-tests",
"test:api:run:base": "docker run --rm --network=host --user node --env-file .test.env --volume ./test_data:/usr/src/app/test_data",
"test:api:windows": "npm run test:api:build && npm run test:api:run:windows",
"test:api:run:windows": "docker run -it --rm --user node --env-file .test.env --volume ./test_data:/usr/src/app/test_data nowdb-api-tests",
"test:api:local": "cd backend && npm run test:api:local",
"test:e2e": "npm run test:e2e:base -- -it --entrypoint cypress cypress/included:13.15.0 run --browser chrome",
"test:e2e:base": "docker run --network=host --user node -v $PWD:/e2e -w /e2e",
"test:e2e:windows": "npm run test:e2e:base:windows -- -it --entrypoint cypress cypress/included:13.15.0 run --browser chrome",
"test:e2e:base:windows": "docker run --user node -v $PWD:/e2e -w /e2e --env CYPRESS_baseUrl=http://host.docker.internal:5173 --env CYPRESS_databaseResetUrl=http://host.docker.internal:4000/test/reset-test-database",
"test:e2e:local": "cypress run --browser chrome",
"test:unit": "npm run test:unit:backend && npm run test:unit:frontend",
"test:unit:backend": "cd backend && npm run test:unit",
"test:unit:frontend": "cd frontend && npm run test",
"test:ci:api": "npm run test:api:build && npm run test:api:run:base -- nowdb-api-tests",
"test:ci:e2e": "npm run test:e2e:base -- --user 1001:1001 --entrypoint cypress cypress/included:13.15.0 run --browser chrome",
"coverage": "npm run coverage:sed && npx nyc report --reporter=lcov",
"coverage:sed": "sed -i -e \"s|/usr/src/app|$PWD/frontend|g\" .nyc_output/out.json",
"coverage:report": "npm run coverage",
"cypress": "cypress open",
"prisma": "cd backend && npx prisma generate --schema prisma/schema.prisma && npx prisma generate --schema prisma/schema_log.prisma",
"reset-anon-db": "docker exec -it nowdb-db-anon sh -c \"mariadb --user root -padmin now_test < /docker-entrypoint-initdb.d/sqlfiles/now_test.sql\" && docker exec -it nowdb-db-anon sh -c \"mariadb --user root -padmin now_log_test < /docker-entrypoint-initdb.d/sqlfiles/now_log_test.sql\"",
"clean": "rm -rf node_modules && rm -rf coverage & rm -rf .nyc_output && rm -rf cypress/screenshots && rm -rf cypress/downloads && cd backend && npm run clean && cd ../frontend && npm run clean",
"config": "npm run config:dev && npm run config:anon && npm run config:test",
"config:test": "npm run config:test:base && npm run config:test:host && npm run config:test:coordinator && npm run config:geonames -- .test.env && npm run config:test:yaml && npm run config:test:quotes",
"config:test:base": "cp -n .template.env .test.env",
"config:test:host": "sed -i -e \"s|nowdb-db-dev|localhost|g\" .test.env",
"config:test:yaml": "sed -i -e \"s|: |=|g\" .test.env",
"config:test:coordinator": "sed -i -e \"s|IZ|TEST-SU|g\" .test.env",
"config:test:quotes": "sed -i -e \"s|\\\"||g\" .test.env",
"config:anon": "npm run config:anon:base && npm run config:anon:host && npm run config:anon:coordinator && npm run config:geonames -- .anon.env",
"config:anon:base": "cp -n .template.env .anon.env",
"config:anon:host": "sed -i -e \"s|nowdb-db-dev|nowdb-db-anon|g\" .anon.env",
"config:anon:coordinator": "sed -i -e \"s|IZ|TEST-SU|g\" .anon.env",
"config:dev": "cp -n .template.env .dev.env && npm run config:geonames -- .dev.env",
"config:geonames": "sed -i -e \"s|GEONAMES_USERNAME: \\\"\\\"|GEONAMES_USERNAME: $GEONAMES_USERNAME|g\"",
"prepare": "husky"
},
"lint-staged": {
"frontend/**/*.{ts,tsx}": [
"cd frontend && npx eslint --cache --fix",
"cd frontend && npx tsc --noEmit"
],
"backend/**/*.{ts,js}": [
"cd backend && npx eslint --cache --fix",
"cd backend && npx tsc --noEmit"
],
"cypress/**/*.{ts,js,tsx}": [
"npx eslint --cache --fix"
]
},
"author": "",
"devDependencies": {
"@cypress/code-coverage": "^3.14.7",
"@eslint/js": "^9.39.1",
"@types/leaflet": "^1.9.12",
"cypress": "^13.11.0",
"eslint": "^9.39.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.5",
"globals": "^15.15.0",
"husky": "^9.1.7",
"prettier": "^3.3.3",
"supertest": "^7.0.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.47.0"
}
}