steedos-validate-package
Installation
SKILL.md
Steedos Package Validation | 软件包校验
After creating or modifying a Steedos package, run the validator to check all files.
Installation | 安装
Add to your project's package.json:
{
"devDependencies": {
"@steedos/validate": "latest"
},
"scripts": {
"validate": "steedos-validate"
}
}
Then install:
yarn add --dev @steedos/validate
# or
npm install --save-dev @steedos/validate
Usage | 使用方法
# Validate a single package
yarn validate steedos-packages/my-package
# Or use npx without installing
npx @steedos/validate steedos-packages/my-package
# JSON output (for CI)
yarn validate steedos-packages/my-package --json
What is Validated | 校验内容
Package Structure
package.jsonexists withmain: package.service.jspackage.service.jscontainspackageLoader/namespace/packageInfo
Object Files (.object.yml)
- Required fields:
name,label,icon namemust match folder namenameMUST be prefixed with{org_code}_{project_code}_(e.g.steedos_crm_contracts). Flag any object name without at least two underscore-separated prefix segments as a naming violation.iconshould be a valid SLDS icon name- Object must have a
namefield oris_namefield among its fields
Field Files (.field.yml)
- Required fields:
name,type,label namemust match filename (without.field.yml)typemust be a valid Steedos field typeselect/lookup/summary/formulafields require additional properties
Trigger Files (.trigger.yml)
- Required fields:
name,listenTo,when,type,isEnabled,handler typemust be"code"whenmust be a valid hook name- Triggers must be in
triggers/folder, not insideobjects/
Function Files (.function.yml)
- Required fields:
name,objectApiName,isEnabled,is_rest,script - Functions must be in
functions/folder, not insideobjects/
Button Files (.button.yml)
- Required fields:
name,label,on,amis_schema typemust be"amis_button"amis_schemaroot nodetypemust be"service"label_zhis not allowed (use i18n instead)- Exception: Standard button overrides (e.g.
standard_delete) only needvisible: false
Listview Files (.listview.yml)
- Required fields:
name,label
Permission Files (.permission.yml)
- Required:
nameorpermission_set_id
App Files (.app.yml)
- Required fields:
name,code codeMUST be prefixed with{org_code}_{project_code}_(e.g.steedos_crm_app). Flag any app code without at least two underscore-separated prefix segments as a naming violation.- Should have non-empty
tabs
Tab Files (.tab.yml)
- Required fields:
name,label
Page Files
.page.ymland.page.amis.jsonmust appear in pairs
Common Errors | 常见错误
| Error | Fix |
|---|---|
button.amis-root-service |
Wrap amis_schema with {"type":"service","body":{...}} |
trigger.location |
Move trigger files to main/default/triggers/ |
function.location |
Move function files to main/default/functions/ |
field.name-mismatch |
File name must match name field value |
button.no-label_zh |
Remove label_zh, use i18n translation files instead |
page.missing-amis |
Create matching .page.amis.json file |
object.name-prefix |
Object name must start with {org_code}_{project_code}_, e.g. steedos_crm_contracts |
app.code-prefix |
App code must start with {org_code}_{project_code}_, e.g. steedos_crm_app |
Related skills