diff --git a/.github/workflows/get-versions.yaml b/.github/workflows/get-versions.yaml new file mode 100644 index 00000000..9c517c71 --- /dev/null +++ b/.github/workflows/get-versions.yaml @@ -0,0 +1,32 @@ +name: Extract Versions Workflow +on: + workflow_call: + outputs: + version: + description: "App version" + value: ${{ jobs.extract-versions.outputs.version }} + holochain_version: + description: "Holochain version" + value: ${{ jobs.extract-versions.outputs.holochain_version }} + lair_keystore_version: + description: "Lair keystore version" + value: ${{ jobs.extract-versions.outputs.lair_keystore_version }} + +jobs: + extract-versions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '18' + - name: Extract version information + id: packagejson + run: | + echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + echo "holochain_version=$(node -p "require('./package.json').binaries.holochain")" >> $GITHUB_OUTPUT + echo "lair_keystore_version=$(node -p "require('./package.json').binaries.lair_keystore")" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.packagejson.outputs.version }} + holochain_version: ${{ steps.packagejson.outputs.holochain_version }} + lair_keystore_version: ${{ steps.packagejson.outputs.lair_keystore_version }} \ No newline at end of file diff --git a/.github/workflows/holochain-binaries.yaml b/.github/workflows/holochain-binaries.yaml index 97b98107..5bb11d58 100644 --- a/.github/workflows/holochain-binaries.yaml +++ b/.github/workflows/holochain-binaries.yaml @@ -5,7 +5,10 @@ on: - 'holochain-binaries-v*' jobs: + extract-versions: + uses: ./.github/workflows/get-versions.yaml publish-holochain-binaries: + needs: extract-versions strategy: fail-fast: false matrix: @@ -41,30 +44,30 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cargo install holochain --version 0.2.5 --locked --features sqlite-encrypted + cargo install holochain --version ${{ needs.extract-versions.outputs.holochain_version }} --locked --features sqlite-encrypted $HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition - Copy-Item $HcPath -Destination holochain-v0.2.5-x86_64-pc-windows-msvc.exe + Copy-Item $HcPath -Destination holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-pc-windows-msvc.exe - gh release upload "$($env:GITHUB_REF -replace "refs/tags/")" "holochain-v0.2.5-x86_64-pc-windows-msvc.exe" + gh release upload "$($env:GITHUB_REF -replace "refs/tags/")" "holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-pc-windows-msvc.exe" - name: setup binaries (macos only) if: matrix.platform == 'macos-11' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cargo install holochain --version 0.2.5 --locked --features sqlite-encrypted + cargo install holochain --version ${{ needs.extract-versions.outputs.holochain_version }} --locked --features sqlite-encrypted HOLOCHAIN_PATH=$(which holochain) - cp $HOLOCHAIN_PATH holochain-v0.2.5-x86_64-apple-darwin + cp $HOLOCHAIN_PATH holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-apple-darwin - gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v0.2.5-x86_64-apple-darwin" + gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-apple-darwin" - name: setup binaries (ubuntu only) if: matrix.platform == 'ubuntu-22.04' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cargo install holochain --version 0.2.5 --locked --features sqlite-encrypted + cargo install holochain --version ${{ needs.extract-versions.outputs.holochain_version }} --locked --features sqlite-encrypted HOLOCHAIN_PATH=$(which holochain) - cp $HOLOCHAIN_PATH holochain-v0.2.5-x86_64-unknown-linux-gnu + cp $HOLOCHAIN_PATH holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-unknown-linux-gnu - gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v0.2.5-x86_64-unknown-linux-gnu" + gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-unknown-linux-gnu" diff --git a/.github/workflows/lair-binaries.yaml b/.github/workflows/lair-binaries.yaml index eef31db3..431a62ed 100644 --- a/.github/workflows/lair-binaries.yaml +++ b/.github/workflows/lair-binaries.yaml @@ -5,7 +5,10 @@ on: - 'lair-binaries-v*' jobs: + extract-versions: + uses: ./.github/workflows/get-versions.yaml publish-lair-binaries: + needs: extract-versions strategy: fail-fast: false matrix: @@ -41,30 +44,30 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cargo install --version 0.4.2 lair_keystore + cargo install --version ${{ needs.extract-versions.outputs.lair_keystore }} lair_keystore $LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition - Copy-Item $LkPath -Destination "lair-keystore-v0.4.2-x86_64-pc-windows-msvc.exe" + Copy-Item $LkPath -Destination "lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-pc-windows-msvc.exe" - gh release upload "$($env:GITHUB_REF -replace "refs/tags/")" "lair-keystore-v0.4.2-x86_64-pc-windows-msvc.exe" + gh release upload "$($env:GITHUB_REF -replace "refs/tags/")" "lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-pc-windows-msvc.exe" - name: setup binaries (macos only) if: matrix.platform == 'macos-11' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cargo install --version 0.4.2 lair_keystore + cargo install --version ${{ needs.extract-versions.outputs.lair_keystore }} lair_keystore LAIR_PATH=$(which lair-keystore) - cp $LAIR_PATH lair-keystore-v0.4.2-x86_64-apple-darwin + cp $LAIR_PATH lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-apple-darwin - gh release upload "${GITHUB_REF#refs/tags/}" "lair-keystore-v0.4.2-x86_64-apple-darwin" + gh release upload "${GITHUB_REF#refs/tags/}" "lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-apple-darwin" - name: setup binaries (ubuntu only) if: matrix.platform == 'ubuntu-20.04' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cargo install --version 0.4.2 lair_keystore + cargo install --version ${{ needs.extract-versions.outputs.lair_keystore }} lair_keystore LAIR_PATH=$(which lair-keystore) - cp $LAIR_PATH lair-keystore-v0.4.2-x86_64-unknown-linux-gnu + cp $LAIR_PATH lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-unknown-linux-gnu - gh release upload "${GITHUB_REF#refs/tags/}" "lair-keystore-v0.4.2-x86_64-unknown-linux-gnu" + gh release upload "${GITHUB_REF#refs/tags/}" "lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-unknown-linux-gnu" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4575e6c6..2b75d72e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,7 +5,10 @@ on: - release jobs: + extract-versions: + uses: ./.github/workflows/get-versions.yaml create-draft-release: + needs: extract-versions runs-on: ubuntu-latest outputs: release_id: ${{ steps.create_release.outputs.id }} @@ -14,16 +17,12 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '18' - - name: Get version - id: packagejson - run: | - echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT - name: Create Draft Release id: create_release uses: ncipollo/release-action@v1 with: - tag: v${{ steps.packagejson.outputs.version }} - name: v${{ steps.packagejson.outputs.version }} + tag: v${{ needs.extract-versions.outputs.version }} + name: v${{ needs.extract-versions.outputs.version }} (Holochain v${{ needs.extract-versions.outputs.holochain_version }}) draft: true generateReleaseNotes: true allowUpdates: true @@ -89,17 +88,17 @@ jobs: run: | mkdir resources/bins - # cargo install --version 0.4.2 lair_keystore + # cargo install --version ${{ needs.extract-versions.outputs.lair_keystore }} lair_keystore # $LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition - # Copy-Item $LkPath -Destination resources/bins/lair-keystore-v0.4.2.exe + # Copy-Item $LkPath -Destination resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}.exe - curl -L --output resources/bins/lair-keystore-v0.4.2.exe https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v0.4.2/lair-keystore-v0.4.2-x86_64-pc-windows-msvc.exe + curl -L --output resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}.exe https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v${{ needs.extract-versions.outputs.lair_keystore }}/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-pc-windows-msvc.exe - # cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted + # cargo install holochain --version ${{ needs.extract-versions.outputs.holochain_version }} --locked --features sqlite-encrypted # $HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition - # Copy-Item $HcPath -Destination resources/bins/holochain-v0.2.5-rc.1.exe + # Copy-Item $HcPath -Destination resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }}.exe - curl -L --output resources/bins/holochain-v0.2.5-rc.1-8613839.exe https://github.com/holochain/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.1-8613839/holochain-v0.2.5-rc.1-8613839-x86_64-pc-windows-msvc.exe + curl -L --output resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }}.exe https://github.com/holochain/launcher-electron/releases/download/holochain-binaries-v${{ needs.extract-versions.outputs.holochain_version }}/holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-pc-windows-msvc.exe # NEW_VERSION: install new holochain version and copy its binary to the tauri path @@ -108,19 +107,19 @@ jobs: run: | mkdir resources/bins - # cargo install --version 0.4.2 lair_keystore + # cargo install --version ${{ needs.extract-versions.outputs.lair_keystore }} lair_keystore # LAIR_PATH=$(which lair-keystore) - # cp $LAIR_PATH resources/bins/lair-keystore-v0.4.2 + # cp $LAIR_PATH resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }} - curl -L --output resources/bins/lair-keystore-v0.4.2 https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v0.4.2/lair-keystore-v0.4.2-x86_64-apple-darwin - chmod +x ./resources/bins/lair-keystore-v0.4.2 + curl -L --output resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }} https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v${{ needs.extract-versions.outputs.lair_keystore }}/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-apple-darwin + chmod +x ./resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }} - # cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted + # cargo install holochain --version ${{ needs.extract-versions.outputs.holochain_version }} --locked --features sqlite-encrypted # HOLOCHAIN_PATH=$(which holochain) - # cp $HOLOCHAIN_PATH resources/bins/holochain-v0.2.5-rc.1 + # cp $HOLOCHAIN_PATH resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }} - curl -L --output resources/bins/holochain-v0.2.5-rc.1-8613839 https://github.com/holochain/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.1-8613839/holochain-v0.2.5-rc.1-8613839-x86_64-apple-darwin - chmod +x ./resources/bins/holochain-v0.2.5-rc.1-8613839 + curl -L --output resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }} https://github.com/holochain/launcher-electron/releases/download/holochain-binaries-v${{ needs.extract-versions.outputs.holochain_version }}/holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-apple-darwin + chmod +x ./resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }} # NEW_VERSION: install new holochain version and copy its binary to the tauri path @@ -129,19 +128,19 @@ jobs: run: | mkdir resources/bins - # cargo install --version 0.4.2 lair_keystore + # cargo install --version ${{ needs.extract-versions.outputs.lair_keystore }} lair_keystore # LAIR_PATH=$(which lair-keystore) - # cp $LAIR_PATH resources/bins/lair-keystore-v0.4.2 + # cp $LAIR_PATH resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }} - curl -L --output resources/bins/lair-keystore-v0.4.2 https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v0.4.2/lair-keystore-v0.4.2-x86_64-unknown-linux-gnu - chmod +x ./resources/bins/lair-keystore-v0.4.2 + curl -L --output resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }} https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v${{ needs.extract-versions.outputs.lair_keystore }}/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }}-x86_64-unknown-linux-gnu + chmod +x ./resources/bins/lair-keystore-v${{ needs.extract-versions.outputs.lair_keystore }} - # cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted + # cargo install holochain --version ${{ needs.extract-versions.outputs.holochain_version }} --locked --features sqlite-encrypted # HOLOCHAIN_PATH=$(which holochain) - # cp $HOLOCHAIN_PATH resources/bins/holochain-v0.2.5-rc.1 + # cp $HOLOCHAIN_PATH resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }} - curl -L --output resources/bins/holochain-v0.2.5-rc.1-8613839 https://github.com/holochain/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.1-8613839/holochain-v0.2.5-rc.1-8613839-x86_64-unknown-linux-gnu - chmod +x ./resources/bins/holochain-v0.2.5-rc.1-8613839 + curl -L --output resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }} https://github.com/holochain/launcher-electron/releases/download/holochain-binaries-v${{ needs.extract-versions.outputs.holochain_version }}/holochain-v${{ needs.extract-versions.outputs.holochain_version }}-x86_64-unknown-linux-gnu + chmod +x ./resources/bins/holochain-v${{ needs.extract-versions.outputs.holochain_version }} # NEW_VERSION: install new holochain version and copy its binary to the tauri path diff --git a/package.json b/package.json index b41501b9..cbaf6134 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,10 @@ "author": "Holochain Foundation (http://holochain.org)", "license": "CAL-1.0", "main": "./out/main/index.js", + "binaries": { + "holochain": "0.2.5", + "lair_keystore": "0.4.2" + }, "workspaces": [ "src/renderer" ], @@ -50,6 +54,7 @@ "@electron-toolkit/tsconfig": "^1.0.1", "@napi-rs/cli": "^2.16.3", "@types/node": "^20.10.5", + "@types/split": "^1.0.5", "concurrently": "^8.2.2", "electron": "^28.1.1", "electron-builder": "^24.9.1", diff --git a/scripts/setup-binaries.sh b/scripts/setup-binaries.sh index 49857176..6cee9dc2 100644 --- a/scripts/setup-binaries.sh +++ b/scripts/setup-binaries.sh @@ -1,7 +1,7 @@ #!/bin/bash -REQUIRED_HOLOCHAIN_VERSION="0.2.5-rc.1" -REQUIRED_LAIR_VERSION="0.4.1" +REQUIRED_HOLOCHAIN_VERSION=$(node -p "require('./package.json').binaries.holochain") +REQUIRED_LAIR_VERSION=$(node -p "require('./package.json').binaries.lair_keystore") # Check that this script is being run from the right location if [ ! -f "package.json" ] || [ ! -f "electron-builder.yml" ]; diff --git a/src/main/binaries.ts b/src/main/binaries.ts index e1a50da1..157117e0 100644 --- a/src/main/binaries.ts +++ b/src/main/binaries.ts @@ -1,14 +1,30 @@ import { app } from 'electron'; +import fs from 'fs'; +import { readFileSync } from 'fs'; import * as path from 'path'; -export const DEFAULT_HOLOCHAIN_VERSION = '0.2.5-rc.1-8613839'; +import { HolochainLairVersionSchema } from '../types'; -const BINARIES_DIRECTORY = app.isPackaged - ? path.join(app.getAppPath(), '../app.asar.unpacked/resources/bins') - : path.join(app.getAppPath(), './resources/bins'); +const getFilePath = (relativePath) => path.join(app.getAppPath(), relativePath); + +const getPackageJSONPath = () => + getFilePath(app.isPackaged ? '../app.asar.unpacked/package.json' : './package.json'); + +const readJSONFile = (filePath) => JSON.parse(readFileSync(filePath, 'utf8')); + +const packageJSON = readJSONFile(getPackageJSONPath()); + +const HolochainLairVersion = HolochainLairVersionSchema.parse(packageJSON); + +export const DEFAULT_HOLOCHAIN_VERSION = HolochainLairVersion.binaries.holochain; +export const DEFAULT_LAIR_KEYSTORE_VERSION = HolochainLairVersion.binaries.lair_keystore; + +const BINARIES_DIRECTORY = getFilePath( + app.isPackaged ? '../app.asar.unpacked/resources/bins' : './resources/bins', +); const HOLOCHAIN_BINARIES = { - '0.2.5-rc.1-8613839': path.join( + DEFAULT_HOLOCHAIN_VERSION: path.join( BINARIES_DIRECTORY, `holochain-v${DEFAULT_HOLOCHAIN_VERSION}${process.platform === 'win32' ? '.exe' : ''}`, ), @@ -16,7 +32,10 @@ const HOLOCHAIN_BINARIES = { const LAIR_BINARY = path.join( BINARIES_DIRECTORY, - `lair-keystore-v0.4.2${process.platform === 'win32' ? '.exe' : ''}`, + `lair-keystore-v${DEFAULT_LAIR_KEYSTORE_VERSION}${process.platform === 'win32' ? '.exe' : ''}`, ); +export const checkHolochainLairBinariesExist = () => + [...Object.values(HOLOCHAIN_BINARIES), LAIR_BINARY].every(fs.existsSync); + export { HOLOCHAIN_BINARIES, LAIR_BINARY }; diff --git a/src/main/index.ts b/src/main/index.ts index ea991086..7aea2e1d 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -25,10 +25,12 @@ import { InstallKandoSchema, LOADING_PROGRESS_UPDATE, mainScreen, + MISSING_BINARIES, NO_RUNNING_HOLOCHAIN_MANAGER_ERROR, settingsScreen, WRONG_INSTALLED_APP_STRUCTURE, } from '../types'; +import { checkHolochainLairBinariesExist } from './binaries'; import { validateArgs } from './cli'; import { LauncherFileSystem } from './filesystem'; import { HolochainManager } from './holochainManager'; @@ -364,6 +366,14 @@ const router = t.router({ await holochainManager.installWebHapp(filePath, appId, networkSeed); }), lairSetupRequired: t.procedure.query(() => { + const holochainLairBinariesExist = checkHolochainLairBinariesExist(); + + if (!holochainLairBinariesExist) { + return throwTRPCErrorError({ + message: MISSING_BINARIES, + }); + } + const isInitialized = LAUNCHER_FILE_SYSTEM.keystoreInitialized() || VALIDATED_CLI_ARGS.holochainVersion.type === 'running-external'; diff --git a/src/main/utils.ts b/src/main/utils.ts index 4134497a..407092e1 100644 --- a/src/main/utils.ts +++ b/src/main/utils.ts @@ -116,7 +116,7 @@ export function isHappAlreadyOpened({ return true; } -export function breakingVersion(version) { +export function breakingVersion(version: string) { if (!semver.valid(version)) { throw new Error('Version is not valid semver.'); } diff --git a/src/renderer/src/lib/locale/en/common.json b/src/renderer/src/lib/locale/en/common.json index e85a95a6..d97e72ba 100644 --- a/src/renderer/src/lib/locale/en/common.json +++ b/src/renderer/src/lib/locale/en/common.json @@ -1,5 +1,6 @@ { "addApps": "Add Apps", + "appError": "App Error", "back": "Back", "chooseAPassword": "Choose a password", "chooseCarefullyPasswordsCanNotBeRecovered": "Choose carefully! Passwords can not be recovered.", diff --git a/src/renderer/src/lib/locale/en/errors.json b/src/renderer/src/lib/locale/en/errors.json index 04cd35d2..c398231b 100644 --- a/src/renderer/src/lib/locale/en/errors.json +++ b/src/renderer/src/lib/locale/en/errors.json @@ -4,6 +4,7 @@ "fileUndefinedError": "File undefined", "initializeLairKeystoreError": "Error initializing lair keystore", "launchLairKeystoreError": "Error launching lair keystore", + "missingBinaries": "There are missing holochain or lair keystore binaries", "noRunningHolochainManagerError": "No running Holochain manager", "unknownError": "Unknown error", "wrongInstalledAppStructure": "Wrong installed app structure", diff --git a/src/renderer/src/routes/+page.svelte b/src/renderer/src/routes/+page.svelte index d1523035..512c352a 100644 --- a/src/renderer/src/routes/+page.svelte +++ b/src/renderer/src/routes/+page.svelte @@ -1,15 +1,27 @@ -{#if $lairSetupRequired.isLoading} - -{:else if $lairSetupRequired.error} - -{/if} + diff --git a/src/types/errors.ts b/src/types/errors.ts index c49a94f1..2057b86b 100644 --- a/src/types/errors.ts +++ b/src/types/errors.ts @@ -6,6 +6,7 @@ export const WRONG_PASSWORD = 'wrongPassword'; export const WRONG_INSTALLED_APP_STRUCTURE = 'wrongInstalledAppStructure'; export const CHECK_INITIALIZED_KEYSTORE_ERROR = 'checkInitializedKeystoreError'; export const NO_RUNNING_HOLOCHAIN_MANAGER_ERROR = 'noRunningHolochainManagerError'; +export const MISSING_BINARIES = 'missingBinaries'; export const FILE_UNDEFINED_ERROR = 'fileUndefinedError'; export type ErrorWithMessage = { diff --git a/src/types/launcher.ts b/src/types/launcher.ts index 2b4f674e..c001cbaf 100644 --- a/src/types/launcher.ts +++ b/src/types/launcher.ts @@ -1,4 +1,5 @@ import type { AgentPubKey } from '@holochain/client'; +import { z } from 'zod'; export const mainScreen = 'main'; export const settingsScreen = 'settings'; @@ -12,3 +13,10 @@ export type WindowInfo = { }; export type WindowInfoRecord = Record; + +export const HolochainLairVersionSchema = z.object({ + binaries: z.object({ + holochain: z.string(), + lair_keystore: z.string(), + }), +}); diff --git a/yarn.lock b/yarn.lock index 7aaea460..644c999a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -906,6 +906,21 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== +"@types/split@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/split/-/split-1.0.5.tgz#4bd47164b81d6381db37978d5344b374b6825f6c" + integrity sha512-gMiDr4vA6YofTpAkPQtP+5pvStIf3CMYphf32YAG/3RwogNL8ii1CQKDc+sxN62KuxPoRaJXcf2zDCDkEBH4FA== + dependencies: + "@types/node" "*" + "@types/through" "*" + +"@types/through@*": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.33.tgz#14ebf599320e1c7851e7d598149af183c6b9ea56" + integrity sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ== + dependencies: + "@types/node" "*" + "@types/triple-beam@^1.3.2": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c"