-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mdt/ethers-v6
- Loading branch information
Showing
10 changed files
with
466 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.esm.js", | ||
|
@@ -10,15 +10,14 @@ | |
"src" | ||
], | ||
"engines": { | ||
"node": ">=16" | ||
"node": ">=18" | ||
}, | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build && ./patch.sh", | ||
"start": "rollup -c --watch", | ||
"build": "rollup -c", | ||
"build:demo": "node ./example/build.js", | ||
"test": "tsdx test", | ||
"lint": "tsdx lint src test", | ||
"prepare": "tsdx build && ./patch.sh", | ||
"lint": "tsdx lint", | ||
"size": "size-limit" | ||
}, | ||
"husky": { | ||
|
@@ -39,8 +38,8 @@ | |
"author": "Muhammed Tanrıkulu <[email protected]>", | ||
"size-limit": [ | ||
{ | ||
"path": "dist/ens-avatar.cjs.production.min.js", | ||
"limit": "250 KB", | ||
"path": "dist/index.js", | ||
"limit": "200 KB", | ||
"ignore": [ | ||
"jsdom" | ||
] | ||
|
@@ -54,17 +53,17 @@ | |
} | ||
], | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "^7.0.5", | ||
"@types/dompurify": "^2.3.3", | ||
"@types/jsdom": "^16.2.14", | ||
"@rollup/plugin-typescript": "^11.1.5", | ||
"@size-limit/preset-small-lib": "^11.0.1", | ||
"@types/dompurify": "^3.0.5", | ||
"@types/jsdom": "^21.1.6", | ||
"@types/url-join": "^4.0.1", | ||
"dotenv": "^16.0.0", | ||
"dotenv": "^16.3.1", | ||
"esbuild": "^0.14.21", | ||
"husky": "^7.0.4", | ||
"nock": "^13.4.0", | ||
"size-limit": "^7.0.5", | ||
"nock": "^13.2.2", | ||
"rollup": "^4.9.1", | ||
"size-limit": "^11.0.1", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.5.5" | ||
}, | ||
"dependencies": { | ||
|
@@ -81,6 +80,6 @@ | |
"url-join": "^4.0.1" | ||
}, | ||
"volta": { | ||
"node": "16.14.0" | ||
"node": "18.14.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import tsPlugin from '@rollup/plugin-typescript'; | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
format: 'cjs', | ||
file: './dist/index.js', | ||
}, | ||
{ | ||
format: 'es', | ||
dir: 'dist', | ||
preserveModules: true, | ||
preserveModulesRoot: 'src', | ||
entryFileNames: chunk => { | ||
return `${chunk.name === 'index' ? 'index.esm' : chunk.name}.js`; | ||
}, | ||
}, | ||
], | ||
plugins: [ | ||
tsPlugin({ | ||
declarationDir: './dist', | ||
sourceMap: false, | ||
}), | ||
removeDist(), | ||
], | ||
}; | ||
|
||
function removeDist(options = {}) { | ||
const { hook = 'buildStart', buildDir = 'dist' } = options; | ||
|
||
return { | ||
name: 'remove-dist', | ||
[hook]: async () => { | ||
const folderPath = path.join(process.cwd(), buildDir); | ||
try { | ||
fs.accessSync(folderPath, fs.F_OK); | ||
fs.rmSync(folderPath, { recursive: true, force: true }); | ||
} catch (err) { | ||
if (err.code !== 'ENOENT') throw err; | ||
try { | ||
fs.rmSync(folderPath, { recursive: true, force: true }); | ||
} catch (innerErr) { | ||
console.log('An error occurred while removing the folder:', innerErr); | ||
} | ||
} | ||
}, | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.