Skip to content

Commit

Permalink
fix: 修复执行命令失败的问题 (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
timi137137 authored Dec 1, 2023
1 parent 5713da7 commit 8962860
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

### 主功能界面

<img width="500" alt="image" src="https://user-images.githubusercontent.com/7600149/179940926-04c29ef5-85dd-4513-b73d-46356b37312e.png">
<img width="500" alt="image" src="https://github.com/TDesignOteam/tdesign-api/assets/36812439/5b6c5dc0-54ee-4838-8978-5f7d4a9699c2">

你可以主界面里做组件 API 的增删改查操作。

### 生成 API

<img width="500" alt="image" src="https://user-images.githubusercontent.com/7600149/179941570-ad3ff186-c4a5-40b2-b24c-4c4d65d70b26.png">
<img width="500" alt="image" src="https://github.com/TDesignOteam/tdesign-api/assets/36812439/a6de19e7-a68a-4012-8ab1-d0d809dc75d0">

点击 “生成文件” 按钮,指定生成组件和技术栈框架平台,确认后会在本地 `packages/products/` 对应仓库目录下生成对应 md 文档、API 定义等文件。
点击 “Generate API Files” 按钮,指定生成组件和技术栈框架平台,确认后会在本地 `packages/products/` 对应仓库目录下生成对应 md 文档、API 定义等文件。

### 提交

Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/frontend/_site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
</style>
<![endif]-->
<script type="module" crossorigin src="/assets/index.3eea9dee.js"></script>
<script type="module" crossorigin src="/assets/index.a8408da8.js"></script>
<link rel="stylesheet" href="/assets/index.78efbc8a.css">
</head>

Expand Down
4 changes: 3 additions & 1 deletion packages/frontend/src/pages/api/operation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
placeholder="请选择组件"
clearable
filterable
:tips="formData.component === 'ALL' ? tips : ''"
>
<t-option
v-for="(item, index) in componentList"
Expand Down Expand Up @@ -96,9 +97,10 @@ export default {
codeType: '',
generateFilesVisible: false,
checkedAll: false,
tips: '全量输出时限制为只能输出文档,如需输出其他文件请选择对应组件',
formData: {
platform: [],
component: '',
component: 'ALL',
finalProject: false,
}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const { useDefault, onlyDocs, isUseUnitTest, vitest } = parseParams(allParams);

let selfUseDefault = useDefault;

if (isAll(component)) {
console.warn(chalk.yellow('\nWarn: 全量生成由于改动过大,目前限制为只能生成文档,如需生成TS文件,请单独生成组件\n'));
}

// 全量组件,改动较大,限制为暂时只能生成文档,不能生成 TS 文件
if (isAll(component) && onlyDocs) {
generateDocuments();
Expand Down
2 changes: 1 addition & 1 deletion packages/server/services/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const exec = util.promisify(require('child_process').exec);
const scriptsPath = path.resolve('packages/scripts');

export default async function execScript(params: BaseObject) {
const script = `node '${scriptsPath}/download.js' && node '${scriptsPath}/index.js' ${params.commandLine}`;
const script = `node ${scriptsPath}/download.js && node ${scriptsPath}/index.js ${params.commandLine}`;
const { stdout, stderr } = await exec(script);
console.log('Execute:', script);
console.log('stdout:', stdout);
Expand Down

0 comments on commit 8962860

Please sign in to comment.