Skip to content

Commit

Permalink
Follow 1155 contracts way to publish with source code (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Jun 28, 2023
1 parent d1f8797 commit 9650357
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ cache
.pkey
.env.*
dist/
out/
.idea
broadcast/
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ solc_version = '0.8.17'
optimizer = true
optimizer_runs = 3000
via_ir = true
out = 'dist/artifacts'
out = 'out'
test = 'test'
src = 'src'
libs = ['lib']
Expand Down
7 changes: 1 addition & 6 deletions js-scripts/bundle-chainConfigs.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { readdirSync, readFileSync, writeFileSync } from 'fs';

// Reads all the chain configs in ./chainConfigs folder, and bundles them into a typescript
// definition that looks like:
// export const chainConfigs = {
// [chainId]: {
// ...chainConfig
// }
//}
// definition
function makeConfig() {
// read all files in the chainConfigs folder
const files = readdirSync('chainConfigs');
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@
"private": false,
"type": "module",
"files": [
"dist/chainConfigs/*",
"dist/addresses/*",
"dist/index*"
"dist/",
"src/",
"addresses/",
"chainConfigs/",
"package/"
],
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"scripts": {
"test": "forge test",
"generate-merkle-test-file": "node scripts/merkle-test.mjs",
"clean": "rm -rf ./dist/",
"prepack": "node js-scripts/copy-latest-deployment-addresses.mjs && yarn run wagmi && yarn build-ts && yarn copy-addresses-and-configs",
"prepack": "yarn clean && node js-scripts/copy-latest-deployment-addresses.mjs && yarn wagmi && yarn bundle-configs && yarn build-ts",
"deploy": "node scripts/deploy.mjs",
"coverage": "forge coverage --report lcov",
"build": "forge build",
"build-ts": "tsup package/index.ts --format cjs --dts --sourcemap",
"bundle-configs": "node js-scripts/bundle-chainConfigs.mjs && yarn format",
"prettier": "npx prettier \"js-scripts/**/*.mjs\" \"package/**/*.ts\" \"wagmi.config.ts\" --check",
"prettier:fix": "npm run prettier -- --write",
"copy-addresses-and-configs": "cp -r addresses/ dist/addresses && cp -r chainConfigs/ dist/chainConfigs",
"wagmi": "wagmi generate",
"storage-inspect:check": "./script/storage-check.sh check ERC721Drop ERC721DropProxy FactoryUpgradeGate ZoraNFTCreatorProxy ZoraNFTCreatorV1",
"storage-inspect:generate": "./script/storage-check.sh generate ERC721Drop ERC721DropProxy FactoryUpgradeGate ZoraNFTCreatorProxy ZoraNFTCreatorV1"
Expand Down
9 changes: 4 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"lib": ["es2021"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
Expand All @@ -18,11 +17,11 @@
"strict": true,
"strictNullChecks": true,
"target": "es2021",
"types": ["node"]
"types": ["node"],
"outDir": "dist"
},
"exclude": ["node_modules/**", "dist/**"],
"include": [
"package/**/*.ts",
"js-scripts/**/*.mjs"
]
"package/**/*.ts"
],
}
10 changes: 10 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['package/index.ts'],
sourcemap: true,
clean: true,
dts: false,
format: ['cjs'],
onSuccess: 'tsc --emitDeclarationOnly --declaration --declarationMap'
})

0 comments on commit 9650357

Please sign in to comment.