Skip to content

Commit

Permalink
fix: better treeshaking support by using packemon (#105)
Browse files Browse the repository at this point in the history
Co-authored-by: Wes Pickett <[email protected]>
  • Loading branch information
Zizzamia and wespickett authored Feb 9, 2024
1 parent 00a7b3e commit fc74af1
Show file tree
Hide file tree
Showing 14 changed files with 2,640 additions and 101 deletions.
9 changes: 9 additions & 0 deletions .changeset/serious-shrimps-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@coinbase/onchainkit': minor
---

- **feat**: better treeshaking support by using **packemon**. By @zizzamia & @wespickett #105

BREAKING CHANGES

For modern apps that utilize `ES2020` or the latest version, breaking changes are not anticipated. However, if you encounter any building issues when using OnchainKit with older apps that rely on `ES6`, please open an issue and provide details of the error you're experiencing. We will do our best to provide the necessary support.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# compiled output
dist
esm
lib
tmp
/out-tsc

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p align="center">
<a href="https://github.com/coinbase/onchainkit">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/logo-v-0-5.png">
<img alt="OnchainKit logo vibes" src="./docs/logo-v-0-5.png" width="auto">
<source media="(prefers-color-scheme: dark)" srcset="./docs/logo/v-0-6.png">
<img alt="OnchainKit logo vibes" src="./docs/logo/v-0-6.png" width="auto">
</picture>
</a>
</p>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added docs/logo/v-0-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 34 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "@coinbase/onchainkit",
"version": "0.5.4",
"version": "0.5.3",
"repository": "https://github.com/coinbase/onchainkit.git",
"license": "MIT",
"scripts": {
"build": "tsc && tsc --module commonjs --outDir dist/lib",
"build": "packemon build --addExports --addEngines --addFiles --declaration && npx packemon validate --no-license --no-people --no-repo",
"check": "yarn format",
"format": "prettier --log-level warn --write .",
"format:check": "prettier --check .",
"prebuild": "rimraf dist",
"test": "jest --testPathIgnorePatterns=\\.integ\\.",
"test:integration": "jest --testPathIgnorePatterns=\\.test\\.",
"test:all": "jest .",
Expand Down Expand Up @@ -36,6 +35,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-extended": "^4.0.2",
"packemon": "^3.3.0",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.5.9",
"react": "^18",
Expand All @@ -47,15 +47,41 @@
"vitepress": "^1.0.0-rc.42",
"yarn": "^1.22.21"
},
"packemon": [
{
"format": [
"esm",
"lib"
],
"platform": [
"browser"
],
"bundle": false
}
],
"publishConfig": {
"access": "public"
},
"files": [
"esm/**/*",
"lib/**/*",
"src/",
"dist/"
"src/**/*"
],
"type": "commonjs",
"main": "./dist/lib/index.js",
"typings": "./dist/types/index.d.ts",
"packageManager": "[email protected]"
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"module": "./esm/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./lib/index.d.ts",
"browser": {
"types": "./esm/index.d.ts",
"module": "./esm/index.js",
"import": "./esm/index.js",
"default": "./lib/index.js"
},
"default": "./lib/index.js"
}
}
}
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '0.5.4';
export const version = '0.6.0';
9 changes: 9 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "esm"
},
"include": [
"src"
]
}
9 changes: 9 additions & 0 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "lib"
},
"include": [
"src"
]
}
Loading

0 comments on commit fc74af1

Please sign in to comment.