Skip to content

Commit

Permalink
Merge pull request #82 from kne-union/linzp
Browse files Browse the repository at this point in the history
升级importStatement支持
  • Loading branch information
zhipenglin authored Sep 25, 2024
2 parents 93139f9 + 7e67ca9 commit 9937e39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/readme-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const readmeGenerator = (readme) => {

return `${importList.join("\n")}
const readmeConfig = {
name: \`${readme.name||''}\`,
name: \`${readme.name || ''}\`,
summary: \`${readme.summary}\`,
${readme.description?`description: \`${readme.description}\`,`:''}
${readme.packageName?`packageName: \`${readme.packageName}\`,`:''}
${readme.description ? `description: \`${readme.description}\`,` : ''}
${readme.packageName ? `packageName: \`${readme.packageName}\`,` : ''}
api: \`${readme.api}\`,
example: {
isFull: ${get(readme, "example.isFull") || "false"},
Expand All @@ -30,10 +30,11 @@ const readmeConfig = {
title: \`${item.title}\`,
description: \`${item.description}\`,
code: \`${(item.code || "").toString().replace(/\$/g, "\\$").replace(/`/g, "\\`")}\`,
scope: [${(item.scope || []).filter(({name}) => !!name).map(({name, packageName}) => {
scope: [${(item.scope || []).filter(({name}) => !!name).map(({name, importStatement, packageName}) => {
return `{
name: "${name}",
packageName: "${packageName}",
packageName: "${packageName}",${importStatement?`
importStatement: "${importStatement}",`:''}
component: ${mapping[packageName]}
}`;
}).join(",")}]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kne/modules-dev",
"version": "2.0.31",
"version": "2.0.32",
"description": "用于辅助在项目内启动一个规范化组件开发的环境",
"publishConfig": {
"source": "src/index.js",
Expand Down

0 comments on commit 9937e39

Please sign in to comment.