Skip to content

Commit 7759408

Browse files
committed
feat: migrate from yarn to pnpm with makage + dist/ publishing
- Remove yarn.lock, add pnpm-workspace.yaml and pnpm-lock.yaml - Update root package.json: pnpm scripts, packageManager field, makage devDep - Update lerna.json: npmClient pnpm, remove npmClientArgs - Migrate all 79 packages to makage build + dist/ publishing pattern - Add workspace:* protocol for all internal dependencies - Add tsconfig.esm.json for each package (ESM builds) - Update per-package tsconfig.json to output to dist/ - Change root tsconfig: module commonjs, jsx react-jsx - Replace prepare with prepack lifecycle hook - Add missing dependencies for pnpm strict resolution - Pin @walletconnect/types and @chain-registry/types via overrides - Fix galaxy-station-extension signDirect arg count - Fix prax-extension rimraf -> rm -rf - Update CI workflow: pnpm/action-setup, pnpm install/build/test - Update .gitignore for pnpm - 5 packages use tolerant build (pre-existing type errors masked by || true)
1 parent 6cc4c16 commit 7759408

File tree

245 files changed

+30639
-19768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+30639
-19768
lines changed

.github/workflows/run-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ jobs:
2020
with:
2121
node-version: '22'
2222

23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: 9
27+
2328
- name: Deps
2429
run: |
25-
yarn
26-
yarn build
30+
pnpm install
31+
pnpm run build
2732
2833
- name: Test
2934
run: |
30-
npx --yes lerna@7 run test -- --passWithNoTests
35+
pnpm run test

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
.eslintcache
33
*.log
4+
pnpm-debug.log*
45
**/node_modules
56
coverage
67
packages/**/build
@@ -18,9 +19,7 @@ wallets/**/esm
1819
packages/example/pages/tmp.tsx
1920
packages/example/utils/tmp.ts
2021
.idea
21-
/.yarnrc
2222
/.npmrc
2323
/.parcel-cache
2424
packages/my-example
2525
wallets/social-login
26-
.yarn

lerna.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
2+
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
23
"lerna": "7",
34
"conventionalCommits": true,
4-
"npmClient": "yarn",
5-
"npmClientArgs": [
6-
"--no-lockfile"
7-
],
5+
"npmClient": "pnpm",
86
"packages": [
97
"packages/*",
108
"wallets/*",
@@ -23,4 +21,4 @@
2321
"message": "chore(release): publish"
2422
}
2523
}
26-
}
24+
}

package.json

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
{
2-
"name": "cosmos-kit",
2+
"name": "cosmos-kit-repo",
33
"version": "2.0.0",
4-
"publishConfig": {
5-
"access": "restricted"
6-
},
74
"private": true,
5+
"packageManager": "pnpm@9.15.9",
86
"scripts": {
9-
"commit": "git-cz",
10-
"build": "lerna run prepare --stream",
11-
"watch": "yarn watch",
12-
"lint": "lerna run lint",
13-
"format": "lerna run format",
14-
"pretest": "yarn lint",
15-
"test": "lerna run test",
16-
"clear:mjs": "lerna run clean:mjs --stream",
7+
"build": "pnpm -r run build",
8+
"lint": "pnpm -r run lint",
9+
"format": "pnpm -r run format",
10+
"test": "pnpm -r run test --passWithNoTests",
1711
"clear:modules": "find . -name 'node_modules' -type d -prune -print | xargs rm -rf",
18-
"clear:packages": "find -E ./packages -iregex '.*/packages/[-0-9a-z]*/(main|module|types|build|dist|cjs|esm)' -type d -prune -print | xargs rm -rf",
19-
"clear:wallets": "find -E ./wallets -iregex '.*/wallets/[-0-9a-z]*/(main|module|types|build|dist|cjs|esm)' -type d -prune -print | xargs rm -rf",
20-
"clear": "yarn clear:packages && yarn clear:wallets",
12+
"clear:dist": "pnpm -r run clean",
13+
"clear": "pnpm run clear:dist",
2114
"pub:beta": "lerna publish prerelease --preid beta --allow-branch beta",
2215
"pub": "lerna publish"
2316
},
@@ -36,14 +29,16 @@
3629
"lerna": "7.1.1",
3730
"prettier": "2.7.1",
3831
"publish-scripts": "0.1.0",
39-
"rimraf": "3.0.2",
32+
"makage": "^0.1.12",
4033
"ts-jest": "29.4.5",
4134
"typescript": "5.8.3"
4235
},
43-
"workspaces": [
44-
"packages/*",
45-
"wallets/*"
46-
],
36+
"pnpm": {
37+
"overrides": {
38+
"@walletconnect/types": "2.11.0",
39+
"@chain-registry/types": "0.46.11"
40+
}
41+
},
4742
"repository": {
4843
"type": "git",
4944
"url": "https://github.com/hyperweb-io/cosmos-kit#readme"

packages/core/package.json

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,23 @@
2222
],
2323
"homepage": "https://github.com/hyperweb-io/cosmos-kit#readme",
2424
"license": "SEE LICENSE IN LICENSE",
25-
"main": "cjs/index.js",
26-
"module": "esm/index.js",
27-
"types": "cjs/index.d.ts",
25+
"main": "dist/index.js",
26+
"module": "dist/esm/index.js",
27+
"types": "dist/index.d.ts",
2828
"directories": {
2929
"lib": "src",
3030
"test": "__tests__"
3131
},
3232
"files": [
33-
"cjs",
34-
"esm",
33+
"dist",
3534
"!CHANGELOG.md",
3635
"!LICENSE"
3736
],
3837
"scripts": {
39-
"build:cjs": "yarn tsc -p tsconfig.json --outDir cjs --module commonjs || true",
40-
"build:esm": "yarn tsc -p tsconfig.json --outDir esm --module es2022 || true",
41-
"clean:cjs": "rimraf cjs",
42-
"clean:esm": "rimraf esm",
43-
"clean": "npm run clean:cjs && npm run clean:esm",
44-
"build": "npm run clean && npm run build:cjs && npm run build:esm",
45-
"prepare": "npm run build",
38+
"clean": "makage clean",
39+
"prepack": "npm run build",
40+
"build": "makage build",
41+
"build:dev": "makage build --dev",
4642
"lint": "eslint --ext .tsx,.ts .",
4743
"format": "eslint --ext .tsx,.ts --fix .",
4844
"test": "jest",
@@ -51,7 +47,8 @@
5147
"test:coverage": "jest --coverage"
5248
},
5349
"publishConfig": {
54-
"access": "public"
50+
"access": "public",
51+
"directory": "dist"
5552
},
5653
"repository": {
5754
"type": "git",
@@ -69,7 +66,9 @@
6966
"url": "https://github.com/hyperweb-io/cosmos-kit/issues"
7067
},
7168
"devDependencies": {
72-
"chain-registry": "^1.64.13"
69+
"@types/react": "^19.2.14",
70+
"chain-registry": "^1.64.13",
71+
"makage": "^0.1.12"
7372
},
7473
"dependencies": {
7574
"@chain-registry/client": "^1.49.11",
@@ -81,11 +80,24 @@
8180
"@cosmjs/stargate": "^0.36.2",
8281
"@dao-dao/cosmiframe": "^1.0.0",
8382
"@walletconnect/types": "2.11.0",
83+
"axios": "^1.13.6",
8484
"bowser": "2.11.0",
8585
"cosmjs-types": "^0.10.1",
8686
"events": "3.3.0",
8787
"nock": "13.5.4",
88-
"uuid": "^9.0.1"
88+
"uuid": "^9.0.1",
89+
"react-icons": "^4.1.0"
8990
},
90-
"gitHead": "39fe5288455524191eb70ca82de6f2d7e6b3549a"
91+
"gitHead": "39fe5288455524191eb70ca82de6f2d7e6b3549a",
92+
"jest": {
93+
"testPathIgnorePatterns": [
94+
"dist/"
95+
],
96+
"modulePathIgnorePatterns": [
97+
"<rootDir>/dist/"
98+
]
99+
},
100+
"peerDependencies": {
101+
"react": "^18.0.0 || ^19.0.0"
102+
}
91103
}

packages/core/tsconfig.esm.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "ES2022",
5+
"outDir": "./dist/esm"
6+
}
7+
}

packages/core/tsconfig.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
5-
"rootDir": "src"
4+
"outDir": "dist",
5+
"rootDir": "src/"
66
},
7-
"include": ["src/**/*"],
8-
"exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
7+
"include": [
8+
"src/**/*.ts",
9+
"src/**/*.tsx"
10+
],
11+
"exclude": [
12+
"dist",
13+
"node_modules",
14+
"**/*.spec.*",
15+
"**/*.test.*"
16+
]
917
}

packages/cosmos-kit/package.json

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,32 @@
2525
],
2626
"homepage": "https://github.com/hyperweb-io/cosmos-kit#readme",
2727
"license": "SEE LICENSE IN LICENSE",
28-
"main": "cjs/index.js",
29-
"module": "esm/index.js",
30-
"types": "cjs/index.d.ts",
28+
"main": "dist/index.js",
29+
"module": "dist/esm/index.js",
30+
"types": "dist/index.d.ts",
3131
"directories": {
3232
"lib": "src",
3333
"test": "test"
3434
},
3535
"files": [
36-
"cjs",
37-
"esm",
36+
"dist",
3837
"!CHANGELOG.md",
3938
"!LICENSE"
4039
],
4140
"scripts": {
42-
"build:cjs": "yarn tsc -p tsconfig.json --outDir cjs --module commonjs || true",
43-
"build:esm": "yarn tsc -p tsconfig.json --outDir esm --module es2022 || true",
44-
"clean:cjs": "rimraf cjs",
45-
"clean:esm": "rimraf esm",
46-
"clean": "npm run clean:cjs && npm run clean:esm",
47-
"build": "npm run clean && npm run build:cjs && npm run build:esm",
48-
"prepare": "npm run build",
41+
"clean": "makage clean",
42+
"prepack": "npm run build",
43+
"build": "rm -rf dist && (tsc -p tsconfig.json || true) && (tsc -p tsconfig.esm.json || true) && cp ../../LICENSE dist/ && cp package.json dist/ && cp README.md dist/",
44+
"build:dev": "makage build --dev",
4945
"lint": "eslint --ext .tsx,.ts .",
5046
"format": "eslint --ext .tsx,.ts --fix .",
5147
"test": "jest",
5248
"test:watch": "jest --watch",
5349
"test:debug": "node --inspect node_modules/.bin/jest --runInBand"
5450
},
5551
"publishConfig": {
56-
"access": "public"
52+
"access": "public",
53+
"directory": "dist"
5754
},
5855
"repository": {
5956
"type": "git",
@@ -71,25 +68,36 @@
7168
"url": "https://github.com/hyperweb-io/cosmos-kit/issues"
7269
},
7370
"dependencies": {
74-
"@cosmos-kit/bitgetwallet-extension": "^1.4.1",
75-
"@cosmos-kit/cdcwallet": "^2.18.1",
76-
"@cosmos-kit/coin98": "^2.16.1",
77-
"@cosmos-kit/compass": "^2.16.1",
78-
"@cosmos-kit/cosmostation": "^2.17.1",
79-
"@cosmos-kit/ctrl": "^2.16.1",
80-
"@cosmos-kit/exodus": "^2.15.1",
81-
"@cosmos-kit/fin": "^2.16.1",
82-
"@cosmos-kit/galaxy-station": "^2.16.1",
83-
"@cosmos-kit/gatewallet-extension": "1.1.2",
84-
"@cosmos-kit/keplr": "^2.17.1",
85-
"@cosmos-kit/leap": "^2.17.1",
86-
"@cosmos-kit/ledger": "^2.16.1",
87-
"@cosmos-kit/okxwallet-extension": "^2.16.1",
88-
"@cosmos-kit/omni": "^2.15.1",
89-
"@cosmos-kit/owallet": "^2.17.1",
90-
"@cosmos-kit/shell": "^2.16.1",
91-
"@cosmos-kit/tailwind": "^1.10.1",
92-
"@cosmos-kit/trust": "^2.16.1"
71+
"@cosmos-kit/bitgetwallet-extension": "workspace:*",
72+
"@cosmos-kit/cdcwallet": "workspace:*",
73+
"@cosmos-kit/coin98": "workspace:*",
74+
"@cosmos-kit/compass": "workspace:*",
75+
"@cosmos-kit/cosmostation": "workspace:*",
76+
"@cosmos-kit/ctrl": "workspace:*",
77+
"@cosmos-kit/exodus": "workspace:*",
78+
"@cosmos-kit/fin": "workspace:*",
79+
"@cosmos-kit/galaxy-station": "workspace:*",
80+
"@cosmos-kit/gatewallet-extension": "workspace:*",
81+
"@cosmos-kit/keplr": "workspace:*",
82+
"@cosmos-kit/leap": "workspace:*",
83+
"@cosmos-kit/ledger": "workspace:*",
84+
"@cosmos-kit/okxwallet-extension": "workspace:*",
85+
"@cosmos-kit/omni": "workspace:*",
86+
"@cosmos-kit/owallet": "workspace:*",
87+
"@cosmos-kit/shell": "workspace:*",
88+
"@cosmos-kit/tailwind": "workspace:*",
89+
"@cosmos-kit/trust": "workspace:*"
9390
},
94-
"gitHead": "39fe5288455524191eb70ca82de6f2d7e6b3549a"
91+
"gitHead": "39fe5288455524191eb70ca82de6f2d7e6b3549a",
92+
"devDependencies": {
93+
"makage": "^0.1.12"
94+
},
95+
"jest": {
96+
"testPathIgnorePatterns": [
97+
"dist/"
98+
],
99+
"modulePathIgnorePatterns": [
100+
"<rootDir>/dist/"
101+
]
102+
}
95103
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "ES2022",
5+
"outDir": "./dist/esm"
6+
}
7+
}

packages/cosmos-kit/tsconfig.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
5-
"rootDir": "src"
4+
"outDir": "dist",
5+
"rootDir": "src/"
66
},
7-
"include": ["src/**/*"],
8-
"exclude": ["node_modules"]
9-
}
7+
"include": [
8+
"src/**/*.ts",
9+
"src/**/*.tsx"
10+
],
11+
"exclude": [
12+
"dist",
13+
"node_modules",
14+
"**/*.spec.*",
15+
"**/*.test.*"
16+
]
17+
}

0 commit comments

Comments
 (0)