-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Types Generation Process (#769)
* refactor: refactor: Simplify and correct the type generation process * chore: rerun yarn install * feat: automate version bumping and type release process * feat: Bring metadata back for type automation * chore: Try repo ci option * chore: passing ci flag on the workflow * feat: Add script to automate TS types generation * docs: update README with new process for generating TS types * fix: correct the link in README * refactor: improve generate-ts-types script for local execution * Merge `main` branch * chore: run update types * chore: update types * feat: add github release
- Loading branch information
Showing
36 changed files
with
2,775 additions
and
7,951 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
name: Publish Types | ||
|
||
# If changes are made to the types package.json, | ||
# If changes are made to the types/src/** files | ||
# Issue a new release to npm for the types package. | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "types/package.json" | ||
- 'types/src/**' | ||
|
||
jobs: | ||
build: | ||
|
@@ -21,17 +21,16 @@ jobs: | |
token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install npm dependencies | ||
run: cd types && yarn install | ||
- name: Configure Github Actions user | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Actions" | ||
- name: Run a build | ||
run: cd types && yarn build | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
- name: Publish the package | ||
run: cd types && yarn publish-types | ||
run: cd types && yarn publish-types --ci | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,19 @@ | ||
import type { Config } from 'release-it' | ||
|
||
export default { | ||
hooks: { | ||
'after:bump': 'yarn run build', | ||
}, | ||
git: { | ||
commitMessage: 'Release `tangle-substrate-types` v${version}', | ||
tagName: '${npm.name}/v${version}', | ||
tagAnnotation: 'Release ${npm.name} v${version}', | ||
}, | ||
github: { | ||
release: true, | ||
releaseName: 'Release ${npm.name} v${version}', | ||
}, | ||
npm: { | ||
publish: true, | ||
}, | ||
} satisfies Config |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,73 +2,56 @@ | |
"name": "@webb-tools/tangle-substrate-types", | ||
"version": "0.5.12", | ||
"description": "Polkadot.js type definitions required for interacting with Webb's tangle network", | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"typings": "./build/index.d.ts", | ||
"author": "Webb Developers <[email protected]>", | ||
"license": "Apache-2.0", | ||
"type": "commonjs", | ||
"repository": "https://github.com/webb-tools/tangle.git", | ||
"homepage": "https://github.com/webb-tools/tangle", | ||
"files": [ | ||
"build" | ||
], | ||
"main": "./build/index.cjs", | ||
"module": "./build/index.mjs", | ||
"types": "./build/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./build/index.d.ts", | ||
"require": "./build/index.cjs", | ||
"import": "./build/index.mjs", | ||
"module": "./build/index.mjs" | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"repository": "https://github.com/webb-tools/tangle.git", | ||
"bugs": { | ||
"url": "https://github.com/webb-tools/tangle/issues" | ||
}, | ||
"homepage": "https://github.com/webb-tools/tangle", | ||
"scripts": { | ||
"build": "bunchee", | ||
"build:interfaces": "yarn build:interfaces:defs && yarn build:interfaces:chain", | ||
"build:interfaces:defs": "tsx node_modules/.bin/polkadot-types-from-defs --input ./src/interfaces --package @webb-tools/tangle-substrate-types --endpoint ws://127.0.0.1:9944", | ||
"build:interfaces:chain": "tsx node_modules/.bin/polkadot-types-from-chain --output ./src/interfaces --package @webb-tools/tangle-substrate-types --endpoint ws://127.0.0.1:9944", | ||
"clean": "rm -rf build", | ||
"publish-types": "release-it patch", | ||
"update:metadata": "tsx ./scripts/updateMetadata.ts" | ||
}, | ||
"dependencies": { | ||
"@babel/cli": "^7.23.9", | ||
"@babel/core": "^7.24.0", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", | ||
"@babel/plugin-proposal-numeric-separator": "^7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "^7.20.7", | ||
"@babel/plugin-syntax-bigint": "^7.8.3", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.3", | ||
"@babel/plugin-syntax-import-assertions": "^7.23.3", | ||
"@babel/plugin-syntax-import-meta": "^7.10.4", | ||
"@babel/plugin-syntax-top-level-await": "^7.14.5", | ||
"@babel/plugin-transform-regenerator": "^7.23.3", | ||
"@babel/plugin-transform-runtime": "^7.24.0", | ||
"@babel/preset-env": "^7.24.0", | ||
"@babel/preset-react": "^7.23.3", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@babel/register": "^7.23.7", | ||
"@babel/runtime": "^7.24.0", | ||
"@open-web3/orml-types": "^2.0.1", | ||
"@polkadot/api": "^11.0.2", | ||
"@polkadot/dev": "^0.78.11", | ||
"@polkadot/typegen": "^11.0.2", | ||
"@polkadot/types": "^11.0.2", | ||
"babel-jest": "^29.7.0", | ||
"babel-plugin-module-extension-resolver": "^1.0.0", | ||
"babel-plugin-module-resolver": "^5.0.0", | ||
"babel-plugin-styled-components": "^2.1.4", | ||
"@polkadot/api": "^13.2.1", | ||
"@polkadot/typegen": "^13.2.1", | ||
"@polkadot/types": "^13.2.1", | ||
"ecpair": "^2.1.0", | ||
"elliptic": "^6.5.5", | ||
"fs-extra": "^11.2.0", | ||
"glob2base": "^0.0.12", | ||
"minimatch": "^9.0.3", | ||
"mkdirp": "^3.0.1", | ||
"tiny-secp256k1": "^2.2.3" | ||
}, | ||
"devDependencies": { | ||
"@types/websocket": "^1.0.10", | ||
"@types/node": "^22.6.1", | ||
"@types/ws": "^8.5.12", | ||
"bunchee": "^5.4.0", | ||
"prettier": "3.2.5", | ||
"rimraf": "5.0.5", | ||
"ts-node": "10.9.2", | ||
"tsconfig-paths": "^4.2.0", | ||
"release-it": "^17.6.0", | ||
"tsx": "^4.19.1", | ||
"typescript": "5.4.2", | ||
"websocket": "^1.0.34" | ||
}, | ||
"scripts": { | ||
"build": "node ./scripts/build.js", | ||
"build:interfaces": "yarn build:interfaces:defs && yarn build:interfaces:chain && rm ./src/interfaces/index.ts && rm ./src/interfaces/types.ts", | ||
"build:interfaces:defs": "npx ts-node node_modules/.bin/polkadot-types-from-defs --input ./src/interfaces --package @webb-tools/tangle-substrate-types --endpoint ./src/metadata/metadata.json", | ||
"build:interfaces:chain": "npx ts-node node_modules/.bin/polkadot-types-from-chain --endpoint ./src/metadata/metadata.json --output ./src/interfaces", | ||
"clean": "rm -rf build && rm -rf ts-types", | ||
"publish-types": "node ./scripts/publish-types.js", | ||
"update:metadata": "npx ts-node ./scripts/updateMetadata.ts" | ||
"ws": "^8.18.0" | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.