@cloudbase/cli 2.10.1-alpha.1 → 2.10.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/cli.js +97 -9
- package/package.json +1 -1
package/dist/standalone/cli.js
CHANGED
|
@@ -47408,7 +47408,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
|
|
|
47408
47408
|
/***/ ((module) => {
|
|
47409
47409
|
|
|
47410
47410
|
"use strict";
|
|
47411
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.10.1-alpha.
|
|
47411
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.10.1-alpha.2","description":"cli tool for cloudbase","main":"lib/index.js","scripts":{"build":"rimraf lib types && tsc --resolveJsonModule && cpx \\"src/**/*.html\\" lib","watch":"rimraf lib types && tsc -w","dev":"rimraf lib types && cpx \\"src/**/*.html\\" lib && tsc -w","eslint":"eslint \\"./**/*.ts\\"","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit --detectOpenHandles --coverage --verbose --testTimeout=10000","tsc":"tsc","pkg":"pkg ./bin/cloudbase.js --out-path ./pkg","postinstall":"node ./post-install.js || exit 0 && patch-package","prepublishOnly":"npm run build","debug":"bin/tcb.js lowcode watch","build:bundle":"webpack --config build/webpack/cli.cjs && webpack --config build/webpack/ccr.cjs","package:darwin-arm64":"OS=darwin ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:darwin-x64":"OS=darwin ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:linux-arm64":"OS=linux ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:linux-x64":"OS=linux ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:all":"bash build/scripts/build-all.sh","node:fetch:one":"node -e \\"require(\'child_process\').execSync(\'bash build/scripts/fetch-node.sh\',{stdio:\'inherit\'})\\"","node:fetch:all":"NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh --all","node:fetch:win-x64":"OS=windows ARCH=x64 NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh","node:fetch:win-arm64":"OS=windows ARCH=arm64 NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh","package:windows-x64":"OS=windows ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:windows-arm64":"OS=windows ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:windows-all":"npm run -s node:fetch:win-x64 && npm run -s node:fetch:win-arm64 && npm run -s package:windows-x64 && npm run -s package:windows-arm64","package:npm":"npm run build && npm run build:bundle && bash build/scripts/prepare-publish.sh","out:prune":"bash build/scripts/prune-out.sh","i18n:scan":"i18next-scanner --config locales/i18next-scanner.config.js && node locales/scripts/generate.js","i18n:sync":"node locales/scripts/sync.js sync"},"repository":{"type":"git","url":"https://github.com/TencentCloudBase/cloud-base-cli.git"},"bin":{"ccr":"bin/ccr.js","cloudbase":"bin/cloudbase.js","cloudbase-mcp":"bin/cloudbase-mcp.cjs","tcb":"bin/tcb.js"},"husky":{"hooks":{"pre-commit":"npm run build"}},"author":"cwuyiqing@gmail.com","license":"ISC","dependencies":{"@cloudbase/cloud-api":"^0.5.5","@cloudbase/cloudbase-mcp":"^1.8.44","@cloudbase/framework-core":"^1.9.7","@cloudbase/functions-framework":"1.16.0","@cloudbase/iac-core":"0.0.3-alpha.11","@cloudbase/lowcode-cli":"^0.23.0","@cloudbase/manager-node":"4.6.5","@cloudbase/toolbox":"^0.7.9","@dotenvx/dotenvx":"^1.48.3","@musistudio/claude-code-router":"1.0.36","address":"^1.1.2","camelcase-keys":"^7.0.2","chalk":"^2.4.2","cli-table3":"^0.5.1","commander":"7","del":"^5.1.0","didyoumean":"^1.2.2","enquirer":"^2.3.6","execa":"^4.0.3","figlet":"^1.7.0","fs-extra":"^8.1.0","gradient-string":"^2.0.2","https-proxy-agent":"^5.0.1","i":"^0.3.7","inquirer":"^6.5.0","json-schema-to-typescript":"^14.0.5","lodash":"^4.17.21","log-symbols":"^3.0.0","lowdb":"^1.0.0","make-dir":"^3.0.0","node-fetch":"^2.6.0","nodemon":"^3.1.4","npm":"^11.5.2","open":"^7.0.0","ora":"^4.0.2","os-locale":"5.0.0","patch-package":"^8.0.0","portfinder":"^1.0.28","progress":"^2.0.3","query-string":"^6.8.1","reflect-metadata":"^0.1.13","semver":"^7.3.7","simple-git":"^3.28.0","tar-fs":"^2.0.1","terminal-link":"^2.1.1","toml":"^3.0.0","unzipper":"^0.10.10","update-notifier":"^4.0.0","xdg-basedir":"^4.0.0","yargs":"^16.2.0","yargs-parser":"^21.0.1","zod":"^4.0.13"},"devDependencies":{"@babel/parser":"^7.28.4","@babel/traverse":"^7.28.4","@babel/types":"^7.28.4","@types/fs-extra":"^11.0.4","@types/jest":"^27","@types/koa__router":"^8.0.11","@types/lodash":"^4.14.182","@types/node":"^12.12.38","@types/node-fetch":"^2.5.4","@types/react":"^17.0.37","@types/semver":"^7.3.9","@types/unzipper":"^0.10.11","@types/webpack-dev-server":"^3.11.1","@typescript-eslint/eslint-plugin":"^4.8.1","@typescript-eslint/parser":"^4.8.1","cpx":"^1.5.0","eslint":"^7.14.0","eslint-config-alloy":"^3.8.2","husky":"^3.0.9","i18next-scanner":"^4.6.0","jest":"^27","rimraf":"^3.0.2","ts-jest":"^27","typescript":"^4.7.2","webpack":"^5.92.0","webpack-cli":"^5.1.4"},"packageManager":"yarn@3.6.2+sha512.2c2f8b9615e6659773f65cdec7cf92ef773a98a99e611579601f61c7a91ec94c89c929aac86f1cee819421a9b0db7acfd53ec3ebb95af44f77f77634b08b9557"}');
|
|
47412
47412
|
|
|
47413
47413
|
/***/ }),
|
|
47414
47414
|
|
|
@@ -185877,6 +185877,7 @@ const os_1 = __importDefault(__webpack_require__(70857));
|
|
|
185877
185877
|
const path_1 = __importDefault(__webpack_require__(16928));
|
|
185878
185878
|
const fs_extra_1 = __importDefault(__webpack_require__(21605));
|
|
185879
185879
|
const semver_1 = __importDefault(__webpack_require__(21970));
|
|
185880
|
+
const enquirer_1 = __webpack_require__(21124);
|
|
185880
185881
|
const { createRequire } = __webpack_require__(73339);
|
|
185881
185882
|
const LOWCODE_PKG_NAME = '@cloudbase/lowcode-cli';
|
|
185882
185883
|
const LOWCODE_PKG_RANGE = ((_a = (__webpack_require__(8330).dependencies)) === null || _a === void 0 ? void 0 : _a[LOWCODE_PKG_NAME]) || 'latest';
|
|
@@ -185960,12 +185961,76 @@ function resolveNpmInvocation() {
|
|
|
185960
185961
|
function formatInstallHint() {
|
|
185961
185962
|
const cacheDir = getLowcodeHome();
|
|
185962
185963
|
return [
|
|
185963
|
-
|
|
185964
|
-
|
|
185965
|
-
|
|
185966
|
-
'可通过环境变量 CLOUDBASE_LOWCODE_HOME
|
|
185964
|
+
'缺少 lowcode 相关依赖,请先执行:',
|
|
185965
|
+
' tcb lowcode deps install',
|
|
185966
|
+
`进行安装,默认安装路径:${cacheDir}`,
|
|
185967
|
+
'可通过环境变量 CLOUDBASE_LOWCODE_HOME 指定其他缓存目录'
|
|
185967
185968
|
].join('\n');
|
|
185968
185969
|
}
|
|
185970
|
+
function exitWithInstallHint() {
|
|
185971
|
+
console.log(`\n${formatInstallHint()}\n`);
|
|
185972
|
+
process.emit('tcbExit');
|
|
185973
|
+
process.exit(1);
|
|
185974
|
+
}
|
|
185975
|
+
function canPromptInstallDeps() {
|
|
185976
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
185977
|
+
}
|
|
185978
|
+
let hasTriedAutoInstall = false;
|
|
185979
|
+
function promptAndInstallLowcodeDeps() {
|
|
185980
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185981
|
+
if (hasTriedAutoInstall || !canPromptInstallDeps()) {
|
|
185982
|
+
return false;
|
|
185983
|
+
}
|
|
185984
|
+
hasTriedAutoInstall = true;
|
|
185985
|
+
let shouldInstall = false;
|
|
185986
|
+
try {
|
|
185987
|
+
const promptResult = yield (0, enquirer_1.prompt)({
|
|
185988
|
+
type: 'confirm',
|
|
185989
|
+
name: 'installNow',
|
|
185990
|
+
initial: true,
|
|
185991
|
+
message: '首次使用 lowcode 命令需要安装相关依赖,是否立即安装?'
|
|
185992
|
+
});
|
|
185993
|
+
shouldInstall = Boolean(promptResult.installNow);
|
|
185994
|
+
}
|
|
185995
|
+
catch (e) {
|
|
185996
|
+
shouldInstall = false;
|
|
185997
|
+
}
|
|
185998
|
+
if (!shouldInstall) {
|
|
185999
|
+
return false;
|
|
186000
|
+
}
|
|
186001
|
+
console.log('\n依赖安装中...(首次安装可能较慢,请耐心等待)\n');
|
|
186002
|
+
yield installLowcodeDeps();
|
|
186003
|
+
console.log('\nlowcode 依赖安装完成...\n');
|
|
186004
|
+
return true;
|
|
186005
|
+
});
|
|
186006
|
+
}
|
|
186007
|
+
function resolveProjectLowcode() {
|
|
186008
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186009
|
+
const cwd = process.cwd();
|
|
186010
|
+
if (!cwd) {
|
|
186011
|
+
return null;
|
|
186012
|
+
}
|
|
186013
|
+
let pkgJsonPath;
|
|
186014
|
+
try {
|
|
186015
|
+
pkgJsonPath = __webpack_require__(43845).resolve(`${LOWCODE_PKG_NAME}/package.json`, { paths: [cwd] });
|
|
186016
|
+
}
|
|
186017
|
+
catch (e) {
|
|
186018
|
+
return null;
|
|
186019
|
+
}
|
|
186020
|
+
try {
|
|
186021
|
+
const pkgJson = yield fs_extra_1.default.readJson(pkgJsonPath);
|
|
186022
|
+
const req = createRequire(pkgJsonPath);
|
|
186023
|
+
const mod = req(LOWCODE_PKG_NAME);
|
|
186024
|
+
const satisfies = (pkgJson === null || pkgJson === void 0 ? void 0 : pkgJson.version)
|
|
186025
|
+
? semver_1.default.satisfies(pkgJson.version, LOWCODE_PKG_RANGE, { includePrerelease: true })
|
|
186026
|
+
: true;
|
|
186027
|
+
return satisfies ? { module: mod, version: pkgJson.version } : null;
|
|
186028
|
+
}
|
|
186029
|
+
catch (e) {
|
|
186030
|
+
return null;
|
|
186031
|
+
}
|
|
186032
|
+
});
|
|
186033
|
+
}
|
|
185969
186034
|
function resolveInstalledLowcode() {
|
|
185970
186035
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185971
186036
|
const pkgJsonPath = path_1.default.join(getLowcodeNodeModules(), LOWCODE_PKG_NAME, 'package.json');
|
|
@@ -186050,12 +186115,20 @@ function getLowcodeCli() {
|
|
|
186050
186115
|
if (lowcodeCliCache) {
|
|
186051
186116
|
return lowcodeCliCache;
|
|
186052
186117
|
}
|
|
186053
|
-
const
|
|
186054
|
-
if (
|
|
186055
|
-
lowcodeCliCache =
|
|
186118
|
+
const projectResolved = yield resolveProjectLowcode();
|
|
186119
|
+
if (projectResolved === null || projectResolved === void 0 ? void 0 : projectResolved.module) {
|
|
186120
|
+
lowcodeCliCache = projectResolved.module;
|
|
186121
|
+
return lowcodeCliCache;
|
|
186122
|
+
}
|
|
186123
|
+
const cachedResolved = yield resolveInstalledLowcode();
|
|
186124
|
+
if (cachedResolved === null || cachedResolved === void 0 ? void 0 : cachedResolved.module) {
|
|
186125
|
+
lowcodeCliCache = cachedResolved.module;
|
|
186056
186126
|
return lowcodeCliCache;
|
|
186057
186127
|
}
|
|
186058
|
-
|
|
186128
|
+
if (yield promptAndInstallLowcodeDeps()) {
|
|
186129
|
+
return getLowcodeCli();
|
|
186130
|
+
}
|
|
186131
|
+
exitWithInstallHint();
|
|
186059
186132
|
});
|
|
186060
186133
|
}
|
|
186061
186134
|
exports.getLowcodeCli = getLowcodeCli;
|
|
@@ -271054,6 +271127,21 @@ function baseAssignIn(object, source) {
|
|
|
271054
271127
|
module.exports = baseAssignIn;
|
|
271055
271128
|
|
|
271056
271129
|
|
|
271130
|
+
/***/ }),
|
|
271131
|
+
|
|
271132
|
+
/***/ 43845:
|
|
271133
|
+
/***/ ((module) => {
|
|
271134
|
+
|
|
271135
|
+
function webpackEmptyContext(req) {
|
|
271136
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
271137
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
271138
|
+
throw e;
|
|
271139
|
+
}
|
|
271140
|
+
webpackEmptyContext.keys = () => ([]);
|
|
271141
|
+
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
271142
|
+
webpackEmptyContext.id = 43845;
|
|
271143
|
+
module.exports = webpackEmptyContext;
|
|
271144
|
+
|
|
271057
271145
|
/***/ }),
|
|
271058
271146
|
|
|
271059
271147
|
/***/ 43852:
|