-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.json
60 lines (60 loc) · 4.2 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
{
"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",
"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: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 check:frontend && npm run check:backend && npm run check:cypress && echo \"All good! :)\"",
"check:backend": "echo \"Running backend tsc ...\" && cd backend && npx tsc --noEmit && echo \"Running backend eslint ...\"&& npm run lint",
"check:frontend": "echo \"Running frontend tsc ...\" && cd frontend && npx tsc --noEmit && echo \"Running frontend eslint ...\" && npm run lint",
"check:cypress": "echo \"Running cypress eslint ...\" && npm run lint:cypress",
"lint:cypress": "eslint --report-unused-disable-directives --max-warnings 0 cypress/e2e/**.cy.js",
"test:up": "docker compose -f docker-compose.test.yml up db-anon backend frontend",
"test:down": "docker compose -f docker-compose.test.yml down -v",
"test:ci": "docker compose -f docker-compose.test.yml up",
"test:api": "npm run test:api:build && npm run test:api:run",
"test:api:build": "docker build -t nowdb-api-tests . -f backend/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: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: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:all": "rm -rf node_modules && cd backend && npm run clean && cd ../frontend && npm run clean"
},
"author": "",
"devDependencies": {
"@cypress/code-coverage": "^3.13.2",
"@eslint/js": "^9.14.0",
"@types/leaflet": "^1.9.12",
"cypress": "^13.11.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.12.0",
"prettier": "^3.3.3",
"supertest": "^7.0.0"
}
}