From 18f48297b9dba4e0abcd483e445e5ec79aa35066 Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Mon, 22 Dec 2025 15:20:03 +0100 Subject: [PATCH 1/7] Delete copy-asset-links --- web/package.json | 1 - web/scripts/copy-asset-links.js | 42 --------------------------------- web/scripts/package.json | 12 ---------- 3 files changed, 55 deletions(-) delete mode 100644 web/scripts/copy-asset-links.js delete mode 100644 web/scripts/package.json diff --git a/web/package.json b/web/package.json index 23ac19ac6..070662103 100644 --- a/web/package.json +++ b/web/package.json @@ -5,7 +5,6 @@ "clean": "rm -rf dist coverage *.log", "build-local-deps": "npm run build --workspace=../proto --workspace=../lib", "build": "ng build -c $npm_config_config", - "postbuild": "npm run --prefix scripts copy-asset-links", "build-all": "npm run build-local-deps && npm run build", "build-and-test": "npm run build --config=local && npm run test", "build-all-and-test": "npm run build-all --config=local && npm run test", diff --git a/web/scripts/copy-asset-links.js b/web/scripts/copy-asset-links.js deleted file mode 100644 index 7b113076c..000000000 --- a/web/scripts/copy-asset-links.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright 2025 The Ground Authors. - * - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'; - -// This script copies the assetLinks.json file from `web/keys//` to the local -// `dist/.well-known` folder before build. This file is used for Digital Asset Links -// to associate the web app with the Android app. - -const project = process.env['npm_config_project']; - -const assertLinksFilepath = `../keys/${project}/assetLinks.json`; - -if (existsSync(assertLinksFilepath)) { - const assertLinks = readFileSync( - `../keys/${project}/assetLinks.json`, - 'utf8' - ); - - const wellKnownDir = '../dist/web/.well-known'; - - if (!existsSync(wellKnownDir)) { - mkdirSync(wellKnownDir, { recursive: true }); - } - - writeFileSync(`${wellKnownDir}/assetLinks.json`, assertLinks); -} else { - console.warn('Warning: Missing assetLinks.json file'); -} diff --git a/web/scripts/package.json b/web/scripts/package.json deleted file mode 100644 index 149a9989e..000000000 --- a/web/scripts/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "ground-web-build-scripts", - "version": "1.0.0", - "description": "Ground web app custom build scripts", - "type": "module", - "scripts": { - "copy-asset-links": "node copy-asset-links.js" - }, - "keywords": [], - "author": "", - "license": "ISC" -} From 444668535584a691e8c0776d2b988f2086c0cf2a Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Mon, 22 Dec 2025 15:20:25 +0100 Subject: [PATCH 2/7] Added assetLinks for dev --- .gitignore | 1 + web/src/assets/.well-known/assetLinks.json | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 web/src/assets/.well-known/assetLinks.json diff --git a/.gitignore b/.gitignore index d281ac369..c964349b1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ !.eslintrc.json !.prettierrc.js !.github/ +!.well-known/ **/isolate **/keys/ **/dist/ diff --git a/web/src/assets/.well-known/assetLinks.json b/web/src/assets/.well-known/assetLinks.json new file mode 100644 index 000000000..220736974 --- /dev/null +++ b/web/src/assets/.well-known/assetLinks.json @@ -0,0 +1,9 @@ +[{ + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "org.groundplatform.android", + "sha256_cert_fingerprints": + ["9f:f1:da:1e:97:93:c7:93:9a:8d:52:24:af:8b:a6:07:da:0a:10:db:1c:d2:40:47:5c:07:eb:be:c4:e8:57:80"] + } +}] From d94f10261dc8020fa1dd99e4c10862bd8803219e Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Mon, 22 Dec 2025 15:20:36 +0100 Subject: [PATCH 3/7] AssetLinks redirect --- firebase.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firebase.json b/firebase.json index 3cf322beb..3fe108a24 100644 --- a/firebase.json +++ b/firebase.json @@ -16,6 +16,10 @@ } ], "rewrites": [ + { + "source": "/.well-known/assetLinks.json", + "destination": "/en/assets/.well-known/assetLinks.json" + }, { "source": "/importGeoJson", "function": "importGeoJson" From f5794bbef77afe348d2719c9c3860c1889811f90 Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Tue, 23 Dec 2025 12:41:24 +0100 Subject: [PATCH 4/7] moved .well-known folder outside web --- {web/src/assets/.well-known => .well-known}/assetLinks.json | 0 firebase.json | 4 ---- package.json | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) rename {web/src/assets/.well-known => .well-known}/assetLinks.json (100%) diff --git a/web/src/assets/.well-known/assetLinks.json b/.well-known/assetLinks.json similarity index 100% rename from web/src/assets/.well-known/assetLinks.json rename to .well-known/assetLinks.json diff --git a/firebase.json b/firebase.json index 3fe108a24..3cf322beb 100644 --- a/firebase.json +++ b/firebase.json @@ -16,10 +16,6 @@ } ], "rewrites": [ - { - "source": "/.well-known/assetLinks.json", - "destination": "/en/assets/.well-known/assetLinks.json" - }, { "source": "/importGeoJson", "function": "importGeoJson" diff --git a/package.json b/package.json index f8250a90e..8fc1bb721 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "clean-all": "nx run-many -t clean", "build-all": "nx run-many -t build", + "predeploy": "cp -r .well-known web/dist/web/", "deploy": "firebase login && firebase deploy --project $npm_config_project", "build-all-and-deploy": "nx run-many -t build && npm run deploy", "build-all-and-start-local": "nx run-many -t build --config=local --project=local && npm run start:local", From 97522d54aaa32b0b6c08a8cf645e73ff65c3aff5 Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Tue, 23 Dec 2025 12:41:50 +0100 Subject: [PATCH 5/7] removed i18n root warning --- firebase.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase.json b/firebase.json index 3cf322beb..3ac5f4347 100644 --- a/firebase.json +++ b/firebase.json @@ -6,7 +6,7 @@ "hosting": { "public": "web/dist/web", "i18n": { - "root": "web/dist/web" + "root": "." }, "redirects": [ { From b6b2707f72a05df8e4f3b466d0727063b1c13dc3 Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Fri, 2 Jan 2026 23:34:16 +0100 Subject: [PATCH 6/7] fixed conficts --- firebase.remote.json | 2 +- web/package.json | 157 +++++++++++++++++++++++-------------------- 2 files changed, 86 insertions(+), 73 deletions(-) diff --git a/firebase.remote.json b/firebase.remote.json index 3ac5f4347..3cf322beb 100644 --- a/firebase.remote.json +++ b/firebase.remote.json @@ -6,7 +6,7 @@ "hosting": { "public": "web/dist/web", "i18n": { - "root": "." + "root": "web/dist/web" }, "redirects": [ { diff --git a/web/package.json b/web/package.json index e3f994fa1..d94d6dc79 100644 --- a/web/package.json +++ b/web/package.json @@ -3,92 +3,105 @@ "version": "0.0.1", "scripts": { "clean": "rm -rf dist coverage *.log", - "build-local-deps": "npm run build --workspace=../proto --workspace=../lib", - "build": "ng build -c $npm_config_config", - "build-all": "npm run build-local-deps && npm run build", - "build-and-test": "npm run build --config=local && npm run test", - "build-all-and-test": "npm run build-all --config=local && npm run test", - "build-all-and-test-headless": "npm run build-all --config=local && npm run test-headless", - "watch": "npm run build -- --watch", - "start": "ng serve -c $npm_config_config", - "build-and-start": "npm run build && npm run start", - "build-all-and-start": "npm run build-all && npm run start", "pretest": "./pretest.sh", - "test": "ng test", - "test-headless": "ng test --browsers ChromeHeadlessNoSandbox --watch=false", - "test-with-coverage": "npm run test -- --browsers ChromeHeadlessNoSandbox --watch=false --code-coverage", - "lint": "ng lint", - "lint:fix": "npm run lint -- --fix", "posttest": "./posttest.sh", "postinstall": "node scripts/patch-karma.cjs", - "login": "npx firebase login", - "deploy": "npm run login && npx firebase deploy --only hosting --project $npm_config_project", "extract-i18n": "ng extract-i18n" }, - "private": true, + "nx": { + "name": "web", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "cwd": "web" + }, + "configurations": { + "development": { + "command": "ng build -c development" + }, + "staging": { + "command": "ng build -c staging" + }, + "production": { + "command": "ng build -c production" + } + }, + "dependsOn": ["^build"], + "defaultConfiguration": "development" + }, + "serve": { + "executor": "nx:run-commands", + "options": { + "cwd": "web" + }, + "configurations": { + "development": { + "command": "ng serve -c development" + }, + "staging": { + "command": "ng serve -c staging" + }, + "production": { + "command": "ng serve -c production" + } + }, + "dependsOn": ["^build"], + "defaultConfiguration": "development" + }, + "test": { + "executor": "nx:run-commands", + "options": { + "cwd": "web", + "command": "ng test", + "forwardAllArgs": true + }, + "dependsOn": ["^build"] + }, + "lint": { + "executor": "nx:run-commands", + "options": { + "cwd": "web", + "command": "ng lint", + "forwardAllArgs": true + } + }, + "extract-i18n": { + "executor": "nx:run-commands", + "options": { + "cwd": "web", + "command": "ng extract-i18n", + "forwardAllArgs": true + } + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "cwd": "web", + "command": "ng deploy", + "forwardAllArgs": true + } + } + } + }, "dependencies": { - "@angular/animations": "^21.0.6", - "@angular/cdk": "^21.0.5", - "@angular/common": "^21.0.6", - "@angular/compiler": "^21.0.6", - "@angular/core": "^21.0.6", - "@angular/fire": "^21.0.0-rc.0", - "@angular/forms": "^21.0.6", - "@angular/google-maps": "^21.0.5", - "@angular/localize": "^21.0.6", - "@angular/material": "^21.0.5", - "@angular/material-experimental": "^21.0.5", - "@angular/platform-browser": "^21.0.6", - "@angular/platform-browser-dynamic": "^21.0.6", - "@angular/router": "^21.0.6", - "@babel/runtime": "^7.24.7", - "@ground/lib": "file:../lib", - "@ground/proto": "file:../proto", - "@grpc/grpc-js": "^1.10.9", - "@iplab/ngx-file-upload": "^21.0.0", - "angularx-qrcode": "^21.0.4", - "firebase": "^10.7.2", - "firebaseui": "^6.1.0", - "firebaseui-angular": "^6.3.0", - "functions": "^1.0.9", - "immutable": "^4.3.6", - "marked": "^14.1.0", - "ngx-autosize-input": "^20.0.5", - "ngx-color": "^10.1.0", - "rxjs": "7.8.1", - "tslib": "^2.4.1", - "zone.js": "^0.15.1" + "@angular/core": "20.3.15", + "zone.js": "^0.14.10" }, "devDependencies": { - "@angular-devkit/build-angular": "^21.0.4", - "@angular-eslint/builder": "^15", - "@angular-eslint/eslint-plugin-template": "^15.1.0", - "@angular/cli": "^21.0.4", - "@angular/compiler-cli": "^21.0.6", - "@angular/language-service": "^21.0.6", "@jridgewell/source-map": "^0.3.2", "@types/google.maps": "^3.54.10", - "@types/jasmine": "^5.1.13", - "@types/jasmine-expect": "3.8.1", - "@types/jasminewd2": "^2.0.8", + "@types/jasmine": "~5.1.0", "@types/webpack-env": "^1.15.3", "cpx": "^1.5.0", - "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import": "^2.29.0", "inquirer": "^6.2.2", "inquirer-autocomplete-prompt": "^1.3.0", - "istanbul": "^0.4.5", - "jasmine-core": "^5.13.0", - "jasmine-matchers": "0.2.3", - "jasmine-spec-reporter": "~5.0.0", + "jasmine-core": "~5.1.0", "karma": "^6.4.4", - "karma-chrome-launcher": "^3.2.0", - "karma-coverage": "^2.2.1", - "karma-coverage-istanbul-reporter": "~3.0.2", - "karma-jasmine": "^5.1.0", - "karma-jasmine-html-reporter": "^1.5.0", - "karma-jasmine-matchers": "5.0.0", - "prettier-eslint": "^15.0.1", - "puppeteer": "^22.10.0" + "karma-chrome-launcher": "~3.2.0", + "karma-coverage": "~2.2.1", + "karma-jasmine": "~5.1.0", + "karma-jasmine-html-reporter": "^2.1.0", + "puppeteer": "^24.10.0" } } From d6971fac08d056b3472ffa3aeade1b430d3d4cfd Mon Sep 17 00:00:00 2001 From: Roberto Fontanarosa Date: Fri, 2 Jan 2026 23:38:24 +0100 Subject: [PATCH 7/7] renamed assetlinks file, moved back assetlinks file into assets --- firebase.remote.json | 4 ++++ .../src/assets/.well-known/assetlinks.json | 0 2 files changed, 4 insertions(+) rename .well-known/assetLinks.json => web/src/assets/.well-known/assetlinks.json (100%) diff --git a/firebase.remote.json b/firebase.remote.json index 3cf322beb..c2f7c64a1 100644 --- a/firebase.remote.json +++ b/firebase.remote.json @@ -16,6 +16,10 @@ } ], "rewrites": [ + { + "source": "/.well-known/assetlinks.json", + "destination": "/en/assets/.well-known/assetlinks.json" + }, { "source": "/importGeoJson", "function": "importGeoJson" diff --git a/.well-known/assetLinks.json b/web/src/assets/.well-known/assetlinks.json similarity index 100% rename from .well-known/assetLinks.json rename to web/src/assets/.well-known/assetlinks.json