@open-dy/vibecoding-cli 0.0.2 → 0.1.0-beta.1
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/README.md
CHANGED
|
@@ -24,6 +24,12 @@ Turbo 构建应通过 CLI 包装命令执行,例如 `vibecoding turbo --target
|
|
|
24
24
|
|
|
25
25
|
`vibecoding validate feed-card --target taro` 与 `verify` 的 Feed 卡片检查共享同一实现。它保留原模板脚本的校验:OpenCard 与 Feed 文件的存在关系、JSON 语法、`TemplateType=5` / `TemplateStyleType=6`、`APP_ID` / `OPEN_CARD_ID`、全部 Schema 错误,以及通过后尽力更新 `__timestamp`。失败时不改写 Feed 文件。
|
|
26
26
|
|
|
27
|
+
兴趣卡的 Feed 缓存同步由 CLI 内部适配器负责:当 OpenCard 的 `build:raw.inputs` 声明
|
|
28
|
+
`.cache-inputs/feed-card.json` 时,启动 Turbo 前先将 `../feed/feed-card.json` 原样复制到该缓存文件;
|
|
29
|
+
源文件缺失时清空缓存副本,同步失败则停止构建。原始 Feed 配置不被改写,其他 target 或未声明该输入的工程不执行同步。
|
|
30
|
+
新模板仅调用 `vibecoding turbo --target opencard run build:raw`,需要与包含此能力的 CLI 版本一起交付。
|
|
31
|
+
历史工程保留原有 `node scripts/sync-feed-card-input.mjs && …` 前缀也兼容,无需重装模板或覆盖业务配置。
|
|
32
|
+
|
|
27
33
|
Schema 统一使用 `custom-card-schema.json`。`config/card-routing.json` 的 `cardData.serviceDomain`(`open` / `closed`)是卡片服务域的唯一来源;构建时会据此注入 OpenCard 常量。优先保留项目 `scripts/schemas/`、`feed/` 中的本地 Schema 约束,没有时使用 CLI 内置 Schema。内外场构建后的项目 Schema 仍受支持。
|
|
28
34
|
|
|
29
35
|
两套模板的 `node scripts/check-routes.js` 与 `node scripts/validate-feed-card.js` 均保留为兼容入口,规则统一来自 CLI 的 CJS validator 导出;CLI 命令本身使用对应的 ESM 外层。程序化调用 `validateFeedCard(context, { touchTimestamp: false })` 可禁用时间戳更新。Ajv 由 CLI 自带;OpenCard Lynx CSS 检查复用 `@open-dy/vibecoding-sdk-opencard/eslint/lint-lynx-css`。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-dy/vibecoding-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"description": "Command orchestration, validation and packaging for Douyin vibecoding Taro and OpenCard projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"ajv": "^8.18.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@open-dy/vibecoding-sdk-taro": "0.0.
|
|
47
|
-
"@open-dy/vibecoding-sdk-opencard": "0.0.
|
|
46
|
+
"@open-dy/vibecoding-sdk-taro": "0.1.0-beta.0",
|
|
47
|
+
"@open-dy/vibecoding-sdk-opencard": "0.1.0-beta.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@open-dy/vibecoding-sdk-taro": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"license": "UNLICENSED",
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"registry": "https://registry.npmjs.org/",
|
|
63
|
-
"tag": "
|
|
63
|
+
"tag": "beta",
|
|
64
64
|
"access": "public"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/release-provenance.json
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"producer": "vibecoding-cli",
|
|
4
4
|
"packageName": "@open-dy/vibecoding-cli",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.1.0-beta.1",
|
|
6
6
|
"source": {
|
|
7
|
-
"digest": "sha256-
|
|
8
|
-
"files":
|
|
7
|
+
"digest": "sha256-77d7b0ea1db52eb5a77054124658253f9fd7ad00337333b458128404d0553c84",
|
|
8
|
+
"files": 85
|
|
9
9
|
},
|
|
10
|
-
"payload": "sha256-
|
|
10
|
+
"payload": "sha256-95d7a467807d81da1884538f69e30a6682b617dde3b2df243777d59017b6052f",
|
|
11
11
|
"toolchain": {
|
|
12
12
|
"node": "v22.22.3",
|
|
13
13
|
"packageManager": null
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { copyFile, mkdir, writeFile } from 'node:fs/promises'
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Prepare the Feed snapshot explicitly declared by interest-card templates.
|
|
7
|
+
* Keep the legacy source, destination and missing-file behavior: only the cache
|
|
8
|
+
* copy is written, never the project's Feed configuration.
|
|
9
|
+
*/
|
|
10
|
+
export async function prepareFeedCardInput(projectRoot, config) {
|
|
11
|
+
if (!config.tasks?.['build:raw']?.inputs?.includes('.cache-inputs/feed-card.json')) return
|
|
12
|
+
const source = path.resolve(projectRoot, '../feed/feed-card.json')
|
|
13
|
+
const directory = path.join(projectRoot, '.cache-inputs')
|
|
14
|
+
const destination = path.join(directory, 'feed-card.json')
|
|
15
|
+
await mkdir(directory, { recursive: true })
|
|
16
|
+
if (existsSync(source)) {
|
|
17
|
+
await copyFile(source, destination)
|
|
18
|
+
} else {
|
|
19
|
+
await writeFile(destination, '', 'utf8')
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { prepareFeedCardInput } from '../adapters/interest-card/opencard/prepare-turbo-inputs.mjs'
|
|
2
|
+
|
|
3
|
+
/** Prepare target-specific inputs before Turbo computes any task/cache hashes. */
|
|
4
|
+
export async function prepareTurboInputs(context, config) {
|
|
5
|
+
if (context.target === 'opencard') {
|
|
6
|
+
await prepareFeedCardInput(context.root, config)
|
|
7
|
+
}
|
|
8
|
+
}
|
package/src/commands/turbo.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { openCardBuildEnvironment } from '../build/opencard-environment.mjs'
|
|
3
|
-
import {
|
|
3
|
+
import { resolveTurboConfig, writeTurboConfig } from '../build/turbo-config.mjs'
|
|
4
|
+
import { prepareTurboInputs } from '../build/turbo-inputs.mjs'
|
|
4
5
|
import { UsageError } from '../core/errors.mjs'
|
|
5
6
|
import { resolveProjectBinary, runProcess } from '../core/runner.mjs'
|
|
6
7
|
|
|
@@ -25,7 +26,9 @@ export async function runTurbo(context, { args = [] } = {}) {
|
|
|
25
26
|
throw new UsageError('--root-turbo-json is managed by vibecoding turbo and cannot be overridden')
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
const
|
|
29
|
+
const resolvedConfig = resolveTurboConfig({ projectRoot: context.root, target: context.target })
|
|
30
|
+
await prepareTurboInputs(context, resolvedConfig)
|
|
31
|
+
const config = writeTurboConfig(context.root, resolvedConfig)
|
|
29
32
|
const turboArgs = ['--root-turbo-json', path.relative(context.root, config), ...args]
|
|
30
33
|
const environment = openCardBuildEnvironment(context)
|
|
31
34
|
return runProcess(resolveProjectBinary(context.root, 'turbo'), turboArgs, {
|