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

feat: add cdn package #2381

Merged
merged 9 commits into from
Jun 11, 2024
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
886 changes: 839 additions & 47 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build:clean": "turbo run build:clean",
"build": "turbo run build:clean; turbo run build",
"build": "turbo run build:clean; turbo run build --concurrency=30",
enesozturk marked this conversation as resolved.
Show resolved Hide resolved
"watch": "turbo run watch --concurrency=50 --continue",
"gallery": "turbo run dev:gallery",
"laboratory": "turbo run dev:laboratory",
Expand Down Expand Up @@ -47,6 +47,7 @@
"packages/ethers",
"packages/ethers5",
"packages/solana",
"packages/cdn",
"apps/*",
"examples/*"
],
Expand Down
1 change: 1 addition & 0 deletions packages/cdn/lib/ethers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as Web3modal from '@web3modal/ethers'
5 changes: 5 additions & 0 deletions packages/cdn/lib/wagmi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * as Web3modal from '@web3modal/wagmi'
export * as Viem from 'viem'
export * as Chains from 'viem/chains'
export * as Connectors from '@wagmi/connectors'
export * as WagmiCore from '@wagmi/core'
35 changes: 35 additions & 0 deletions packages/cdn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@web3modal/cdn",
"version": "4.2.3",
"main": "dist/wagmi.js",
"type": "module",
"files": [
"dist"
],
"scripts": {
"build:clean": "rm -rf dist",
"build:cdn": "tsc && vite build",
"watch": "npx tsc --watch",
"upload": "npm run build && npm publish --public"
},
"devDependencies": {
"typescript": "5.3.3",
"vite-plugin-node-polyfills": "0.22.0"
},
"peerDependencies": {
"typescript": ">=5"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"dependencies": {
"@wagmi/connectors": "5.0.8",
"@wagmi/core": "2.10.5",
"@web3modal/wagmi": "4.2.3",
"@web3modal/ethers": "4.2.3",
"viem": "2.10.3",
"vite": "5.2.11"
}
}
20 changes: 20 additions & 0 deletions packages/cdn/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ES2021",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"composite": true,
"baseUrl": "../../",
"declaration": true,
"noEmit": true,
"noImplicitAny": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"useUnknownInCatchVariables": true,
"alwaysStrict": true
},
"extends": "../../tsconfig.json",
"exclude": ["/dist", "dist/**/*.d.ts"]
}
24 changes: 24 additions & 0 deletions packages/cdn/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { resolve } from 'path'

import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'

// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: {
wagmi: resolve(__dirname, 'lib/wagmi.ts'),
ethers: resolve(__dirname, 'lib/ethers.ts')
}
}
},
plugins: [
nodePolyfills({
globals: {
Buffer: true,
process: true
}
})
]
})
2 changes: 1 addition & 1 deletion packages/ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"scripts": {
"build:clean": "rm -rf dist",
"build": "tsc --build",
"build:client": "tsc --build",
"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
Expand Down
2 changes: 1 addition & 1 deletion packages/ethers5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"scripts": {
"build:clean": "rm -rf dist",
"build": "tsc --build",
"build:client": "tsc --build",
"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
Expand Down
2 changes: 1 addition & 1 deletion packages/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"scripts": {
"build:clean": "rm -rf dist",
"build": "tsc --build",
"build:client": "tsc --build",
"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
Expand Down
2 changes: 1 addition & 1 deletion packages/wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"scripts": {
"build:clean": "rm -rf dist",
"build": "tsc --build",
"build:client": "tsc --build",
"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
Expand Down
21 changes: 15 additions & 6 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"dependsOn": ["^build:core", "^build:scaffold-utils"],
"cache": false
},
"build": {
"build:client": {
"outputs": ["dist/**"],
"dependsOn": [
"^build:common",
Expand All @@ -74,28 +74,37 @@
"cache": false
},
"watch": {
"dependsOn": ["^build"],
"dependsOn": ["^build:client"],
"cache": false,
"persistent": true
},
"build:cdn": {
"dependsOn": ["^build:client"],
"cache": false
},
"build": {
"dependsOn": ["build:cdn"],
"cache": false,
"persistent": true
},
"build:gallery": {
"outputs": ["out/**"],
"dependsOn": ["^build"],
"dependsOn": ["^build:client"],
"cache": false
},
"build:laboratory": {
"outputs": ["out/**", ".next/**", "!.next/cache/**"],
"dependsOn": ["^build"],
"dependsOn": ["^build:client"],
"cache": false
},
"build:examples": {
"outputs": ["dist/**"],
"dependsOn": ["^build"],
"dependsOn": ["^build:client"],
"cache": false
},
"build:demo": {
"outputs": ["out/**", ".next/**", "!.next/cache/**"],
"dependsOn": ["^build"],
"dependsOn": ["^build:client"],
"cache": false
},
"typecheck": {
Expand Down
Loading