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

Fix web components #187

Closed
wants to merge 5 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
with:
node-version: '18'
- name: Install dependencies
run: yarn install
run: pnpm install
working-directory: packages/widget-v2
- name: Run ESLint
run: yarn lint
run: pnpm lint
working-directory: packages/widget-v2
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
node-version: 18.x

- name: Install Dependencies
run: yarn
run: pnpm

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
run: git submodule update --init --recursive

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

- name: Generate cosmjs types
run: yarn run codegen
run: pnpm run codegen
working-directory: ./packages/client

- name: Test
run: yarn run test
run: pnpm run test
working-directory: ./packages/client
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node-linker=hoisted
shamefully-hoist=true
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"tabWidth": 2,
"semi": true
}
16 changes: 14 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.tabSize": 2,
"eslint.workingDirectories": [{ "mode": "auto" }],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.format.enable": true
"eslint.format.enable": true,
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "next lint"
},
"dependencies": {
"@skip-go/widget": "workspace:packages/widget",
"@skip-go/widget": "workspace:*",
"@tanstack/react-query": "^5.17.15",
"next": "14.0.4",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NextPage } from 'next';
import React, { useState } from 'react';
import { SwapWidget } from '@skip-go/widget';
import crypto from 'crypto';
import { PartialTheme } from '@skip-go/widget/build/ui/theme';
import { PartialTheme } from '@skip-go/widget/build/types/ui/theme';

function hashString(inputString: string) {
const hash = crypto.createHash('sha256');
Expand Down
24 changes: 24 additions & 0 deletions examples/nuxtjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
75 changes: 75 additions & 0 deletions examples/nuxtjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
14 changes: 14 additions & 0 deletions examples/nuxtjs/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script setup lang="ts">
import { initializeSwapWidget } from '@skip-go/widget/web-component';

initializeSwapWidget();
</script>
<template>
<div>
<div style="width: 450px; height: 820px">
<client-only>
<skip-widget />
</client-only>
</div>
</div>
</template>
16 changes: 16 additions & 0 deletions examples/nuxtjs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
vite: {
optimizeDeps: {
noDiscovery: true,
include: [],
exclude: ['cssesc']
},
plugins: [
nodePolyfills()
]
},
})
18 changes: 18 additions & 0 deletions examples/nuxtjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "NODE_OPTIONS=--max-old-space-size=32384 nuxt build",
"dev": "NODE_OPTIONS=--max-old-space-size=32384 nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@skip-go/widget": "workspace:*",
"nuxt": "^3.13.0",
"vite-plugin-node-polyfills": "^0.22.0",
"vue": "latest"
}
}
Binary file added examples/nuxtjs/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions examples/nuxtjs/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/nuxtjs/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
4 changes: 4 additions & 0 deletions examples/nuxtjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
60 changes: 31 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,32 @@
"version": "0.0.0",
"description": "Skip Go",
"private": true,
"workspaces": [
"packages/client",
"packages/widget",
"packages/widget-v2",
"examples/*",
"vendor/"
],
"pnpm": {
"packages": [
"packages/*",
"examples/*",
"vendor/"
]
},
"scripts": {
"dev": "yarn run dev:widget & yarn run dev:nextjs & yarn run dev:client",
"dev:https": "yarn run dev:widget & yarn run dev:nextjs-https & yarn run dev:client",
"dev:widget": "yarn workspace @skip-go/widget run dev",
"dev:widgetv2": "yarn workspace widget-v2 run dev",
"dev:nextjs": "yarn workspace nextjs run dev",
"dev:nextjs-https": "yarn workspace nextjs run dev:https",
"dev:client": "yarn workspace @skip-go/client run watch",
"build": "yarn run build:client && yarn run build:widget && yarn run build:nextjs",
"build:widget": "yarn workspace @skip-go/widget run build",
"build:nextjs": "yarn workspace nextjs build",
"build:client": "yarn workspace @skip-go/client build",
"codegen": "yarn workspace @skip-go/client codegen",
"test": "yarn workspace @skip-go/client run test",
"submodule": "yarn run submodule:init && yarn run submodule:update",
"dev": "pnpm -r --parallel run dev",
"dev:https": "pnpm run dev:widget & pnpm run dev:nextjs-https & pnpm run dev:client",
"dev:widget": "pnpm --filter @skip-go/widget run dev",
"dev:widgetv2": "pnpm --filter @skip-go/widget-v2 run dev",
"dev:nextjs": "pnpm --filter @skip-go/nextjs run dev",
"dev:nextjs-https": "pnpm --filter @skip-go/nextjs run dev:https",
"dev:client": "pnpm --filter @skip-go/client run watch",
"build": "pnpm -r run build",
"build:widget": "pnpm --filter @skip-go/widget run build",
"build:nextjs": "pnpm --filter @skip-go/nextjs build",
"build:web-component": "pnpm --filter @skip-go/web-component run build",
"build:client": "pnpm --filter @skip-go/client build",
"codegen": "pnpm --filter @skip-go/client run codegen",
"test": "pnpm -r run test",
"submodule": "pnpm run submodule:init && pnpm run submodule:update",
"submodule:init": "git submodule init",
"submodule:update": "git submodule update",
"release": "yarn run build && yarn workspace @skip-go/widget run pre && changeset publish",
"release": "pnpm run build && pnpm --filter @skip-go/widget run pre && changeset publish",
"swagger": "npx open-swagger-ui --open docs/swagger.yml"
},
"devDependencies": {
Expand Down Expand Up @@ -55,15 +56,16 @@
"@keplr-wallet/unit": "^0.12.67",
"@protobufs/gogoproto": "0.0.10",
"@protobufs/google": "0.0.10",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/web3.js": "^1.91.1",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/parser": "^5.62.0",
"axios": "1.x",
"cosmjs-types": "0.8.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
Expand All @@ -76,14 +78,14 @@
"msw": "^1.2.3",
"p-map": "^7.0.2",
"postcss-prefixwrap": "^1.49.0",
"prettier": "^3.1.0",
"prettier-eslint": "^16.1.2",
"proxy-from-env": "^1.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"rollup": "^2.67.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "0.36.0",
"rollup-plugin-visualizer": "^5.5.4",
"ts-jest": "^29.1.2",
Expand All @@ -96,8 +98,8 @@
"vitest": "^1.2.2",
"wagmi": "^2.5.7"
},
"packageManager": "yarn@3.2.0",
"dependencies": {
"@changesets/cli": "^2.24.4"
}
"@injectivelabs/utils": "1.14.6"
},
"packageManager": "pnpm@9.7.1"
}
Loading
Loading