Skip to content

Lykhoyda/add snap #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: lts/*

- uses: pnpm/action-setup@v4

- run: corepack enable

- name: Install dependencies
run: pnpm i
run: yarn install --immutable

- name: Build
run: pnpm build
run: yarn build

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3.0
Expand All @@ -49,4 +48,4 @@ jobs:
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
timeout-minutes: 1
8 changes: 4 additions & 4 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
with:
node-version: lts/*

- uses: pnpm/action-setup@v4
- run: corepack enable

- name: Install dependencies
run: pnpm i
run: yarn install --immutable

- name: Install Playwright Browsers
working-directory: ./packages/e2e-tests/
run: npx playwright install --with-deps
run: yarn playwright install --with-deps

- name: Run Playwright tests
run: pnpm run test:e2e
run: yarn run test:e2e
26 changes: 16 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
/target
# Common
target
node_modules
.DS_STORE
.idea
.parcel-cache
.vscode
dist

.pnp.*
# Package Manager
.parcel-cache
.yarn/*

!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.parcel-cache
# Developer tools
.idea
.vscode

packages/demo-wallet/dist/*
packages/e2e-tests/dist/*
./dist/*
# Wasm package
packages/wasm/lib

# Demo Wallet package
packages/demo-wallet/dist/*
!packages/demo-wallet/dist/_headers

# e2e Tests package
packages/e2e-tests/dist/*
!packages/e2e-tests/dist/serve.json

5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
quoteProps: 'as-needed',
singleQuote: true,
tabWidth: 2,
};
8 changes: 8 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
compressionLevel: 0

enableGlobalCache: true

nmMode: hardlinks-local

nodeLinker: node-modules

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ just build

#### Prerequisites

[Install pnpm](https://pnpm.io/installation)
[Install yarn](https://yarnpkg.com/getting-started/install)

### Building

Expand All @@ -89,19 +89,19 @@ just build
Install js dependencies with

```shell
pnpm i
yarn i
```

Build the demo wallet with

```shell
pnpm build
yarn build
```

Serve it with

```shell
pnpm serve
yarn serve
```

> [!IMPORTANT]
Expand Down
35 changes: 23 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
{
"scripts": {
"preinstall": "npx only-allow pnpm",
"serve": "pnpm --filter ./packages/demo-wallet run serve",
"dev": "pnpm --filter ./packages/demo-wallet run dev",
"build": "pnpm --filter ./packages/demo-wallet run build",
"test:e2e": "pnpm --filter ./packages/e2e-tests test"
"name": "root",
"private": true,
"license": "Apache-2.0",
"workspaces": [
"packages/*"
],
"engines": {
"node": ">=18.18.0"
},
"dependencies": {
"@webzjs/demo-wallet": "workspace:^",
"@webzjs/webz-wallet": "workspace:^",
"@webzjs/webz-keys": "workspace:^",
"@webzjs/webz-requests": "workspace:^"
"devDependencies": {
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3"
},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
"packageManager": "yarn@4.5.1",
"scripts": {
"serve": "yarn workspace @webzjs/demo-wallet run serve",
"dev": "yarn run just:build-keys && yarn run wasm:build && yarn run snap:start & yarn run demo-wallet:dev",
"build": "yarn workspace @webzjs/demo-wallet run build",
"demo-wallet:dev": "yarn workspace @webzjs/demo-wallet run dev",
"test:e2e": "yarn workspace @webzjs/e2e-tests test",
"snap:start": "yarn workspace @webzjs/zcash-snap run start",
"snap:build": "yarn workspace @webzjs/zcash-snap run build",
"wasm:build": "yarn workspace @webzjs/wasm run build",
"just:build-keys": "just build-keys"
}
}
1 change: 1 addition & 0 deletions packages/demo-wallet/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SNAP_ORIGIN=""
3 changes: 0 additions & 3 deletions packages/demo-wallet/dist/_headers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used by Netlify (and other web hosting platforms) to set the headers correctly. Please put it back 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willemolding I will take care of global eslint in the next PR with demo-wallet to configure it for all front-end projects

This file was deleted.

10 changes: 9 additions & 1 deletion packages/demo-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "@webzjs/demo-wallet",
"source": "index.html",
"version": "0.1.0",
"scripts": {
"dev": "vite",
"serve": "vite preview",
"build": "parcel build index.html"
},
"type": "module",
"dependencies": {
"@metamask/providers": "^18.1.0",
"@types/react": "^18.3.9",
"@types/react-dom": "^18.3.0",
"@webzjs/webz-wallet": "workspace:^",
"@webzjs/webz-keys": "workspace:^",
"@webzjs/webz-wallet": "workspace:^",
"bootstrap": "^5.3.3",
"idb-keyval": "^6.2.1",
"react": "^18.2.0",
Expand All @@ -22,6 +25,11 @@
"usehooks-ts": "^3.1.0"
},
"devDependencies": {
"@metamask/eslint-config": "^12.2.0",
"@metamask/eslint-config-browser": "^12.1.0",
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@parcel/core": "^2.12.0",
"@vitejs/plugin-react": "^4.3.2",
"parcel": "^2.12.0",
Expand Down
Loading
Loading