Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Jan 31, 2024
2 parents 62cc5fb + fb0f1a8 commit 81b2158
Show file tree
Hide file tree
Showing 35 changed files with 738 additions and 307 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/holochain-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,30 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo install holochain --version 0.2.5-rc.0 --locked --features sqlite-encrypted
cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination holochain-v0.2.5-rc.0-x86_64-pc-windows-msvc.exe
Copy-Item $HcPath -Destination holochain-v0.2.5-rc.1-x86_64-pc-windows-msvc.exe
gh release upload "$($env:GITHUB_REF -replace "refs/tags/")" "holochain-v0.2.5-rc.0-x86_64-pc-windows-msvc.exe"
gh release upload "$($env:GITHUB_REF -replace "refs/tags/")" "holochain-v0.2.5-rc.1-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-rc.0 --locked --features sqlite-encrypted
cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH holochain-v0.2.5-rc.0-x86_64-apple-darwin
cp $HOLOCHAIN_PATH holochain-v0.2.5-rc.1-x86_64-apple-darwin
gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v0.2.5-rc.0-x86_64-apple-darwin"
gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v0.2.5-rc.1-x86_64-apple-darwin"
- name: setup binaries (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo install holochain --version 0.2.5-rc.0 --locked --features sqlite-encrypted
cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH holochain-v0.2.5-rc.0-x86_64-unknown-linux-gnu
cp $HOLOCHAIN_PATH holochain-v0.2.5-rc.1-x86_64-unknown-linux-gnu
gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v0.2.5-rc.0-x86_64-unknown-linux-gnu"
gh release upload "${GITHUB_REF#refs/tags/}" "holochain-v0.2.5-rc.1-x86_64-unknown-linux-gnu"
2 changes: 1 addition & 1 deletion .github/workflows/publish-happ.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
allowUpdates: true
artifacts: 'workdir/we.happ'
body: 'See assets below to download and install this version.'
name: We happ v${{ steps.version.outputs.APP_VERSION }}-holochain-0.2.5-rc.0
name: We happ v${{ steps.version.outputs.APP_VERSION }}-holochain-0.2.5-rc.1
tag: we-alpha-happ-v${{ steps.version.outputs.APP_VERSION }}
prerelease: true
draft: true
56 changes: 28 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ jobs:
run: |
mkdir resources/bins
cargo install --version 0.3.0 lair_keystore
$LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition
Copy-Item $LkPath -Destination resources/bins/lair-keystore-v0.3.0.exe
# cargo install --version 0.4.1 lair_keystore
# $LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition
# Copy-Item $LkPath -Destination resources/bins/lair-keystore-v0.4.1.exe
# curl -L --output resources/bins/lair-keystore-v0.3.0.exe https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-pc-windows-msvc.exe
curl -L --output resources/bins/lair-keystore-v0.4.1.exe https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v0.4.1/lair-keystore-v0.4.1-x86_64-pc-windows-msvc.exe
cargo install holochain --version 0.2.5-rc.0 --locked --features sqlite-encrypted
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination resources/bins/holochain-v0.2.5-rc.0.exe
# cargo install holochain --version 0.2.5-rc.1 --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
# curl -L --output resources/bins/holochain-v0.2.5-rc.0.exe https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.0/holochain-v0.2.5-rc.0-x86_64-pc-windows-msvc.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
# NEW_VERSION: install new holochain version and copy its binary to the tauri path
Expand All @@ -79,19 +79,19 @@ jobs:
run: |
mkdir resources/bins
cargo install --version 0.3.0 lair_keystore
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH resources/bins/lair-keystore-v0.3.0
# cargo install --version 0.4.1 lair_keystore
# LAIR_PATH=$(which lair-keystore)
# cp $LAIR_PATH resources/bins/lair-keystore-v0.4.1
# curl -L --output resources/bins/lair-keystore-v0.3.0 https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-apple-darwin
# chmod +x ./resources/bins/lair-keystore-v0.3.0
curl -L --output resources/bins/lair-keystore-v0.4.1 https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v0.4.1/lair-keystore-v0.4.1-x86_64-apple-darwin
chmod +x ./resources/bins/lair-keystore-v0.4.1
cargo install holochain --version 0.2.5-rc.0 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH resources/bins/holochain-v0.2.5-rc.0
# cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted
# HOLOCHAIN_PATH=$(which holochain)
# cp $HOLOCHAIN_PATH resources/bins/holochain-v0.2.5-rc.1
# curl -L --output resources/bins/holochain-v0.2.5-rc.0 https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.0/holochain-v0.2.5-rc.0-x86_64-apple-darwin
# chmod +x ./resources/bins/holochain-v0.2.5-rc.0
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
# NEW_VERSION: install new holochain version and copy its binary to the tauri path
Expand All @@ -100,19 +100,19 @@ jobs:
run: |
mkdir resources/bins
cargo install --version 0.3.0 lair_keystore
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH resources/bins/lair-keystore-v0.3.0
# cargo install --version 0.4.1 lair_keystore
# LAIR_PATH=$(which lair-keystore)
# cp $LAIR_PATH resources/bins/lair-keystore-v0.4.1
# curl -L --output resources/bins/lair-keystore-v0.3.0 https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-unknown-linux-gnu
# chmod +x ./resources/bins/lair-keystore-v0.3.0
curl -L --output resources/bins/lair-keystore-v0.4.1 https://github.com/holochain/launcher-electron/releases/download/lair-binaries-v0.4.1/lair-keystore-v0.4.1-x86_64-unknown-linux-gnu
chmod +x ./resources/bins/lair-keystore-v0.4.1
cargo install holochain --version 0.2.5-rc.0 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH resources/bins/holochain-v0.2.5-rc.0
# cargo install holochain --version 0.2.5-rc.1 --locked --features sqlite-encrypted
# HOLOCHAIN_PATH=$(which holochain)
# cp $HOLOCHAIN_PATH resources/bins/holochain-v0.2.5-rc.1
# curl -L --output resources/bins/holochain-v0.2.5-rc.0 https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.0/holochain-v0.2.5-rc.0-x86_64-unknown-linux-gnu
# chmod +x ./resources/bins/holochain-v0.2.5-rc.0
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
# NEW_VERSION: install new holochain version and copy its binary to the tauri path
Expand Down
8 changes: 4 additions & 4 deletions docs/install-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ cargo install --version 0.3.0 lair_keystore
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-v0.3.0-[_ARCHITECTURE_]
cargo install holochain --version holochain-v0.2.5-rc.0 --locked --features sqlite-encrypted
cargo install holochain --version holochain-v0.2.5-rc.1 --locked --features sqlite-encrypted
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.5-rc.0-[_ARCHITECTURE_]
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.5-rc.1-[_ARCHITECTURE_]
```

Expand All @@ -27,8 +27,8 @@ cargo install --version 0.3.0 lair_keystore
$LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition
Copy-Item $LkPath -Destination src-tauri/bins/lair-keystore-v0.3.0-x86_64-pc-windows-msvc.exe
cargo install holochain --version holochain-v0.2.5-rc.0 --locked --features sqlite-encrypted
cargo install holochain --version holochain-v0.2.5-rc.1 --locked --features sqlite-encrypted
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.2.5-rc.0-x86_64-pc-windows-msvc.exe
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.2.5-rc.1-x86_64-pc-windows-msvc.exe
```
5 changes: 4 additions & 1 deletion example/ui/src/applet-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export class AppletMain extends LitElement {

async userSelectHrl() {
const selectedHrl = await this.weClient.userSelectHrl();
console.log('User selected HRL: ', selectedHrl);
this.selectedHrl = selectedHrl;
}

Expand Down Expand Up @@ -139,7 +138,11 @@ export class AppletMain extends LitElement {
<a href="${this.hrlLink}"
>${this.hrlLink ? this.hrlLink : 'Paste HRL in field above to update me'}</a
>
<a href="${this.hrlLink}" target="_blank"
>${this.hrlLink ? this.hrlLink : 'Paste HRL in field above to update me'}</a
>
<a href="https://duckduckgo.com">duckduckgo.com</a>
<a href="https://duckduckgo.com" traget="_blank">duckduckgo.com</a>
</div>
<div class="row" style="flex-wrap: wrap;">
<all-posts
Expand Down
2 changes: 1 addition & 1 deletion example/ui/src/example-applet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ExampleApplet extends LitElement {
const appInfo = await client.appInfo();
const dnaHash = (appInfo.cell_info.forum[0] as any)[CellType.Provisioned]
.cell_id[0];
this.weClient!.openHrl({ hrl: [dnaHash, e.detail.postHash] });
this.weClient!.openHrl({ hrl: [dnaHash, e.detail.postHash] }, 'front');
}}
></applet-main>
</attachments-context>
Expand Down
2 changes: 1 addition & 1 deletion libs/we-applet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightningrodlabs/we-applet",
"version": "0.14.0",
"version": "0.14.2",
"main": "./dist/index.js",
"module": "./dist/index.js",
"exports": {
Expand Down
7 changes: 4 additions & 3 deletions libs/we-applet/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
AppletHash,
AppletInfo,
AttachableLocationAndInfo,
OpenHrlMode,
} from './types';
import { postMessage } from './utils';

Expand Down Expand Up @@ -152,7 +153,7 @@ export interface WeServices {
* @param context
* @returns
*/
openHrl: (hrlWithContext: HrlWithContext) => Promise<void>;
openHrl: (hrlWithContext: HrlWithContext, mode?: OpenHrlMode) => Promise<void>;
/**
* Get the group profile of the specified group
* @param groupId
Expand Down Expand Up @@ -249,8 +250,8 @@ export class WeClient implements WeServices {
openCrossAppletBlock = (appletBundleId: ActionHash, block: string, context: any): Promise<void> =>
window.__WE_API__.openCrossAppletBlock(appletBundleId, block, context);

openHrl = (hrlWithContext: HrlWithContext): Promise<void> =>
window.__WE_API__.openHrl(hrlWithContext);
openHrl = (hrlWithContext: HrlWithContext, mode?: OpenHrlMode): Promise<void> =>
window.__WE_API__.openHrl(hrlWithContext, mode);

groupProfile = (groupId) => window.__WE_API__.groupProfile(groupId);

Expand Down
3 changes: 3 additions & 0 deletions libs/we-applet/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export type AppletId = EntryHashB64;
export type Hrl = [DnaHash, ActionHash | EntryHash];
export type HrlB64 = [DnaHashB64, ActionHashB64 | EntryHashB64];

export type OpenHrlMode = 'front' | 'side';

// Contextual reference to a Hrl
// Useful use case: image we want to point to a specific section of a document
// The document action hash would be the Hrl, and the context could be { section: "Second Paragraph" }
Expand Down Expand Up @@ -317,6 +319,7 @@ export type OpenViewRequest =
| {
type: 'hrl';
hrlWithContext: HrlWithContext;
mode?: OpenHrlMode;
};

export type CreateAttachmentRequest = {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"download:appstore": "curl -L --output resources/default-apps/AppstoreLight.happ https://github.com/matthme/appstore-light/releases/download/appstore-light-0.0.4/AppstoreLight.happ",
"download:we-happ": "curl -L --output resources/default-apps/we.happ https://github.com/lightningrodlabs/we/releases/download/we-alpha-happ-v0.10.0/we.happ",
"postinstall": "electron-builder install-app-deps",
"fetch-binaries:linux": "curl -L --output resources/bins/lair-keystore-v0.3.0 https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-unknown-linux-gnu && curl -L --output resources/bins/holochain-v0.2.5-rc.0 https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.0/holochain-v0.2.5-rc.0-x86_64-unknown-linux-gnu",
"fetch-binaries:macos": "curl -L --output resources/bins/lair-keystore-v0.3.0 https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-apple-darwin && curl -L --output resources/bins/holochain-v0.2.5-rc.0 https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.0/holochain-v0.2.5-rc.0-x86_64-apple-darwin",
"fetch-binaries:windows": "curl -L --output resources/bins/lair-keystore-v0.3.0.exe https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-pc-windows-msvc.exe && curl -L --output resources/bins/holochain-v0.2.5-rc.0.exe https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.0/holochain-v0.2.5-rc.0-x86_64-pc-windows-msvc.exe",
"fetch-binaries:linux": "curl -L --output resources/bins/lair-keystore-v0.3.0 https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-unknown-linux-gnu && curl -L --output resources/bins/holochain-v0.2.5-rc.1 https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.1/holochain-v0.2.5-rc.1-x86_64-unknown-linux-gnu",
"fetch-binaries:macos": "curl -L --output resources/bins/lair-keystore-v0.3.0 https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-apple-darwin && curl -L --output resources/bins/holochain-v0.2.5-rc.1 https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.1/holochain-v0.2.5-rc.1-x86_64-apple-darwin",
"fetch-binaries:windows": "curl -L --output resources/bins/lair-keystore-v0.3.0.exe https://github.com/matthme/launcher-electron/releases/download/lair-binaries-v0.3.0/lair-keystore-v0.3.0-x86_64-pc-windows-msvc.exe && curl -L --output resources/bins/holochain-v0.2.5-rc.1.exe https://github.com/matthme/launcher-electron/releases/download/holochain-binaries-v0.2.5-rc.1/holochain-v0.2.5-rc.1-x86_64-pc-windows-msvc.exe",
"build:win": "yarn build && electron-builder --win --config",
"build:mac": "yarn build && electron-builder --mac --config",
"build:linux": "yarn build && electron-builder --linux --config"
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup-binaries.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

REQUIRED_HOLOCHAIN_VERSION="0.2.3"
REQUIRED_LAIR_VERSION="0.3.0"
REQUIRED_HOLOCHAIN_VERSION="0.2.5-rc.1"
REQUIRED_LAIR_VERSION="0.4.1"

# Check that this script is being run from the right location
if [ ! -f "package.json" ] || [ ! -f "electron-builder.yml" ];
Expand Down
6 changes: 3 additions & 3 deletions src/main/binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ const BINARIES_DIRECTORY = app.isPackaged
: path.join(app.getAppPath(), './resources/bins');

const HOLOCHAIN_BINARIES = {
'holochain-v0.2.5-rc.0': path.join(
'holochain-v0.2.5-rc.1-8613839': path.join(
BINARIES_DIRECTORY,
`holochain-v0.2.5-rc.0${process.platform === 'win32' ? '.exe' : ''}`,
`holochain-v0.2.5-rc.1-8613839${process.platform === 'win32' ? '.exe' : ''}`,
),
};

const LAIR_BINARY = path.join(
BINARIES_DIRECTORY,
`lair-keystore-v0.3.0${process.platform === 'win32' ? '.exe' : ''}`,
`lair-keystore-v0.4.1${process.platform === 'win32' ? '.exe' : ''}`,
);

export { HOLOCHAIN_BINARIES, LAIR_BINARY };
2 changes: 1 addition & 1 deletion src/main/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function launch(
password,
);

const holochainVersion = 'holochain-v0.2.5-rc.0';
const holochainVersion = 'holochain-v0.2.5-rc.1-8613839';

if (splashscreenWindow)
splashscreenWindow.webContents.send(
Expand Down
7 changes: 5 additions & 2 deletions src/main/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BrowserWindow, shell } from 'electron';
export function setLinkOpenHandlers(browserWindow: BrowserWindow): void {
// links in happ windows should open in the system default application
browserWindow.webContents.on('will-frame-navigate', (e) => {
console.log('GOT WILL-NAVIGATE EVENT: ', e);
// console.log('GOT WILL-NAVIGATE EVENT: ', e);
if (e.url.startsWith('http://localhost:')) {
// ignore vite routing in dev mode
return;
Expand All @@ -22,7 +22,7 @@ export function setLinkOpenHandlers(browserWindow: BrowserWindow): void {
});
// instead of the webview
browserWindow.webContents.on('will-navigate', (e) => {
console.log('GOT WILL-NAVIGATE EVENT: ', e);
// console.log('GOT WILL-NAVIGATE EVENT: ', e);
if (e.url.startsWith('http://localhost:')) {
// ignore vite routing in dev mode
return;
Expand All @@ -44,6 +44,9 @@ export function setLinkOpenHandlers(browserWindow: BrowserWindow): void {
// happ windows are not allowed to spawn new electron windows
browserWindow.webContents.setWindowOpenHandler((details) => {
console.log('GOT NEW WINDOW EVENT: ', details);
if (details.url.startsWith('we://')) {
emitToWindow(browserWindow, 'deep-link-received', details.url);
}
if (details.url.startsWith('http://') || details.url.startsWith('https://')) {
shell.openExternal(details.url);
}
Expand Down
Binary file added src/renderer/public/pocket_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/renderer/public/pocket_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 81b2158

Please sign in to comment.