Gathering detailed insights and metrics for formily-editor-extensions
Gathering detailed insights and metrics for formily-editor-extensions
Gathering detailed insights and metrics for formily-editor-extensions
Gathering detailed insights and metrics for formily-editor-extensions
npm install formily-editor-extensions
Typescript
Module System
Node Version
NPM Version
75.1
Supply Chain
98.6
Quality
74.4
Maintenance
50
Vulnerability
99.3
License
TypeScript (68.92%)
HTML (18.81%)
CSS (7%)
SCSS (4.21%)
JavaScript (1.05%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
169 Stars
31 Commits
25 Forks
5 Watchers
2 Branches
5 Contributors
Updated on Apr 18, 2025
Latest Version
1.0.0-alpha.4
Package Id
formily-editor-extensions@1.0.0-alpha.4
Unpacked Size
72.55 kB
Size
14.01 kB
File Count
78
NPM Version
lerna/3.22.1/node@v14.16.0+x64 (darwin)
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
1const fs = require('fs'); 2const path = require('path') 3const pick = require('lodash.pick') 4 5const config = require('./config.json') 6 7const supportedTypes = ["bool", "node", "enum", "string", "number"]; 8 9const getSchemaPropertyType = (name) => { 10 if (!supportedTypes.includes(name) || !name) return ''; 11 12 let type = name; 13 switch (name) { 14 case "bool": 15 type = "boolean" 16 break 17 case "node": 18 type = "string" 19 break 20 case "enum": 21 type = "string" 22 break 23 default: 24 type = name 25 } 26 return type 27}; 28 29const getXComponentType = (schemaProperty) => { 30 const { type } = schemaProperty; 31 32 if (type === 'number') return 'numberPicker' 33 34 if (type === 'boolean') return 'switch' 35 if (type === "string" ){ 36 if(!Array.isArray(schemaProperty.enum))return 'input' 37 38 return schemaProperty.enum.length <=3 ? 'radio': 'select' 39 } 40 41 return '' 42} 43 44const buildSchemaProperty = (prop, defaultProp = {}) => { 45 const { type, description, required, defaultValue } = prop 46 47 const schemaPropertytype = getSchemaPropertyType(type.name) 48 let schemaProperty = { 49 type: schemaPropertytype, 50 title: description, 51 required, 52 }; 53 if (defaultValue) { 54 schemaProperty.default = eval(`(${defaultValue.value})`) 55 } 56 if (type.name === "enum") { 57 const { value = [] } = prop.type; 58 59 schemaProperty.enum = value.map(item => ({ 60 label: item.description || eval(`(${item.value})`), 61 value: eval(`(${item.value})`) 62 })); 63 } 64 65 schemaProperty["x-component"] = getXComponentType(schemaProperty) 66 67 return Object.assign(schemaProperty, defaultProp) 68}; 69 70const template = content => { 71 return ` 72 const extensionConfigs = ${content} 73 export default extensionConfigs 74 ` 75} 76 77const transform = (apiSchema, supportedProps) => { 78 let schema = { type: "object", properties: {} } 79 80 if(apiSchema == undefined|| Object.keys(apiSchema).length === 0)return schema; 81 82 const props = pick(apiSchema, Object.keys(supportedProps)) 83 84 Object.keys(props).forEach(propKey => { 85 const schemaProperty = buildSchemaProperty(props[propKey], supportedProps[propKey]); 86 if (schemaProperty) schema.properties[propKey] = schemaProperty 87 }) 88 89 return schema 90} 91 92try { 93 const packagePath = require.resolve("@alifd/next") 94 const dirPath = path.join(path.dirname(packagePath), 'lib') 95 fs.readdir(dirPath, (err, files) => { 96 if(err){ 97 throw new Error('read next error') 98 } 99 100 files.forEach(fileName => { 101 const fielPath = path.join(dirPath, fileName, 'api-schema.json') 102 103 if(fs.existsSync(fielPath)) { 104 const jsonStr = fs.readFileSync(fielPath, { encoding: 'utf-8' }) 105 const jsonObj = JSON.parse(jsonStr) 106 107 if(!config[jsonObj.name])return 108 109 config[jsonObj.name].schema = transform(jsonObj.props, config[jsonObj.name]) 110 } 111 112 }) 113 114 fs.writeFileSync(path.join(path.dirname(__filename), 'config.ts'), template(JSON.stringify(config, null, 4))) 115 }) 116 117} catch (error) { 118 console.error(error) 119}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More