diff --git a/electron/package.json b/electron/package.json index c685d99..a59f06f 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,65 +1 @@ -{ - "name": "@deep-foundation/perception-app", - "version": "0.0.20", - "description": "Your second memory.", - "homepage": "https://deep.foundation/", - "author": { - "name": "Deep Foundation", - "email": "admin@deep.foundation" - }, - "repository": { - "type": "git", - "url": "https://github.com/deep-foundation/deepmemo-app" - }, - "license": "MIT", - "main": "build/src/index.js", - "scripts": { - "build": "rimraf ./build/src && tsc", - "test": "jest", - "electron:start-live": "node ./live-runner.js", - "electron:start": "npm run build && electron --inspect=5858 ./", - "electron:debug": "APP_DEV=true electron .", - "electron:pack": "npm run build && node patch-electron-builder.cjs && electron-builder --publish never -c ./electron-builder.config.js", - "electron:pack-demo": "npm run build && node patch-electron-builder.cjs && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never -c ./electron-builder.config.demo.js", - "electron:sign": "npm run electron:sign-prod && npm run electron:sign-dev", - "electron:sign-prod": "electron-osx-sign dist/mas/sdk.app --entitlements=./entitlements.mas.plist --entitlements-inherit=./entitlements.mas.inherit.plist --identity='Developer ID Application: Deep Foundation (XXXXXXXXXX)' --platform=mas --type=distribution --provisioning-profile=developer-id-sdk.provisionprofile", - "electron:sign-dev": "electron-osx-sign dist/mas-dev/sdk.app --identity='Developer ID Application: Deep Foundation (XXXXXXXXXX)' --platform=mas --type=development --entitlements=./entitlements.mas.plist --entitlements-inherit=./entitlements.mas.inherit.plist --provisioning-profile=./sdkdevelopment.provisionprofile", - "electron:notarize": "node notarize.cjs", - "electron:make": "npm run build && electron-builder build --config ./electron-builder.config.js", - "electron:make-and-publish": "npm run build && electron-builder build --config ./electron-builder.config.js --publish always" - }, - "dependencies": { - "@capacitor-community/electron": "^4.0.1", - "chokidar": "~3.5.2", - "electron-is-dev": "~2.0.0", - "electron-serve": "~1.1.0", - "electron-unhandled": "~3.0.2", - "electron-updater": "~4.3.9", - "electron-window-state": "~5.0.3", - "express": "^4.17.1", - "fix-path": "^3.0.0", - "fkill": "^7.2.1", - "internal-ip": "^6.2.0", - "microtime": "^3.0.0", - "rimraf": "^5.0.1", - "socket.io": "^4.2.0", - "typescript": "^5.0.4" - }, - "devDependencies": { - "@types/jest": "^29.5.3", - "@types/node": "^20.12.7", - "electron": "^15.5.7", - "electron-builder": "^23.0.2", - "electron-notarize": "^1.2.2", - "electron-rebuild": "~2.3.5", - "jest": "^29.6.1", - "jest-environment-jsdom": "^29.6.1", - "node-gyp": "^8.4.1", - "puppeteer": "^20.9.0", - "ts-jest": "^29.1.1" - }, - "keywords": [ - "capacitor", - "electron" - ] -} \ No newline at end of file +{"name":"@deep-foundation/perception-app","version":"0.0.20","description":"Your second memory.","homepage":"https://deep.foundation/","author":{"name":"Deep Foundation","email":"admin@deep.foundation"},"repository":{"type":"git","url":"https://github.com/deep-foundation/deepmemo-app"},"license":"MIT","main":"build/src/index.js","scripts":{"build":"rimraf ./build/src && tsc","test":"jest","electron:start-live":"node ./live-runner.js","electron:start":"npm run build && electron --inspect=5858 ./","electron:debug":"APP_DEV=true electron .","electron:pack":"npm run build && node patch-electron-builder.cjs && electron-builder --publish never -c ./electron-builder.config.js","electron:pack-demo":"npm run build && node patch-electron-builder.cjs && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never -c ./electron-builder.config.demo.js","electron:sign":"npm run electron:sign-prod && npm run electron:sign-dev","electron:sign-prod":"electron-osx-sign dist/mas/sdk.app --entitlements=./entitlements.mas.plist --entitlements-inherit=./entitlements.mas.inherit.plist --identity='Developer ID Application: Deep Foundation (XXXXXXXXXX)' --platform=mas --type=distribution --provisioning-profile=developer-id-sdk.provisionprofile","electron:sign-dev":"electron-osx-sign dist/mas-dev/sdk.app --identity='Developer ID Application: Deep Foundation (XXXXXXXXXX)' --platform=mas --type=development --entitlements=./entitlements.mas.plist --entitlements-inherit=./entitlements.mas.inherit.plist --provisioning-profile=./sdkdevelopment.provisionprofile","electron:notarize":"node notarize.cjs","electron:make":"npm run build && electron-builder build --config ./electron-builder.config.js","electron:make-and-publish":"npm run build && electron-builder build --config ./electron-builder.config.js --publish always"},"dependencies":{"@capacitor-community/electron":"^4.0.1","chokidar":"~3.5.2","electron-is-dev":"~2.0.0","electron-serve":"~1.1.0","electron-unhandled":"~3.0.2","electron-updater":"~4.3.9","electron-window-state":"~5.0.3","express":"^4.17.1","fix-path":"^3.0.0","fkill":"^7.2.1","internal-ip":"^6.2.0","microtime":"^3.0.0","rimraf":"^5.0.1","socket.io":"^4.2.0","typescript":"^5.0.4"},"devDependencies":{"@types/jest":"^29.5.3","@types/node":"^20.12.7","electron":"^15.5.7","electron-builder":"^23.0.2","electron-notarize":"^1.2.2","electron-rebuild":"~2.3.5","jest":"^29.6.1","jest-environment-jsdom":"^29.6.1","node-gyp":"^8.4.1","puppeteer":"^20.9.0","ts-jest":"^29.1.1"},"keywords":["capacitor","electron"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 08b4867..9a5b169 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "next-env": "^1.1.1", "next-i18next": "^15.2.0", "next-pwa": "^5.6.0", + "pre-commit": "^1.2.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-focus-lock": "^2.12.1", @@ -17699,7 +17700,6 @@ "engines": [ "node >= 0.8" ], - "peer": true, "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", @@ -17890,8 +17890,7 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "peer": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cors": { "version": "2.8.5", @@ -26934,8 +26933,7 @@ "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "peer": true + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/isexe": { "version": "2.0.0", @@ -31269,6 +31267,14 @@ "node": ">=0.10.0" } }, + "node_modules/os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha512-jd0cvB8qQ5uVt0lvCIexBaROw1KyKm5sbulg2fWOHjETisuCzWyt+eTZKEMs8v6HwzoGs8xik26jg7eCM6pS+A==", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -31876,6 +31882,81 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/pre-commit": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", + "integrity": "sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==", + "hasInstallScript": true, + "dependencies": { + "cross-spawn": "^5.0.1", + "spawn-sync": "^1.0.15", + "which": "1.2.x" + } + }, + "node_modules/pre-commit/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/pre-commit/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/pre-commit/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pre-commit/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pre-commit/node_modules/spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha512-9DWBgrgYZzNghseho0JOuh+5fg9u6QWhAWa51QC7+U5rCheZ/j1DrEZnyE0RBBRqZ9uEXGPgSSM0nky6burpVw==", + "hasInstallScript": true, + "dependencies": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "node_modules/pre-commit/node_modules/which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha512-16uPglFkRPzgiUXYMi1Jf8Z5EzN1iB4V0ZtMXcHZnwsBtQhhHeCqoWw7tsUY42hJGNDWtUsVLTjakIa5BgAxCw==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/pre-commit/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + }, "node_modules/prebuild-install": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", @@ -32006,8 +32087,7 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "peer": true + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "node_modules/progress": { "version": "2.0.3", @@ -32179,6 +32259,11 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -32807,7 +32892,6 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "peer": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -32821,8 +32905,7 @@ "node_modules/readable-stream/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "peer": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/readdirp": { "version": "3.6.0", @@ -35460,8 +35543,7 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "peer": true + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { "version": "5.5.3", diff --git a/package.json b/package.json index f5a0216..e391903 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deep-foundation/perception-app", - "version": "0.0.20", + "version": "0.0.21", "description": "", "license": "Unlicense", "main": "./bin/server.js", @@ -28,8 +28,12 @@ "dev": "(cd ./perception-imports; npm run package:app:sync); NEXT_PUBLIC_GRAPHQL_URL=https://deeplinks.deep.foundation/gql next dev", "run-ios": "npx cap run ios", "open-ios": "npx cap open ios", - "build-ios": "npm version prerelease --no-git-tag-version --no-commit-hook && rimraf app && NEXT_PUBLIC_BUILD=\"ios\" npm run export && npx cap sync ios" + "build-ios": "npm version prerelease --no-git-tag-version --no-commit-hook && rimraf app && NEXT_PUBLIC_BUILD=\"ios\" npm run export && npx cap sync ios", + "sync-versions": "node ./sync-version.js" }, + "pre-commit": [ + "sync-versions" + ], "dependencies": { "@chakra-ui/icons": "^2.1.1", "@chakra-ui/theme-tools": "^2.1.2", @@ -52,6 +56,7 @@ "next-env": "^1.1.1", "next-i18next": "^15.2.0", "next-pwa": "^5.6.0", + "pre-commit": "^1.2.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-focus-lock": "^2.12.1", diff --git a/sync-version.js b/sync-version.js new file mode 100644 index 0000000..3a5cc04 --- /dev/null +++ b/sync-version.js @@ -0,0 +1,6 @@ +const fs = require('fs'); +const path = require('path'); +const nextPckg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')); +const electronPckg = JSON.parse(fs.readFileSync(path.join(__dirname, 'electron', 'package.json'), 'utf8')); +electronPckg.id = nextPckg.id; +fs.writeFileSync(path.join(__dirname, 'electron', 'package.json'), JSON.stringify(electronPckg)); \ No newline at end of file