Loading...
Loading...
Code modifications must follow these rules. Violations will cause build or translation failures.
types/ directlyAll .d.ts files under types/ are auto-generated by npm run ts-build.
.js files (JSDoc @typedef, @property, etc.)npm run ts-build to regenerate types/types/ will be overwritten on the next builddist/ directlyAll files under dist/ are auto-generated by webpack build.
src/src/assets/suneditor.css or src/assets/suneditor-contents.cssnpm run build:prod to regenerate dist/en.js onlyAll language files under src/langs/ (except en.js) are auto-generated by the translation script.
src/langs/en.js for string changesnpm run check:langs to sync/translate other language filesko.js, ja.js, zh_cn.js, or any other language fileSome source files contain auto-generated sections between markers. Do not edit content between these markers:
src/typedef.js: /* === [ Button Types - Auto-generated ] === */ — generated by npm run check:injectsrc/core/schema/options.js: /* === [ Plugin-Specific Options ] === */ — generated by npm run check:injectThese three files export the same modules and must be kept in sync:
src/suneditor.js (source of truth)webpack/cdn-builder.js (intentionally excludes langs)scripts/ts-build/format-index.cjsRun npm run check:exports to validate.
| What you changed | Command to run |
|---|---|
JSDoc types in .js files | npm run ts-build |
Language strings (en.js) | npm run check:langs → npm run ts-build |
| Added/removed plugins or toolbar buttons | npm run check:inject → npm run ts-build |
Default options (src/core/schema/options.js) | npm run ts-build |
Exports in src/suneditor.js | Update cdn-builder.js + format-index.cjs → npm run check:exports |