@douyinfe/create-semi-d2c-plugin
Advanced tools
Comparing version 0.0.1-alpha.0 to 0.0.1
{ | ||
"name": "@douyinfe/create-semi-d2c-plugin", | ||
"version": "0.0.1-alpha.0", | ||
"version": "0.0.1", | ||
"description": "Create Semi D2C plugin project", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,51 +0,1 @@ | ||
var plugin = (function (exports) { | ||
'use strict'; | ||
const generateTemplateFile = (args) => { | ||
const { code, utils } = args; | ||
const { template, imports } = code; | ||
const { getImportsString } = utils; | ||
console.log('template', template); | ||
return `import React from 'react'; | ||
${getImportsString(imports)} | ||
const Component = () => { | ||
return ( | ||
${template} | ||
); | ||
} | ||
export default Component; | ||
`; | ||
}; | ||
const modifyJSONSchema = (node) => { | ||
const root = node.children[0]; | ||
const formNode = { | ||
name: 'Form', | ||
tag: 'Form', | ||
type: 'INSTANCE', | ||
packageName: '@ecom/auxo', | ||
componentName: 'Form', | ||
props: { | ||
children: root, | ||
}, | ||
children: [root], | ||
}; | ||
node.children = [formNode]; | ||
return node; | ||
}; | ||
const semiD2CPlugin = () => ({ | ||
name: 'Semi D2C 示例插件', | ||
options: [], | ||
setup(api) { | ||
api.generateTemplateFile(generateTemplateFile); | ||
api.modifyJSONSchema(modifyJSONSchema); | ||
}, | ||
}); | ||
exports.semiD2CPlugin = semiD2CPlugin; | ||
return exports; | ||
})({}); | ||
var plugin=function(e){"use strict";var t={},n={};Object.defineProperty(n,"__esModule",{value:!0}),n.generateTemplateFile=void 0,n.generateTemplateFile=e=>{const{code:t,utils:n}=e,{template:o,imports:r}=t,{getImportsString:i}=n;return console.log("template",o),`import React from 'react';\n${i(r)}\n\nconst Component = () => {\n return (\n ${o}\n );\n}\nexport default Component;\n`};var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.modifyJSONSchema=void 0,o.modifyJSONSchema=e=>{const t=e.children[0],n={name:"Form",tag:"Form",type:"INSTANCE",packageName:"@ecom/auxo",componentName:"Form",props:{children:t},children:[t]};return e.children=[n],e},Object.defineProperty(t,"__esModule",{value:!0}),e.semiD2CPlugin=t.semiD2CPlugin=void 0;const r=n,i=o;return e.semiD2CPlugin=t.semiD2CPlugin=()=>({name:"Semi D2C 示例插件",options:[],setup(e){e.generateTemplateFile(r.generateTemplateFile),e.modifyJSONSchema(i.modifyJSONSchema)}}),e.default=t,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
@@ -14,3 +14,3 @@ { | ||
"@babel/eslint-parser": "^7.22.10", | ||
"@douyinfe/semi-d2c-typings": "^0.0.1-alpha.0", | ||
"@douyinfe/semi-d2c-typings": "^0.0.1", | ||
"@rollup/plugin-commonjs": "^25.0.4", | ||
@@ -17,0 +17,0 @@ "@rollup/plugin-node-resolve": "^15.2.0", |
@@ -16,3 +16,3 @@ // rollup.config.js | ||
resolve(), | ||
commonjs(), | ||
commonjs({ extensions: ['.js', '.ts'] }), | ||
isProduction && terser(), | ||
@@ -19,0 +19,0 @@ ], |
@@ -5,3 +5,3 @@ { | ||
"lib": ["ES6"], | ||
"module": "ES6", | ||
"module": "CommonJS", | ||
"skipLibCheck": true | ||
@@ -8,0 +8,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16825
14
207