From 9abdc3fc0b787d9976d6929d42f3f8915a395c65 Mon Sep 17 00:00:00 2001 From: Fuyao Zhao Date: Sun, 1 Jan 2023 17:58:54 -0800 Subject: [PATCH] fix(all, cli): fix pacakge references in local dev, cli should in dev deps --- examples/aptos/package.json | 2 +- examples/aurory/package.json | 3 +-- examples/sui/package.json | 2 +- examples/wormhole/package.json | 2 +- examples/x2y2-complex/package.json | 2 +- examples/x2y2/package.json | 2 +- packages/cli/package.json | 2 +- packages/cli/src/commands/run-create.ts | 8 ++------ packages/cli/templates/aptos/package.json | 4 ++-- packages/cli/templates/evm/package.json | 2 +- packages/cli/templates/raw/package.json | 2 +- packages/cli/templates/solana/package.json | 4 ++-- packages/protos/package.json | 2 +- packages/runtime/package.json | 2 +- packages/sdk-all/package.json | 10 +++++----- packages/sdk-aptos/package.json | 4 ++-- packages/sdk-solana/package.json | 4 ++-- packages/sdk/package.json | 6 +++--- yarn.lock | 18 ++++++++++++++++++ 19 files changed, 47 insertions(+), 34 deletions(-) diff --git a/examples/aptos/package.json b/examples/aptos/package.json index f470d77276..45ce423b4f 100644 --- a/examples/aptos/package.json +++ b/examples/aptos/package.json @@ -15,6 +15,6 @@ "@sentio/sdk-aptos": "^1.0.0-development" }, "devDependencies": { - "@sentio/cli": "^1.0.0" + "@sentio/cli": "^1.0.0-development" } } diff --git a/examples/aurory/package.json b/examples/aurory/package.json index a987620b80..fc6c24d7c1 100644 --- a/examples/aurory/package.json +++ b/examples/aurory/package.json @@ -13,7 +13,6 @@ "@sentio/sdk": "^1.0.0-development" }, "devDependencies": { - "@sentio/cli": "^1.0.0", - "@types/bs58": "^4.0.1" + "@sentio/cli": "^1.0.0-development" } } diff --git a/examples/sui/package.json b/examples/sui/package.json index e6d70ecb1a..7c699cf5e0 100644 --- a/examples/sui/package.json +++ b/examples/sui/package.json @@ -13,6 +13,6 @@ "@sentio/sdk": "^1.0.0-development" }, "devDependencies": { - "@sentio/cli": "^1.0.0" + "@sentio/cli": "^1.0.0-development" } } diff --git a/examples/wormhole/package.json b/examples/wormhole/package.json index a01394d27c..f7439c3d2f 100644 --- a/examples/wormhole/package.json +++ b/examples/wormhole/package.json @@ -14,6 +14,6 @@ "@sentio/sdk-solana": "^1.0.0-development" }, "devDependencies": { - "@sentio/cli": "^1.0.0" + "@sentio/cli": "^1.0.0-development" } } diff --git a/examples/x2y2-complex/package.json b/examples/x2y2-complex/package.json index 5bcca935c7..1c3ea8c732 100644 --- a/examples/x2y2-complex/package.json +++ b/examples/x2y2-complex/package.json @@ -15,7 +15,7 @@ "@sentio/sdk": "^1.0.0-development" }, "devDependencies": { - "@sentio/cli": "^1.0.0", + "@sentio/cli": "^1.0.0-development", "ts-node": "^10.8.0" } } diff --git a/examples/x2y2/package.json b/examples/x2y2/package.json index c5e1516e30..c58c837d77 100644 --- a/examples/x2y2/package.json +++ b/examples/x2y2/package.json @@ -15,7 +15,7 @@ "@sentio/sdk": "^1.0.0-development" }, "devDependencies": { - "@sentio/cli": "^1.0.0", + "@sentio/cli": "^1.0.0-development", "ts-node": "^10.8.0" } } diff --git a/packages/cli/package.json b/packages/cli/package.json index 239bef3767..5fb7d3ff34 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -2,7 +2,7 @@ "name": "@sentio/cli", "license": "Apache-2.0", "private": false, - "version": "1.0.7", + "version": "1.0.0-development", "scripts": { "compile": "tsc -p . && cp src/webpack.config.js lib/", "build": "yarn compile", diff --git a/packages/cli/src/commands/run-create.ts b/packages/cli/src/commands/run-create.ts index 0159afee99..8add797255 100644 --- a/packages/cli/src/commands/run-create.ts +++ b/packages/cli/src/commands/run-create.ts @@ -100,11 +100,6 @@ export async function runCreate(argv: string[]) { const packageJsonPath = path.resolve(dstFolder, 'package.json') const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) - let cliVersion = getCliVersion() - if (!cliVersion.startsWith('^')) { - cliVersion = '^' + cliVersion - } - const sdkVersion = '^' + (await latestVersion('@sentio/sdk')) packageJson.dependencies['@sentio/sdk'] = sdkVersion @@ -118,7 +113,8 @@ export async function runCreate(argv: string[]) { default: } - packageJson.dependencies['@sentio/cli'] = cliVersion + const cliVersion = '^' + (await latestVersion('@sentio/cli')) + packageJson.devDependencies['@sentio/cli'] = cliVersion packageJson.name = projectName // Don't add directly to avoid deps issue diff --git a/packages/cli/templates/aptos/package.json b/packages/cli/templates/aptos/package.json index 5c4df62b9d..6190d69743 100644 --- a/packages/cli/templates/aptos/package.json +++ b/packages/cli/templates/aptos/package.json @@ -9,8 +9,8 @@ "upload": "sentio upload" }, "dependencies": { - "@sentio/sdk": "^1.0.0", - "@sentio/sdk-aptos": "^1.0.0" + "@sentio/sdk": "^1.0.0-development", + "@sentio/sdk-aptos": "^1.0.0-development" }, "devDependencies": { "@types/jest": "^29.0.0", diff --git a/packages/cli/templates/evm/package.json b/packages/cli/templates/evm/package.json index c8ae2ed017..750b115237 100644 --- a/packages/cli/templates/evm/package.json +++ b/packages/cli/templates/evm/package.json @@ -9,7 +9,7 @@ "upload": "sentio upload" }, "dependencies": { - "@sentio/sdk": "^1.0.0" + "@sentio/sdk": "^1.0.0-development" }, "devDependencies": { "@types/jest": "^29.0.0", diff --git a/packages/cli/templates/raw/package.json b/packages/cli/templates/raw/package.json index c355b65538..0cb1a89c20 100644 --- a/packages/cli/templates/raw/package.json +++ b/packages/cli/templates/raw/package.json @@ -9,7 +9,7 @@ "upload": "sentio upload" }, "dependencies": { - "@sentio/sdk": "^1.0.0" + "@sentio/sdk": "^1.0.0-development" }, "devDependencies": { "@types/jest": "^29.0.0", diff --git a/packages/cli/templates/solana/package.json b/packages/cli/templates/solana/package.json index 4651d4aaf8..a4686be32a 100644 --- a/packages/cli/templates/solana/package.json +++ b/packages/cli/templates/solana/package.json @@ -9,8 +9,8 @@ "upload": "sentio upload" }, "dependencies": { - "@sentio/sdk": "^1.0.0", - "@sentio/sdk-solana": "^1.0.0" + "@sentio/sdk": "^1.0.0-development", + "@sentio/sdk-solana": "^1.0.0-development" }, "devDependencies": { "@types/jest": "^29.0.0", diff --git a/packages/protos/package.json b/packages/protos/package.json index c3bd8d247d..5b8ed010aa 100644 --- a/packages/protos/package.json +++ b/packages/protos/package.json @@ -1,7 +1,7 @@ { "name": "@sentio/protos", "license": "Apache-2.0", - "version": "1.0.0", + "version": "1.0.0-development", "scripts": { "compile": "tsc -p .", "clean": "tsc --build --clean", diff --git a/packages/runtime/package.json b/packages/runtime/package.json index fc8a47376d..42e968e8dc 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -9,7 +9,7 @@ "test": "jest" }, "dependencies": { - "@sentio/protos": "^1.0.0", + "@sentio/protos": "^1.0.0-development", "@ethersproject/providers": "~5.7.0", "bignumber.js": "^9.1.0", "command-line-args": "^5.2.1", diff --git a/packages/sdk-all/package.json b/packages/sdk-all/package.json index 1b0aed2346..3c5fdc6720 100644 --- a/packages/sdk-all/package.json +++ b/packages/sdk-all/package.json @@ -1,7 +1,7 @@ { "name": "@sentio/sdk-all", "license": "Apache-2.0", - "version": "1.0.0", + "version": "1.0.0-development", "scripts": { "compile": "tsc -p .", "build": "yarn compile", @@ -9,10 +9,10 @@ "test": "jest" }, "dependencies": { - "@sentio/sdk": "^1.0.0", - "@sentio/runtime": "^1.0.0", - "@sentio/sdk-aptos": "^1.0.0", - "@sentio/sdk-solana": "^1.0.0" + "@sentio/sdk": "^1.0.0-development", + "@sentio/runtime": "^1.0.0-development", + "@sentio/sdk-aptos": "^1.0.0-development", + "@sentio/sdk-solana": "^1.0.0-development" }, "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/packages/sdk-aptos/package.json b/packages/sdk-aptos/package.json index 466af82c50..cc3b08f023 100644 --- a/packages/sdk-aptos/package.json +++ b/packages/sdk-aptos/package.json @@ -1,7 +1,7 @@ { "name": "@sentio/sdk-aptos", "license": "Apache-2.0", - "version": "1.0.0", + "version": "1.0.0-development", "scripts": { "compile": "tsc -p .", "build": "yarn gen && yarn gen_test && yarn compile", @@ -11,7 +11,7 @@ "gen_test": "ts-node src/run-codegen.ts src/tests/abis src/tests/types" }, "dependencies": { - "@sentio/sdk": "^1.0.0", + "@sentio/sdk": "^1.0.0-development", "aptos-sdk": "npm:aptos@^1.3.17", "prettier": "^2.8.1" }, diff --git a/packages/sdk-solana/package.json b/packages/sdk-solana/package.json index b27cd508df..ae094fb94c 100644 --- a/packages/sdk-solana/package.json +++ b/packages/sdk-solana/package.json @@ -1,7 +1,7 @@ { "name": "@sentio/sdk-solana", "license": "Apache-2.0", - "version": "1.0.0", + "version": "1.0.0-development", "scripts": { "compile": "tsc -p .", "build": "yarn compile", @@ -10,7 +10,7 @@ "gen_test": "ts-node src/run-codegen.ts src/tests/abis src/tests/types" }, "dependencies": { - "@sentio/sdk": "^1.0.0", + "@sentio/sdk": "^1.0.0-development", "@project-serum/anchor": "^0.26.0", "@dao-xyz/borsh": "^4.0.7", "@solana/web3.js": "^1.47.3", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d75d46cbbf..9d8e997971 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,7 +1,7 @@ { "name": "@sentio/sdk", "license": "Apache-2.0", - "version": "1.0.0", + "version": "1.0.0-development", "scripts": { "compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json", "compile": "tsc -p . && cp src/utils/*.csv lib/utils", @@ -19,8 +19,8 @@ "dependencies": { "@ethersproject/providers": "~5.7.0", "@sentio/cli": "^1.0.0", - "@sentio/runtime": "^1.0.0", - "@sentio/protos": "^1.0.0", + "@sentio/runtime": "^1.0.0-development", + "@sentio/protos": "^1.0.0-development", "@typechain/ethers-v5": "^10.0.0", "bignumber.js": "^9.1.0", "command-line-args": "^5.2.1", diff --git a/yarn.lock b/yarn.lock index 8afda91ecb..be442c0f31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2389,6 +2389,24 @@ lodash "^4.17.4" read-pkg-up "^7.0.0" +"@sentio/cli@^1.0.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@sentio/cli/-/cli-1.1.1.tgz#84819e001b59e134d967e05d39622b05a4bb08d1" + integrity sha512-Z3WlVRdiY0V2z2pf7JxDj2e986x+0PK50ZJZjnwys2fHjRjWba63K9NulB71P9GsZCHDVXIgmHHBrdvWXpn89w== + dependencies: + command-line-args "^5.2.1" + command-line-usage "^6.1.3" + express "^4.18.2" + form-data "^4.0.0" + fs-extra "^11.0.0" + js-yaml "^4.1.0" + latest-version "^5.1.0" + node-fetch "2" + open "^8.4.0" + ts-loader "^9.3.0" + webpack "^5.72.1" + webpack-cli "^5.0.0" + "@sinclair/typebox@^0.24.1": version "0.24.35" resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.35.tgz"