-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from osmosis-labs/codegen
Adds basic `ts-codegen` support for the frontend
- Loading branch information
Showing
7 changed files
with
3,455 additions
and
3 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,24 +1,41 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
|
||
|
||
# Compiled files and executables | ||
/target/ | ||
artifacts/ | ||
internal/ | ||
|
||
|
||
# Code coverage | ||
codecov.json | ||
|
||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
.idea | ||
|
||
|
||
# These files should not be commited | ||
*.log | ||
|
||
schema/ | ||
schemas/ | ||
|
||
.DS_Store | ||
.vscode | ||
.idea | ||
|
||
|
||
# node.js | ||
dist | ||
mjs | ||
main | ||
module | ||
node_modules | ||
|
||
|
||
# Codegen builds in src | ||
src | ||
|
||
|
||
# Optional npm cache directory | ||
.npm |
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,56 @@ | ||
const codegen = require('@cosmwasm/ts-codegen').default; | ||
|
||
codegen({ | ||
contracts: [ | ||
{ | ||
name: 'Vault', | ||
dir: './contracts/provider/vault/schema' | ||
}, | ||
{ | ||
name: 'ExternalStaking', | ||
dir: './contracts/provider/external-staking/schema' | ||
}, | ||
{ | ||
name: 'NativeStaking', | ||
dir: './contracts/provider/native-staking/schema' | ||
}, | ||
{ | ||
name: 'NativeStakingProxy', | ||
dir: './contracts/provider/native-staking-proxy/schema' | ||
}, | ||
{ | ||
name: 'Converter', | ||
dir: './contracts/consumer/converter/schema' | ||
}, | ||
{ | ||
name: 'RemotePriceFeed', | ||
dir: './contracts/consumer/remote-price-feed/schema' | ||
}, | ||
{ | ||
name: 'SimplePriceFeed', | ||
dir: './contracts/consumer/simple-price-feed/schema' | ||
}, | ||
{ | ||
name: 'VirtualStaking', | ||
dir: './contracts/consumer/virtual-staking/schema' | ||
}, | ||
], | ||
outPath: './src/', | ||
options: { | ||
bundle: { | ||
bundleFile: 'index.ts', | ||
scope: 'contracts' | ||
}, | ||
messageComposer: { | ||
enabled: true | ||
}, | ||
useContractsHooks: { | ||
enabled: false // if you enable this, add react! | ||
}, | ||
client: { | ||
enabled: true | ||
}, | ||
} | ||
}).then(() => { | ||
console.log('✨ all done!'); | ||
}); |
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,45 @@ | ||
{ | ||
"name": "@mesh-security/types", | ||
"version": "0.4.2", | ||
"description": "", | ||
"author": "Jake Hartnell <[email protected]>", | ||
"homepage": "https://github.com/osmosis-labs/mesh-security", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"typings": "dist/index.d.ts", | ||
"directories": { | ||
"lib": "src" | ||
}, | ||
"files": [ | ||
"dist", | ||
"!CHANGELOG.md" | ||
], | ||
"scripts": { | ||
"build:cjs": "yarn tsc -p tsconfig.json --outDir dist --module commonjs || true", | ||
"build:mjs": "yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true", | ||
"build:rename": "publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs", | ||
"build": "npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename && rimraf mjs", | ||
"clean:mjs": "rimraf mjs", | ||
"clean:dist": "rimraf dist", | ||
"clean": "npm run build:clean && npm run clean:mjs && npm run clean:dist", | ||
"codegen": "node codegen/codegen.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/osmosis-labs/mesh-security" | ||
}, | ||
"keywords": [], | ||
"bugs": { | ||
"url": "https://github.com/osmosis-labs/mesh-security/issues" | ||
}, | ||
"devDependencies": { | ||
"@cosmwasm/ts-codegen": "^0.33.0", | ||
"publish-scripts": "1.9.0", | ||
"rimraf": "^5.0.0", | ||
"typescript": "^5.0.4" | ||
}, | ||
"dependencies": { | ||
"@cosmjs/cosmwasm-stargate": "^0.32.1" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"rootDir": "src", | ||
"skipLibCheck": true, | ||
"emitDeclarationOnly": false, | ||
"declaration": true, | ||
"esModuleInterop": true, | ||
"target": "es2022", | ||
"module": "es2022", | ||
"lib": [ | ||
"es2022", | ||
"DOM" | ||
], | ||
"sourceMap": true, | ||
"isolatedModules": true, | ||
"allowJs": true, | ||
"downlevelIteration": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"jsx": "react" | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
Oops, something went wrong.