Skip to content

Commit 214d5e3

Browse files
authored
Merge branch 'master' into rfontanarosa/hotfix-qrcode
2 parents 30317af + d24c302 commit 214d5e3

6 files changed

Lines changed: 147 additions & 59 deletions

File tree

e2e-tests/package.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
{
22
"name": "@ground/e2e-tests",
33
"nx": {
4-
"name": "e2e-tests"
4+
"name": "e2e-tests",
5+
"targets": {
6+
"test:create": {
7+
"command": "tsx node_modules/jasmine/bin/jasmine spec/create-survey.spec.ts"
8+
},
9+
"test:create:debug": {
10+
"command": "tsx --inspect node_modules/jasmine/bin/jasmine spec/create-survey.spec.ts"
11+
},
12+
"test:verify": {
13+
"command": "tsx node_modules/jasmine/bin/jasmine spec/verify-submissions.spec.ts"
14+
},
15+
"test:verify:debug": {
16+
"command": "tsx --inspect node_modules/jasmine/bin/jasmine spec/verify-submissions.spec.ts"
17+
},
18+
"lint": {
19+
"command": "gts lint"
20+
},
21+
"fix": {
22+
"command": "gts fix"
23+
}
24+
}
525
},
626
"version": "0.0.1",
727
"description": "Automated testing of the Ground platform.",
8-
"scripts": {
9-
"test:create": "tsx node_modules/jasmine/bin/jasmine spec/create-survey.spec.ts",
10-
"test:create:debug": "tsx --inspect node_modules/jasmine/bin/jasmine spec/create-survey.spec.ts",
11-
"test:verify": "tsx node_modules/jasmine/bin/jasmine spec/verify-submissions.spec.ts",
12-
"test:verify:debug": "tsx --inspect node_modules/jasmine/bin/jasmine spec/verify-submissions.spec.ts",
13-
"lint": "gts lint",
14-
"fix": "gts fix"
15-
},
1628
"license": "Apache-2.0",
1729
"dependencies": {
1830
"selenium-webdriver": "catalog:"

functions/package.json

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,74 @@
66
"files": [
77
"dist"
88
],
9-
"scripts": {
10-
"shell": "firebase functions:shell",
11-
"emulate": "firebase emulators:start --only functions,firestore --project demo-local",
12-
"logs": "firebase functions:log",
13-
"build": "tsc",
14-
"deploy": "npm run build && firebase deploy --project $npm_config_project --only functions",
15-
"watch": "tsc --watch"
16-
},
179
"nx": {
1810
"name": "functions",
1911
"targets": {
12+
"build": {
13+
"executor": "nx:run-commands",
14+
"options": {
15+
"cwd": "{projectRoot}",
16+
"command": "tsc"
17+
}
18+
},
2019
"clean": {
21-
"command": "rm -rf dist *.log"
20+
"executor": "nx:run-commands",
21+
"options": {
22+
"cwd": "{projectRoot}",
23+
"command": "rm -rf dist *.log"
24+
}
2225
},
2326
"lint": {
24-
"command": "eslint src"
27+
"executor": "nx:run-commands",
28+
"options": {
29+
"cwd": "{projectRoot}",
30+
"command": "eslint src"
31+
}
2532
},
2633
"test": {
27-
"command": "jasmine --config=jasmine.json",
34+
"executor": "nx:run-commands",
35+
"options": {
36+
"cwd": "{projectRoot}",
37+
"command": "jasmine --config=jasmine.json"
38+
},
2839
"dependsOn": [
2940
"build"
3041
]
3142
},
3243
"format:check": {
3344
"executor": "nx:run-commands",
3445
"options": {
46+
"cwd": "{projectRoot}",
3547
"command": "prettier --check \"src/**/*.ts\""
3648
}
49+
},
50+
"shell": {
51+
"command": "firebase functions:shell"
52+
},
53+
"emulate": {
54+
"command": "firebase emulators:start --only functions,firestore --project demo-local"
55+
},
56+
"logs": {
57+
"command": "firebase functions:log"
58+
},
59+
"deploy": {
60+
"executor": "nx:run-commands",
61+
"configurations": {
62+
"staging": {
63+
"command": "firebase deploy --project ground-dev-sig --only functions"
64+
},
65+
"production": {
66+
"command": "firebase deploy --project YOUR-PROD-PROJECT --only functions"
67+
}
68+
},
69+
"dependsOn": ["build"]
70+
},
71+
"watch": {
72+
"executor": "nx:run-commands",
73+
"options": {
74+
"cwd": "{projectRoot}",
75+
"command": "tsc --watch"
76+
}
3777
}
3878
}
3979
},

lib/package.json

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,40 @@
33
"nx": {
44
"name": "lib",
55
"targets": {
6+
"build": {
7+
"executor": "nx:run-commands",
8+
"options": {
9+
"cwd": "{projectRoot}",
10+
"command": "tsc"
11+
}
12+
},
613
"clean": {
7-
"command": "rm -rf dist *.log src/generated"
14+
"executor": "nx:run-commands",
15+
"options": {
16+
"cwd": "{projectRoot}",
17+
"command": "rm -rf dist *.log src/generated"
18+
}
819
},
920
"lint": {
10-
"command": "eslint src"
21+
"executor": "nx:run-commands",
22+
"options": {
23+
"cwd": "{projectRoot}",
24+
"command": "eslint src"
25+
}
1126
},
1227
"test": {
13-
"command": "jasmine --config=jasmine.json"
28+
"executor": "nx:run-commands",
29+
"options": {
30+
"cwd": "{projectRoot}",
31+
"command": "jasmine --config=jasmine.json"
32+
}
1433
},
1534
"format:check": {
16-
"command": "prettier --check \"src/**/*.ts\""
35+
"executor": "nx:run-commands",
36+
"options": {
37+
"cwd": "{projectRoot}",
38+
"command": "prettier --check \"src/**/*.ts\""
39+
}
1740
}
1841
}
1942
},
@@ -27,13 +50,6 @@
2750
"files": [
2851
"dist"
2952
],
30-
"scripts": {
31-
"build-local-deps": "npm run build --workspace=../proto",
32-
"build": "tsc",
33-
"build-all": "npm run build-local-deps && npm run build",
34-
"build-and-test": "npm run build && npm run test",
35-
"build-all-and-test": "npm run build-all && npm run test"
36-
},
3753
"engines": {
3854
"node": "22"
3955
},

package.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
"name": "@ground/root",
33
"version": "0.0.1",
44
"description": "Root package for Ground hosted components",
5-
"scripts": {
6-
"export:local": "firebase emulators:export data/local --project demo-local --only firestore",
7-
"start-and-export:test": "firebase emulators:exec 'npm run watch:local' --project demo-local --ui --config firebase.local.json --import data/test --export-on-exit data/test",
8-
"test:e2e:create": "WAIT_ON_INTERVAL=30000 start-server-and-test start-and-export:test '5000|http://localhost:4000/firestore' 'npm run test:create --prefix=e2e-tests'",
9-
"test:e2e:create:debug": "WAIT_ON_INTERVAL=30000 start-server-and-test start-and-export:test '5000|http://localhost:4000/firestore' 'npm run test:create:debug --prefix=e2e-tests'",
10-
"test:e2e:verify": "WAIT_ON_INTERVAL=30000 start-server-and-test start-and-export:test '5000|http://localhost:4000/firestore' 'npm run test:verify --prefix=e2e-tests'",
11-
"test:e2e:verify:debug": "WAIT_ON_INTERVAL=30000 start-server-and-test start-and-export:test '5000|http://localhost:4000/firestore' 'npm run test:verify:debug --prefix=e2e-tests'"
12-
},
135
"nx": {
146
"name": "root",
157
"targets": {
@@ -93,6 +85,24 @@
9385
"dependsOn": [
9486
"build"
9587
]
88+
},
89+
"export:local": {
90+
"command": "firebase emulators:export data/local --project demo-local --only firestore"
91+
},
92+
"start-and-export:test": {
93+
"command": "firebase emulators:exec 'npm run watch:local' --project demo-local --ui --config firebase.local.json --import data/test --export-on-exit data/test"
94+
},
95+
"test:e2e:create": {
96+
"command": "WAIT_ON_INTERVAL=30000 start-server-and-test 'nx run root:start-and-export:test' '5000|http://localhost:4000/firestore' 'nx run e2e-tests:test:create'"
97+
},
98+
"test:e2e:create:debug": {
99+
"command": "WAIT_ON_INTERVAL=30000 start-server-and-test 'nx run root:start-and-export:test' '5000|http://localhost:4000/firestore' 'nx run e2e-tests:test:create:debug'"
100+
},
101+
"test:e2e:verify": {
102+
"command": "WAIT_ON_INTERVAL=30000 start-server-and-test 'nx run root:start-and-export:test' '5000|http://localhost:4000/firestore' 'nx run e2e-tests:test:verify'"
103+
},
104+
"test:e2e:verify:debug": {
105+
"command": "WAIT_ON_INTERVAL=30000 start-server-and-test 'nx run root:start-and-export:test' '5000|http://localhost:4000/firestore' 'nx run e2e-tests:test:verify:debug'"
96106
}
97107
}
98108
},

proto/package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,27 @@
33
"nx": {
44
"name": "proto",
55
"targets": {
6+
"build": {
7+
"executor": "nx:run-commands",
8+
"options": {
9+
"cwd": "{projectRoot}",
10+
"commands": [
11+
"mkdir -p dist && pnpm exec pbjs -p src src/ground/v1beta1/*.proto -t static-module -o dist/ground-protos.js",
12+
"mkdir -p dist && pnpm exec pbjs -p src src/ground/v1beta1/*.proto -t json -o dist/ground-protos.json",
13+
"pnpm exec pbts dist/ground-protos.js -o dist/ground-protos.d.ts",
14+
"cp src/index.* dist/"
15+
],
16+
"parallel": false
17+
}
18+
},
619
"clean": {
720
"command": "rm -rf dist"
821
},
922
"lint": {
1023
"command": "node scripts/lint.js"
24+
},
25+
"format:write": {
26+
"command": "buf format --write"
1127
}
1228
}
1329
},
@@ -16,15 +32,6 @@
1632
"main": "dist/index.js",
1733
"types": "dist/index.d.ts",
1834
"files": ["dist"],
19-
"scripts": {
20-
"format": "buf format --write",
21-
"build": "npm run generate:pbjs && npm run generate:pbjson && npm run generate:pbts",
22-
"postbuild": "cp src/index.* dist/",
23-
"pbjs": "mkdir -p dist && pbjs -p src src/ground/v1beta1/*.proto",
24-
"generate:pbjs": "npm run pbjs -- -t static-module -o dist/ground-protos.js",
25-
"generate:pbjson": "npm run pbjs -- -t json -o dist/ground-protos.json",
26-
"generate:pbts": "mkdir -p dist && pbts dist/ground-protos.js -o dist/ground-protos.d.ts"
27-
},
2835
"dependencies": {
2936
"protobufjs": "catalog:"
3037
},

web/package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
"name": "@ground/web",
33
"version": "0.0.1",
44
"scripts": {
5-
"pretest": "./pretest.sh",
6-
"posttest": "./posttest.sh",
7-
"postinstall": "node scripts/patch-karma.cjs",
8-
"extract-i18n": "ng extract-i18n"
5+
"postinstall": "node scripts/patch-karma.cjs"
96
},
107
"nx": {
118
"name": "web",
129
"targets": {
1310
"clean": {
14-
"command": "rm -rf dist coverage *.log"
11+
"executor": "nx:run-commands",
12+
"options": {
13+
"cwd": "{projectRoot}",
14+
"command": "rm -rf dist coverage *.log"
15+
}
1516
},
1617
"lint": {
1718
"executor": "nx:run-commands",
1819
"options": {
20+
"cwd": "{projectRoot}",
1921
"commands": [
2022
"eslint \"src/**/*.ts\"",
2123
"eslint \"src/**/*.html\""
@@ -26,8 +28,8 @@
2628
"test": {
2729
"executor": "nx:run-commands",
2830
"options": {
29-
"command": "ng test",
30-
"forwardAllArgs": true
31+
"cwd": "{projectRoot}",
32+
"command": "bash -c './pretest.sh && ng test; EXIT=$?; ./posttest.sh; exit $EXIT'"
3133
},
3234
"dependsOn": [
3335
"^build"
@@ -36,7 +38,7 @@
3638
"build": {
3739
"executor": "nx:run-commands",
3840
"options": {
39-
"cwd": "web"
41+
"cwd": "{projectRoot}"
4042
},
4143
"configurations": {
4244
"development": {
@@ -57,7 +59,7 @@
5759
"serve": {
5860
"executor": "nx:run-commands",
5961
"options": {
60-
"cwd": "web"
62+
"cwd": "{projectRoot}"
6163
},
6264
"configurations": {
6365
"development": {
@@ -78,21 +80,22 @@
7880
"format:check": {
7981
"executor": "nx:run-commands",
8082
"options": {
83+
"cwd": "{projectRoot}",
8184
"command": "prettier --check \"src/**/*.{ts,html,scss}\""
8285
}
8386
},
8487
"extract-i18n": {
8588
"executor": "nx:run-commands",
8689
"options": {
87-
"cwd": "web",
90+
"cwd": "{projectRoot}",
8891
"command": "ng extract-i18n",
8992
"forwardAllArgs": true
9093
}
9194
},
9295
"deploy": {
9396
"executor": "nx:run-commands",
9497
"options": {
95-
"cwd": "web",
98+
"cwd": "{projectRoot}",
9699
"command": "ng deploy",
97100
"forwardAllArgs": true
98101
}

0 commit comments

Comments
 (0)