@coze-arch/cli 0.0.21 → 0.0.23-alpha.65c1bd
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/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +2 -2
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +1 -1
- package/lib/__templates__/expo/_gitignore +1 -0
- package/lib/__templates__/expo/client/components/Screen.tsx +5 -5
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.types.ts +6 -6
- package/lib/__templates__/expo/client/heroui/components/toast/toast.tsx +2 -2
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-augmented-ref.ts +2 -2
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts +1 -1
- package/lib/__templates__/expo/client/package.json +1 -1
- package/lib/__templates__/expo/pnpm-lock.yaml +7 -7
- package/lib/__templates__/expo/server/package.json +1 -1
- package/lib/__templates__/native-static/.coze +2 -2
- package/lib/__templates__/native-static/_gitignore +1 -0
- package/lib/__templates__/nextjs/_gitignore +1 -0
- package/lib/__templates__/nextjs/eslint.config.mjs +1 -0
- package/lib/__templates__/nextjs/scripts/dev.sh +4 -4
- package/lib/__templates__/nuxt-vue/_gitignore +8 -2
- package/lib/__templates__/nuxt-vue/eslint.config.mjs +33 -0
- package/lib/__templates__/nuxt-vue/package.json +1 -0
- package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +1015 -11
- package/lib/__templates__/nuxt-vue/scripts/dev.sh +4 -4
- package/lib/__templates__/pi-agent/_gitignore +2 -1
- package/lib/__templates__/pi-agent/package.json +1 -1
- package/lib/__templates__/pi-agent/pnpm-lock.yaml +1 -1
- package/lib/__templates__/pi-agent/tests/web-search.test.ts +2 -2
- package/lib/__templates__/taro/_gitignore +1 -0
- package/lib/__templates__/taro/src/components/ui/collapsible.tsx +2 -2
- package/lib/__templates__/taro/src/components/ui/hover-card.tsx +10 -10
- package/lib/__templates__/taro/src/components/ui/input-otp.tsx +3 -2
- package/lib/__templates__/taro/src/components/ui/slider.tsx +4 -4
- package/lib/__templates__/taro/src/components/ui/tabs.tsx +2 -1
- package/lib/__templates__/taro/src/components/ui/toast.tsx +1 -1
- package/lib/__templates__/taro/src/components/ui/tooltip.tsx +10 -10
- package/lib/__templates__/taro/src/lib/measure.ts +1 -1
- package/lib/__templates__/templates.json +24 -24
- package/lib/__templates__/vite/_gitignore +1 -0
- package/lib/__templates__/vite/eslint.config.mjs +17 -0
- package/lib/__templates__/vite/package.json +1 -0
- package/lib/__templates__/vite/pnpm-lock.yaml +1007 -0
- package/lib/__templates__/vite/scripts/dev.sh +4 -4
- package/lib/__templates__/vite/server/server.ts +1 -2
- package/lib/cli.js +73 -62
- package/package.json +12 -13
|
@@ -9,7 +9,7 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
|
9
9
|
<% } else { %>
|
|
10
10
|
PORT=<%= port %>
|
|
11
11
|
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
12
|
-
DEPLOY_RUN_PORT
|
|
12
|
+
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
13
13
|
<% } %>
|
|
14
14
|
|
|
15
15
|
cd "${COZE_WORKSPACE_PATH}"
|
|
@@ -32,8 +32,8 @@ kill_port_if_listening() {
|
|
|
32
32
|
fi
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
echo "Clearing port ${
|
|
35
|
+
echo "Clearing port ${DEPLOY_RUN_PORT} before start."
|
|
36
36
|
kill_port_if_listening
|
|
37
|
-
echo "Starting express + Vite dev server on port ${
|
|
37
|
+
echo "Starting express + Vite dev server on port ${DEPLOY_RUN_PORT}..."
|
|
38
38
|
|
|
39
|
-
PORT=$
|
|
39
|
+
PORT=${DEPLOY_RUN_PORT} pnpm tsx watch server/server.ts
|
|
@@ -39,8 +39,7 @@ async function startServer(): Promise<Server> {
|
|
|
39
39
|
// 全局错误处理
|
|
40
40
|
app.use((err: Error, req: express.Request, res: express.Response) => {
|
|
41
41
|
console.error('Server error:', err);
|
|
42
|
-
|
|
43
|
-
const status = 'status' in err ? (err as any).status || 500 : 500;
|
|
42
|
+
const status = 'status' in err ? (err as { status?: number }).status ?? 500 : 500;
|
|
44
43
|
res.status(status).json({
|
|
45
44
|
error: err.message || 'Internal server error',
|
|
46
45
|
});
|
package/lib/cli.js
CHANGED
|
@@ -1628,7 +1628,7 @@ function createNodeTransport() {
|
|
|
1628
1628
|
};
|
|
1629
1629
|
}
|
|
1630
1630
|
|
|
1631
|
-
function _nullishCoalesce$
|
|
1631
|
+
function _nullishCoalesce$a(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$s(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
1632
1632
|
* Slardar CLI Reporter 主类
|
|
1633
1633
|
* 封装 @slardar/base 的初始化和上报逻辑
|
|
1634
1634
|
*/
|
|
@@ -1685,7 +1685,7 @@ class SlardarCLIReporter {constructor() { SlardarCLIReporter.prototype.__init.ca
|
|
|
1685
1685
|
release: config.release,
|
|
1686
1686
|
env: config.env,
|
|
1687
1687
|
name: config.name,
|
|
1688
|
-
useLocalConfig: _nullishCoalesce$
|
|
1688
|
+
useLocalConfig: _nullishCoalesce$a(config.useLocalConfig, () => ( false)), // 默认使用服务端配置
|
|
1689
1689
|
domain: config.domain,
|
|
1690
1690
|
// 设置本地采样率为 100%,确保事件不被过滤
|
|
1691
1691
|
sample: {
|
|
@@ -2107,7 +2107,7 @@ const EventBuilder = {
|
|
|
2107
2107
|
};
|
|
2108
2108
|
|
|
2109
2109
|
var name = "@coze-arch/cli";
|
|
2110
|
-
var version = "0.0.
|
|
2110
|
+
var version = "0.0.23-alpha.65c1bd";
|
|
2111
2111
|
var description = "coze coding devtools cli";
|
|
2112
2112
|
var license = "MIT";
|
|
2113
2113
|
var author = "fanwenjie.fe@bytedance.com";
|
|
@@ -2149,7 +2149,7 @@ var dependencies = {
|
|
|
2149
2149
|
"ajv-formats": "^3.0.1",
|
|
2150
2150
|
"change-case": "^5.4.4",
|
|
2151
2151
|
commander: "~12.1.0",
|
|
2152
|
-
debug: "^4.3
|
|
2152
|
+
debug: "^4.4.3",
|
|
2153
2153
|
ejs: "^3.1.10",
|
|
2154
2154
|
"fast-glob": "^3.3.3",
|
|
2155
2155
|
"js-yaml": "^4.1.0",
|
|
@@ -2161,7 +2161,6 @@ var devDependencies = {
|
|
|
2161
2161
|
"@coze-arch/cli-slardar": "workspace:*",
|
|
2162
2162
|
"@coze-arch/eslint-config": "workspace:*",
|
|
2163
2163
|
"@coze-arch/fs-enhance": "workspace:*",
|
|
2164
|
-
"@coze-arch/monorepo-kits": "workspace:*",
|
|
2165
2164
|
"@coze-arch/pack-audit": "workspace:*",
|
|
2166
2165
|
"@coze-arch/rollup-config": "workspace:*",
|
|
2167
2166
|
"@coze-arch/ts-config": "workspace:*",
|
|
@@ -2169,27 +2168,27 @@ var devDependencies = {
|
|
|
2169
2168
|
"@coze-coding/lambda": "workspace:*",
|
|
2170
2169
|
"@emnapi/runtime": "^1.7.1",
|
|
2171
2170
|
"@inquirer/prompts": "^3.2.0",
|
|
2172
|
-
"@
|
|
2171
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
2172
|
+
"@rollup/plugin-json": "~6.0.0",
|
|
2173
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
2174
|
+
"@rollup/plugin-sucrase": "^5.0.2",
|
|
2173
2175
|
"@slardar/rd-cli": "^0.10.3",
|
|
2174
|
-
"@types/debug": "^4.1.
|
|
2176
|
+
"@types/debug": "^4.1.13",
|
|
2175
2177
|
"@types/ejs": "^3.1.5",
|
|
2176
2178
|
"@types/iarna__toml": "^2.0.5",
|
|
2177
2179
|
"@types/js-yaml": "^4.0.9",
|
|
2178
|
-
"@types/minimatch": "^5.1.2",
|
|
2179
2180
|
"@types/minimist": "^1.2.5",
|
|
2180
2181
|
"@types/node": "^24",
|
|
2181
2182
|
"@types/shelljs": "^0.10.0",
|
|
2182
|
-
"@vitest/coverage-v8": "~4.
|
|
2183
|
-
"json-schema-to-typescript": "^15.0.3",
|
|
2183
|
+
"@vitest/coverage-v8": "~4.1.6",
|
|
2184
2184
|
knip: "^5.30.1",
|
|
2185
2185
|
minimatch: "^10.0.1",
|
|
2186
|
-
playwright: "~1.
|
|
2186
|
+
playwright: "~1.60.0",
|
|
2187
2187
|
rollup: "^4.60.1",
|
|
2188
|
-
sucrase: "^3.35.
|
|
2188
|
+
sucrase: "^3.35.1",
|
|
2189
2189
|
"tree-kill": "^1.2.2",
|
|
2190
|
-
tsx: "^4.
|
|
2191
|
-
|
|
2192
|
-
vitest: "~4.0.18"
|
|
2190
|
+
tsx: "^4.21.0",
|
|
2191
|
+
vitest: "~4.1.6"
|
|
2193
2192
|
};
|
|
2194
2193
|
var publishConfig = {
|
|
2195
2194
|
access: "public",
|
|
@@ -2383,7 +2382,7 @@ const flushSlardar = safeRun('flushSlardar', async () => {
|
|
|
2383
2382
|
await reporter.flush();
|
|
2384
2383
|
});
|
|
2385
2384
|
|
|
2386
|
-
function _nullishCoalesce$
|
|
2385
|
+
function _nullishCoalesce$9(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var LogLevel; (function (LogLevel) {
|
|
2387
2386
|
const ERROR = 0; LogLevel[LogLevel["ERROR"] = ERROR] = "ERROR";
|
|
2388
2387
|
const WARN = 1; LogLevel[LogLevel["WARN"] = WARN] = "WARN";
|
|
2389
2388
|
const SUCCESS = 2; LogLevel[LogLevel["SUCCESS"] = SUCCESS] = "SUCCESS";
|
|
@@ -2421,7 +2420,7 @@ class Logger {
|
|
|
2421
2420
|
|
|
2422
2421
|
constructor(options = {}) {
|
|
2423
2422
|
this.level = this.parseLogLevel(options.level);
|
|
2424
|
-
this.useColor = _nullishCoalesce$
|
|
2423
|
+
this.useColor = _nullishCoalesce$9(options.useColor, () => ( this.isColorSupported()));
|
|
2425
2424
|
this.prefix = options.prefix;
|
|
2426
2425
|
}
|
|
2427
2426
|
|
|
@@ -2467,7 +2466,7 @@ class Logger {
|
|
|
2467
2466
|
|
|
2468
2467
|
const icon = this.colorize(options.icon, options.color);
|
|
2469
2468
|
const prefix = this.prefix ? `${icon} ${this.prefix}` : icon;
|
|
2470
|
-
console.log(prefix, options.message, ...(_nullishCoalesce$
|
|
2469
|
+
console.log(prefix, options.message, ...(_nullishCoalesce$9(options.args, () => ( []))));
|
|
2471
2470
|
}
|
|
2472
2471
|
|
|
2473
2472
|
error(message, ...args) {
|
|
@@ -2721,10 +2720,11 @@ const getTemplatePath = async (
|
|
|
2721
2720
|
try {
|
|
2722
2721
|
await fs$1.access(templatePath);
|
|
2723
2722
|
logger.verbose(' - Template directory exists: ✓');
|
|
2724
|
-
|
|
2725
|
-
} catch (e) {
|
|
2723
|
+
} catch (error) {
|
|
2726
2724
|
logger.error(' - Template directory does not exist: ✗');
|
|
2727
|
-
throw new Error(
|
|
2725
|
+
throw new Error(
|
|
2726
|
+
`Template directory not found: ${templatePath} (cause: ${error instanceof Error ? error.message : String(error)})`,
|
|
2727
|
+
);
|
|
2728
2728
|
}
|
|
2729
2729
|
|
|
2730
2730
|
return templatePath;
|
|
@@ -3737,8 +3737,10 @@ class Alias extends NodeBase {
|
|
|
3737
3737
|
* instance of the `source` anchor before this node.
|
|
3738
3738
|
*/
|
|
3739
3739
|
resolve(doc, ctx) {
|
|
3740
|
+
if (_optionalChain$l([ctx, 'optionalAccess', _ => _.maxAliasCount]) === 0)
|
|
3741
|
+
throw new ReferenceError('Alias resolution is disabled');
|
|
3740
3742
|
let nodes;
|
|
3741
|
-
if (_optionalChain$l([ctx, 'optionalAccess',
|
|
3743
|
+
if (_optionalChain$l([ctx, 'optionalAccess', _2 => _2.aliasResolveCache])) {
|
|
3742
3744
|
nodes = ctx.aliasResolveCache;
|
|
3743
3745
|
}
|
|
3744
3746
|
else {
|
|
@@ -3777,7 +3779,7 @@ class Alias extends NodeBase {
|
|
|
3777
3779
|
data = anchors.get(source);
|
|
3778
3780
|
}
|
|
3779
3781
|
/* istanbul ignore if */
|
|
3780
|
-
if (_optionalChain$l([data, 'optionalAccess',
|
|
3782
|
+
if (_optionalChain$l([data, 'optionalAccess', _3 => _3.res]) === undefined) {
|
|
3781
3783
|
const msg = 'This should not happen: Alias anchor was not resolved?';
|
|
3782
3784
|
throw new ReferenceError(msg);
|
|
3783
3785
|
}
|
|
@@ -3849,12 +3851,12 @@ Scalar.PLAIN = 'PLAIN';
|
|
|
3849
3851
|
Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
|
|
3850
3852
|
Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
|
|
3851
3853
|
|
|
3852
|
-
function _nullishCoalesce$
|
|
3854
|
+
function _nullishCoalesce$8(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$j(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
3853
3855
|
const defaultTagPrefix = 'tag:yaml.org,2002:';
|
|
3854
3856
|
function findTagObject(value, tagName, tags) {
|
|
3855
3857
|
if (tagName) {
|
|
3856
3858
|
const match = tags.filter(t => t.tag === tagName);
|
|
3857
|
-
const tagObj = _nullishCoalesce$
|
|
3859
|
+
const tagObj = _nullishCoalesce$8(match.find(t => !t.format), () => ( match[0]));
|
|
3858
3860
|
if (!tagObj)
|
|
3859
3861
|
throw new Error(`Tag ${tagName} not found`);
|
|
3860
3862
|
return tagObj;
|
|
@@ -3886,7 +3888,7 @@ function createNode(value, tagName, ctx) {
|
|
|
3886
3888
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
3887
3889
|
ref = sourceObjects.get(value);
|
|
3888
3890
|
if (ref) {
|
|
3889
|
-
_nullishCoalesce$
|
|
3891
|
+
_nullishCoalesce$8(ref.anchor, () => ( (ref.anchor = onAnchor(value))));
|
|
3890
3892
|
return new Alias(ref.anchor);
|
|
3891
3893
|
}
|
|
3892
3894
|
else {
|
|
@@ -4572,7 +4574,7 @@ function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
|
4572
4574
|
return res;
|
|
4573
4575
|
}
|
|
4574
4576
|
|
|
4575
|
-
function _nullishCoalesce$
|
|
4577
|
+
function _nullishCoalesce$7(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$h(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
4576
4578
|
function createStringifyContext(doc, options) {
|
|
4577
4579
|
const opt = Object.assign({
|
|
4578
4580
|
blockQuote: true,
|
|
@@ -4619,7 +4621,7 @@ function getTagObject(tags, item) {
|
|
|
4619
4621
|
if (item.tag) {
|
|
4620
4622
|
const match = tags.filter(t => t.tag === item.tag);
|
|
4621
4623
|
if (match.length > 0)
|
|
4622
|
-
return _nullishCoalesce$
|
|
4624
|
+
return _nullishCoalesce$7(match.find(t => t.format === item.format), () => ( match[0]));
|
|
4623
4625
|
}
|
|
4624
4626
|
let tagObj = undefined;
|
|
4625
4627
|
let obj;
|
|
@@ -4632,14 +4634,14 @@ function getTagObject(tags, item) {
|
|
|
4632
4634
|
match = testMatch;
|
|
4633
4635
|
}
|
|
4634
4636
|
tagObj =
|
|
4635
|
-
_nullishCoalesce$
|
|
4637
|
+
_nullishCoalesce$7(match.find(t => t.format === item.format), () => ( match.find(t => !t.format)));
|
|
4636
4638
|
}
|
|
4637
4639
|
else {
|
|
4638
4640
|
obj = item;
|
|
4639
4641
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
4640
4642
|
}
|
|
4641
4643
|
if (!tagObj) {
|
|
4642
|
-
const name = _nullishCoalesce$
|
|
4644
|
+
const name = _nullishCoalesce$7(_optionalChain$h([obj, 'optionalAccess', _3 => _3.constructor, 'optionalAccess', _4 => _4.name]), () => ( (obj === null ? 'null' : typeof obj)));
|
|
4643
4645
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
4644
4646
|
}
|
|
4645
4647
|
return tagObj;
|
|
@@ -4654,7 +4656,7 @@ function stringifyProps(node, tagObj, { anchors, doc }) {
|
|
|
4654
4656
|
anchors.add(anchor);
|
|
4655
4657
|
props.push(`&${anchor}`);
|
|
4656
4658
|
}
|
|
4657
|
-
const tag = _nullishCoalesce$
|
|
4659
|
+
const tag = _nullishCoalesce$7(node.tag, () => ( (tagObj.default ? null : tagObj.tag)));
|
|
4658
4660
|
if (tag)
|
|
4659
4661
|
props.push(doc.directives.tagString(tag));
|
|
4660
4662
|
return props.join(' ');
|
|
@@ -4680,10 +4682,10 @@ function stringify(item, ctx, onComment, onChompKeep) {
|
|
|
4680
4682
|
const node = isNode(item)
|
|
4681
4683
|
? item
|
|
4682
4684
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
4683
|
-
_nullishCoalesce$
|
|
4685
|
+
_nullishCoalesce$7(tagObj, () => ( (tagObj = getTagObject(ctx.doc.schema.tags, node))));
|
|
4684
4686
|
const props = stringifyProps(node, tagObj, ctx);
|
|
4685
4687
|
if (props.length > 0)
|
|
4686
|
-
ctx.indentAtStart = (_nullishCoalesce$
|
|
4688
|
+
ctx.indentAtStart = (_nullishCoalesce$7(ctx.indentAtStart, () => ( 0))) + props.length + 1;
|
|
4687
4689
|
const str = typeof tagObj.stringify === 'function'
|
|
4688
4690
|
? tagObj.stringify(node, ctx, onComment, onChompKeep)
|
|
4689
4691
|
: isScalar(node)
|
|
@@ -4696,7 +4698,7 @@ function stringify(item, ctx, onComment, onChompKeep) {
|
|
|
4696
4698
|
: `${props}\n${ctx.indent}${str}`;
|
|
4697
4699
|
}
|
|
4698
4700
|
|
|
4699
|
-
function _nullishCoalesce$
|
|
4701
|
+
function _nullishCoalesce$6(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
4700
4702
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
4701
4703
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
4702
4704
|
let keyComment = (isNode(key) && key.comment) || null;
|
|
@@ -4806,7 +4808,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
|
4806
4808
|
const vs0 = valueStr[0];
|
|
4807
4809
|
const nl0 = valueStr.indexOf('\n');
|
|
4808
4810
|
const hasNewline = nl0 !== -1;
|
|
4809
|
-
const flow = _nullishCoalesce$
|
|
4811
|
+
const flow = _nullishCoalesce$6(_nullishCoalesce$6(ctx.inFlow, () => ( value.flow)), () => ( value.items.length === 0));
|
|
4810
4812
|
if (hasNewline || !flow) {
|
|
4811
4813
|
let hasPropsLine = false;
|
|
4812
4814
|
if (hasNewline && (vs0 === '&' || vs0 === '!')) {
|
|
@@ -4873,18 +4875,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
|
4873
4875
|
merge.identify(key.value))) &&
|
|
4874
4876
|
_optionalChain$g([ctx, 'optionalAccess', _ => _.doc, 'access', _2 => _2.schema, 'access', _3 => _3.tags, 'access', _4 => _4.some, 'call', _5 => _5(tag => tag.tag === merge.tag && tag.default)]);
|
|
4875
4877
|
function addMergeToJSMap(ctx, map, value) {
|
|
4876
|
-
|
|
4877
|
-
if (isSeq(
|
|
4878
|
-
for (const it of
|
|
4878
|
+
const source = resolveAliasValue(ctx, value);
|
|
4879
|
+
if (isSeq(source))
|
|
4880
|
+
for (const it of source.items)
|
|
4879
4881
|
mergeValue(ctx, map, it);
|
|
4880
|
-
else if (Array.isArray(
|
|
4881
|
-
for (const it of
|
|
4882
|
+
else if (Array.isArray(source))
|
|
4883
|
+
for (const it of source)
|
|
4882
4884
|
mergeValue(ctx, map, it);
|
|
4883
4885
|
else
|
|
4884
|
-
mergeValue(ctx, map,
|
|
4886
|
+
mergeValue(ctx, map, source);
|
|
4885
4887
|
}
|
|
4886
4888
|
function mergeValue(ctx, map, value) {
|
|
4887
|
-
const source = ctx
|
|
4889
|
+
const source = resolveAliasValue(ctx, value);
|
|
4888
4890
|
if (!isMap(source))
|
|
4889
4891
|
throw new Error('Merge sources must be maps or map aliases');
|
|
4890
4892
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
@@ -4907,6 +4909,9 @@ function mergeValue(ctx, map, value) {
|
|
|
4907
4909
|
}
|
|
4908
4910
|
return map;
|
|
4909
4911
|
}
|
|
4912
|
+
function resolveAliasValue(ctx, value) {
|
|
4913
|
+
return ctx && isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
|
|
4914
|
+
}
|
|
4910
4915
|
|
|
4911
4916
|
function _optionalChain$f(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
4912
4917
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
@@ -4996,9 +5001,9 @@ class Pair {
|
|
|
4996
5001
|
}
|
|
4997
5002
|
}
|
|
4998
5003
|
|
|
4999
|
-
function _nullishCoalesce$
|
|
5004
|
+
function _nullishCoalesce$5(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$d(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
5000
5005
|
function stringifyCollection(collection, ctx, options) {
|
|
5001
|
-
const flow = _nullishCoalesce$
|
|
5006
|
+
const flow = _nullishCoalesce$5(ctx.inFlow, () => ( collection.flow));
|
|
5002
5007
|
const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
5003
5008
|
return stringify(collection, ctx, options);
|
|
5004
5009
|
}
|
|
@@ -5145,7 +5150,7 @@ function addCommentBefore({ indent, options: { commentString } }, lines, comment
|
|
|
5145
5150
|
}
|
|
5146
5151
|
}
|
|
5147
5152
|
|
|
5148
|
-
function _nullishCoalesce$
|
|
5153
|
+
function _nullishCoalesce$4(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$c(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
5149
5154
|
function findPair(items, key) {
|
|
5150
5155
|
const k = isScalar(key) ? key.value : key;
|
|
5151
5156
|
for (const it of items) {
|
|
@@ -5242,7 +5247,7 @@ class YAMLMap extends Collection {
|
|
|
5242
5247
|
get(key, keepScalar) {
|
|
5243
5248
|
const it = findPair(this.items, key);
|
|
5244
5249
|
const node = _optionalChain$c([it, 'optionalAccess', _5 => _5.value]);
|
|
5245
|
-
return _nullishCoalesce$
|
|
5250
|
+
return _nullishCoalesce$4((!keepScalar && isScalar(node) ? node.value : node), () => ( undefined));
|
|
5246
5251
|
}
|
|
5247
5252
|
has(key) {
|
|
5248
5253
|
return !!findPair(this.items, key);
|
|
@@ -7309,7 +7314,7 @@ const getTemplatePatches = (
|
|
|
7309
7314
|
) =>
|
|
7310
7315
|
patches.filter(patch => patch.template === template);
|
|
7311
7316
|
|
|
7312
|
-
function _nullishCoalesce$
|
|
7317
|
+
function _nullishCoalesce$3(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
7313
7318
|
const DEFAULT_LEGACY_VERSION = 'legacy';
|
|
7314
7319
|
|
|
7315
7320
|
const loadFlagsWithFallback = async () => {
|
|
@@ -7492,7 +7497,7 @@ const executePatch = async (
|
|
|
7492
7497
|
|
|
7493
7498
|
if (options.dryRun) {
|
|
7494
7499
|
logger.info(`Detected template: ${template}`);
|
|
7495
|
-
logger.info(`Current version: ${_nullishCoalesce$
|
|
7500
|
+
logger.info(`Current version: ${_nullishCoalesce$3(projectVersion, () => ( DEFAULT_LEGACY_VERSION))}`);
|
|
7496
7501
|
logger.info(`Applied patches: ${appliedPatches.join(', ') || '(none)'}`);
|
|
7497
7502
|
logger.info('Matched patches:');
|
|
7498
7503
|
matchedPatches.forEach(patch => {
|
|
@@ -7557,7 +7562,9 @@ const registerCommand$4 = program => {
|
|
|
7557
7562
|
);
|
|
7558
7563
|
};
|
|
7559
7564
|
|
|
7560
|
-
function _nullishCoalesce$
|
|
7565
|
+
function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
7566
|
+
const d$1 = debug('coze-init-cli:run');
|
|
7567
|
+
|
|
7561
7568
|
/**
|
|
7562
7569
|
* 日志文件名常量
|
|
7563
7570
|
*/
|
|
@@ -7657,9 +7664,12 @@ const executeRun = async (
|
|
|
7657
7664
|
const fixStartTime = Date.now();
|
|
7658
7665
|
try {
|
|
7659
7666
|
await executePatch();
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7667
|
+
} catch (patchError) {
|
|
7668
|
+
// patch errors are intentionally non-fatal: trace and proceed with the main command
|
|
7669
|
+
d$1(
|
|
7670
|
+
'patch step failed (continuing): %s',
|
|
7671
|
+
patchError instanceof Error ? patchError.message : String(patchError),
|
|
7672
|
+
);
|
|
7663
7673
|
}
|
|
7664
7674
|
fixDuration = Date.now() - fixStartTime;
|
|
7665
7675
|
logger.info('');
|
|
@@ -7711,7 +7721,7 @@ const executeRun = async (
|
|
|
7711
7721
|
const buildDuration = Date.now() - buildStartTime;
|
|
7712
7722
|
|
|
7713
7723
|
if (code !== 0) {
|
|
7714
|
-
const errorMessage = `Command exited with code ${_nullishCoalesce$
|
|
7724
|
+
const errorMessage = `Command exited with code ${_nullishCoalesce$2(code, () => ( 'unknown'))}${signal ? ` and signal ${signal}` : ''}`;
|
|
7715
7725
|
logger.error(errorMessage);
|
|
7716
7726
|
logger.error(`Check log file for details: ${logFilePath}`);
|
|
7717
7727
|
|
|
@@ -7723,12 +7733,12 @@ const executeRun = async (
|
|
|
7723
7733
|
categories: {
|
|
7724
7734
|
fixDuration: String(fixDuration),
|
|
7725
7735
|
buildDuration: String(buildDuration),
|
|
7726
|
-
exitCode: String(_nullishCoalesce$
|
|
7736
|
+
exitCode: String(_nullishCoalesce$2(code, () => ( 'unknown'))),
|
|
7727
7737
|
projectType,
|
|
7728
7738
|
},
|
|
7729
7739
|
errorContext: {
|
|
7730
|
-
exitCode: String(_nullishCoalesce$
|
|
7731
|
-
signal: _nullishCoalesce$
|
|
7740
|
+
exitCode: String(_nullishCoalesce$2(code, () => ( 'unknown'))),
|
|
7741
|
+
signal: _nullishCoalesce$2(signal, () => ( 'none')),
|
|
7732
7742
|
logFile: logFilePath,
|
|
7733
7743
|
projectType,
|
|
7734
7744
|
},
|
|
@@ -8737,6 +8747,9 @@ const registerCommand$2 = program => {
|
|
|
8737
8747
|
});
|
|
8738
8748
|
};
|
|
8739
8749
|
|
|
8750
|
+
function _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
8751
|
+
|
|
8752
|
+
|
|
8740
8753
|
const d = debug('coze-init-cli:check-bins');
|
|
8741
8754
|
|
|
8742
8755
|
|
|
@@ -8748,7 +8761,6 @@ const d = debug('coze-init-cli:check-bins');
|
|
|
8748
8761
|
const checkBins = async (cwd, fix) => {
|
|
8749
8762
|
d('starting check, cwd=%s fix=%s', cwd, fix);
|
|
8750
8763
|
|
|
8751
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- fallback {} ensures non-null
|
|
8752
8764
|
const pkgJson = safeJsonParse
|
|
8753
8765
|
|
|
8754
8766
|
|
|
@@ -8792,8 +8804,7 @@ const checkBins = async (cwd, fix) => {
|
|
|
8792
8804
|
|
|
8793
8805
|
const bins =
|
|
8794
8806
|
typeof depPkg.bin === 'string'
|
|
8795
|
-
?
|
|
8796
|
-
{ [depName.split('/').pop()]: depPkg.bin }
|
|
8807
|
+
? { [_nullishCoalesce$1(depName.split('/').pop(), () => ( depName))]: depPkg.bin }
|
|
8797
8808
|
: depPkg.bin;
|
|
8798
8809
|
|
|
8799
8810
|
d('%s declares bins: %o', depName, Object.keys(bins));
|
|
@@ -8949,6 +8960,8 @@ const validateParams = (
|
|
|
8949
8960
|
return params ;
|
|
8950
8961
|
};
|
|
8951
8962
|
|
|
8963
|
+
const ARGV_USER_ARGS_OFFSET = 2;
|
|
8964
|
+
|
|
8952
8965
|
/**
|
|
8953
8966
|
* 从 Commander 解析透传参数
|
|
8954
8967
|
* 将 kebab-case 的 CLI 参数转换为 camelCase
|
|
@@ -8963,9 +8976,7 @@ const parsePassThroughParams = (
|
|
|
8963
8976
|
command,
|
|
8964
8977
|
knownOptions = new Set(),
|
|
8965
8978
|
) => {
|
|
8966
|
-
|
|
8967
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- slice(2) to skip node and script path
|
|
8968
|
-
const parsed = minimist(process.argv.slice(2));
|
|
8979
|
+
const parsed = minimist(process.argv.slice(ARGV_USER_ARGS_OFFSET));
|
|
8969
8980
|
|
|
8970
8981
|
// 过滤掉已知选项和位置参数(_)
|
|
8971
8982
|
const filtered = Object.entries(parsed).reduce(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coze-arch/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23-alpha.65c1bd",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "coze coding devtools cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ajv-formats": "^3.0.1",
|
|
43
43
|
"change-case": "^5.4.4",
|
|
44
44
|
"commander": "~12.1.0",
|
|
45
|
-
"debug": "^4.3
|
|
45
|
+
"debug": "^4.4.3",
|
|
46
46
|
"ejs": "^3.1.10",
|
|
47
47
|
"fast-glob": "^3.3.3",
|
|
48
48
|
"js-yaml": "^4.1.0",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"@coze-arch/cli-slardar": "workspace:*",
|
|
55
55
|
"@coze-arch/eslint-config": "workspace:*",
|
|
56
56
|
"@coze-arch/fs-enhance": "workspace:*",
|
|
57
|
-
"@coze-arch/monorepo-kits": "workspace:*",
|
|
58
57
|
"@coze-arch/pack-audit": "workspace:*",
|
|
59
58
|
"@coze-arch/rollup-config": "workspace:*",
|
|
60
59
|
"@coze-arch/ts-config": "workspace:*",
|
|
@@ -62,27 +61,27 @@
|
|
|
62
61
|
"@coze-coding/lambda": "workspace:*",
|
|
63
62
|
"@emnapi/runtime": "^1.7.1",
|
|
64
63
|
"@inquirer/prompts": "^3.2.0",
|
|
65
|
-
"@
|
|
64
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
65
|
+
"@rollup/plugin-json": "~6.0.0",
|
|
66
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
67
|
+
"@rollup/plugin-sucrase": "^5.0.2",
|
|
66
68
|
"@slardar/rd-cli": "^0.10.3",
|
|
67
|
-
"@types/debug": "^4.1.
|
|
69
|
+
"@types/debug": "^4.1.13",
|
|
68
70
|
"@types/ejs": "^3.1.5",
|
|
69
71
|
"@types/iarna__toml": "^2.0.5",
|
|
70
72
|
"@types/js-yaml": "^4.0.9",
|
|
71
|
-
"@types/minimatch": "^5.1.2",
|
|
72
73
|
"@types/minimist": "^1.2.5",
|
|
73
74
|
"@types/node": "^24",
|
|
74
75
|
"@types/shelljs": "^0.10.0",
|
|
75
|
-
"@vitest/coverage-v8": "~4.
|
|
76
|
-
"json-schema-to-typescript": "^15.0.3",
|
|
76
|
+
"@vitest/coverage-v8": "~4.1.6",
|
|
77
77
|
"knip": "^5.30.1",
|
|
78
78
|
"minimatch": "^10.0.1",
|
|
79
|
-
"playwright": "~1.
|
|
79
|
+
"playwright": "~1.60.0",
|
|
80
80
|
"rollup": "^4.60.1",
|
|
81
|
-
"sucrase": "^3.35.
|
|
81
|
+
"sucrase": "^3.35.1",
|
|
82
82
|
"tree-kill": "^1.2.2",
|
|
83
|
-
"tsx": "^4.
|
|
84
|
-
"
|
|
85
|
-
"vitest": "~4.0.18"
|
|
83
|
+
"tsx": "^4.21.0",
|
|
84
|
+
"vitest": "~4.1.6"
|
|
86
85
|
},
|
|
87
86
|
"publishConfig": {
|
|
88
87
|
"access": "public",
|