Skip to content
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

Switch to vechain #133

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all 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: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
91 changes: 46 additions & 45 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,64 @@
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Runs on pushes targeting the default branch
push:
branches: [ 'main' ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
packages: write
contents: read
pages: write
id-token: write
packages: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
group: 'pages'
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node v16 & GitHub registry
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use Node v16 & GitHub registry
uses: actions/setup-node@v3
with:
node-version: 18

- name: Build React App
run: |
yarn install:all
yarn build
- name: Build React App
run: |
yarn install:all
yarn build:packages
yarn build:apps

- name: Setup Pages
uses: actions/configure-pages@v2
- name: Setup Pages
uses: actions/configure-pages@v2

- name: Copy Builds
run: |
mkdir build
cp -r apps/sample-vue-app/dist build/vue
cp -r apps/sample-react-app/build build/react
cp -r apps/sample-vanilla-app/dist build/vanilla
cp -r apps/sample-angular-app/dist/easy-angular build/angular
- name: Copy Builds
run: |
mkdir build
cp -r apps/sample-vue-app/dist build/vue
cp -r apps/sample-react-app/dist build/react
cp -r apps/sample-vanilla-app/dist build/vanilla
cp -r apps/sample-angular-app/dist/easy-angular build/angular

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload build
path: './build'
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload build
path: './build'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
**/build/**
.angular
.svelte-kit
dist
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,13 @@ yarn build

- Please refer to [Vechain Docs](https://docs.vechain.org/developer-resources/sdks-and-providers) for more information
on how to use the library.

---

## Publishing

```bash
yarn install:all
yarn build
yarn changeset publish
```
1 change: 1 addition & 0 deletions apps/e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "e2e",
"version": "1.0.0",
"private": true,
"license": "MIT",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions apps/sample-angular-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@popperjs/core": "^2.11.8",
"@vechainfoundation/dapp-kit": "*",
"@vechainfoundation/dapp-kit-ui": "*",
"@vechain/dapp-kit": "*",
"@vechain/dapp-kit-ui": "*",
"angular-svg-icon": "^16.0.0",
"axios": "^1.4.0",
"bootstrap": "^5.3.0",
Expand Down
7 changes: 2 additions & 5 deletions apps/sample-angular-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { DAppKitUI } from '@vechainfoundation/dapp-kit-ui';
import { DAppKitUI } from '@vechain/dapp-kit-ui';
import { bootstrapApplication } from '@angular/platform-browser';
import type {
DAppKitOptions,
WalletConnectOptions,
} from '@vechainfoundation/dapp-kit';
import type { DAppKitOptions, WalletConnectOptions } from '@vechain/dapp-kit';
import { AppComponent } from './app/app.component';

bootstrapApplication(AppComponent, {
Expand Down
7 changes: 4 additions & 3 deletions apps/sample-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"clean": "rm -rf .next dist .turbo",
"dev": "next dev",
"purge": "yarn clean; rm -rf node_modules",
"start": "next start"
},
"dependencies": {
"@vechainfoundation/dapp-kit": "*",
"@vechainfoundation/dapp-kit-react": "*",
"@vechainfoundation/dapp-kit-ui": "*",
"@vechain/dapp-kit": "*",
"@vechain/dapp-kit-react": "*",
"@vechain/dapp-kit-ui": "*",
"next": "14.0.3",
"react": "^18",
"react-dom": "^18"
Expand Down
4 changes: 2 additions & 2 deletions apps/sample-next-app/src/app/pages/homepage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
ConnectWalletButtonWithModal,
DAppKitProvider,
} from '@vechainfoundation/dapp-kit-react';
import type { WalletConnectOptions } from '@vechainfoundation/dapp-kit';
} from '@vechain/dapp-kit-react';
import type { WalletConnectOptions } from '@vechain/dapp-kit';

const walletConnectOptions: WalletConnectOptions = {
projectId: 'a0b855ceaf109dbc8426479a4c3d38d8',
Expand Down
6 changes: 3 additions & 3 deletions apps/sample-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"purge": "yarn clean; rm -rf node_modules"
},
"dependencies": {
"@vechainfoundation/dapp-kit": "*",
"@vechainfoundation/dapp-kit-react": "*",
"@vechainfoundation/dapp-kit-ui": "*",
"@vechain/dapp-kit": "*",
"@vechain/dapp-kit-react": "*",
"@vechain/dapp-kit-ui": "*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite-plugin-node-polyfills": "^0.17.0"
Expand Down
2 changes: 1 addition & 1 deletion apps/sample-react-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import reactLogo from './assets/react.svg';
import viteLogo from '/vite.svg';
import './App.css';
import { ConnectWalletButtonWithModal } from '@vechainfoundation/dapp-kit-react';
import { ConnectWalletButtonWithModal } from '@vechain/dapp-kit-react';

function App() {
return (
Expand Down
6 changes: 3 additions & 3 deletions apps/sample-react-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './index.css';
import type { WalletConnectOptions } from '@vechainfoundation/dapp-kit';
import '@vechainfoundation/dapp-kit-ui';
import { DAppKitProvider } from '@vechainfoundation/dapp-kit-react';
import type { WalletConnectOptions } from '@vechain/dapp-kit';
import '@vechain/dapp-kit-ui';
import { DAppKitProvider } from '@vechain/dapp-kit-react';

const walletConnectOptions: WalletConnectOptions = {
projectId: 'a0b855ceaf109dbc8426479a4c3d38d8',
Expand Down
4 changes: 4 additions & 0 deletions apps/sample-react-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';

export default defineConfig({
plugins: [nodePolyfills(), react()],
base:
process.env.NODE_ENV === 'production'
? '/vechain-dapp-kit/react/'
: '/',
});
2 changes: 1 addition & 1 deletion apps/sample-svelte-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"purge": "yarn clean; rm -rf node_modules"
},
"dependencies": {
"@vechainfoundation/dapp-kit-ui": "*"
"@vechain/dapp-kit-ui": "*"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
Expand Down
7 changes: 2 additions & 5 deletions apps/sample-svelte-app/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { DAppKitUI } from '@vechainfoundation/dapp-kit-ui';
import type {
DAppKitOptions,
WalletConnectOptions,
} from '@vechainfoundation/dapp-kit';
import { DAppKitUI } from '@vechain/dapp-kit-ui';
import type { DAppKitOptions, WalletConnectOptions } from '@vechain/dapp-kit';

const walletConnectOptions: WalletConnectOptions = {
projectId: 'a0b855ceaf109dbc8426479a4c3d38d8',
Expand Down
2 changes: 1 addition & 1 deletion apps/sample-vanilla-app/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable no-undef */
import { DAppKitUI } from '@vechainfoundation/dapp-kit-ui';
import { DAppKitUI } from '@vechain/dapp-kit-ui';

const walletConnectOptions = {
projectId: 'a0b855ceaf109dbc8426479a4c3d38d8',
Expand Down
3 changes: 2 additions & 1 deletion apps/sample-vanilla-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "sample-vanilla-app",
"version": "1.0.0",
"private": true,
"description": "",
"license": "ISC",
"author": "",
Expand All @@ -13,7 +14,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@vechainfoundation/dapp-kit-ui": "*"
"@vechain/dapp-kit-ui": "*"
},
"devDependencies": {
"parcel": "^2.10.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/sample-vue-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"root": true
},
"dependencies": {
"@vechainfoundation/dapp-kit": "*",
"@vechainfoundation/dapp-kit-ui": "*",
"@vechain/dapp-kit": "*",
"@vechain/dapp-kit-ui": "*",
"core-js": "^3.8.3",
"node-polyfill-webpack-plugin": "^2.0.1",
"vue": "^3.2.13",
Expand Down
4 changes: 2 additions & 2 deletions apps/sample-vue-app/src/dapp-kit/DAppKitProvider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
ConnectResponse,
WalletConnectOptions,
WalletSource,
} from '@vechainfoundation/dapp-kit';
} from '@vechain/dapp-kit';
import type Connex from '@vechain/connex';
import {
ConnexSymbol,
WalletActionsSymbol,
WalletStateSymbol,
} from '@/dapp-kit/keys';
import { WalletActions, WalletState } from '@/dapp-kit/types';
import { DAppKitUI } from '@vechainfoundation/dapp-kit-ui';
import { DAppKitUI } from '@vechain/dapp-kit-ui';

const initWallets = (hasWcOptions: boolean) => {
const wallets: WalletSource[] = ['sync2'];
Expand Down
2 changes: 1 addition & 1 deletion apps/sample-vue-app/src/dapp-kit/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConnectResponse, WalletSource } from '@vechainfoundation/dapp-kit';
import { ConnectResponse, WalletSource } from '@vechain/dapp-kit';

type WalletState = {
availableWallets: WalletSource[];
Expand Down
2 changes: 1 addition & 1 deletion apps/sample-vue-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApp } from 'vue';
import App from './App.vue';
import '@vechainfoundation/dapp-kit-ui';
import '@vechain/dapp-kit-ui';

createApp(App).mount('#app');
Loading