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/suneditor.css).se-rtl selector belongs in the dedicated block at
the bottom of suneditor.css (/** --- RTL start */ … /** --- RTL end */), never next to the
base (LTR) rules. Group new rules after the existing rules of the same feature area (e.g. table
rules after the other table rules).var(--se-*); define new tokens in
src/assets/design/color.css (light defaults) and override them in every theme file under
src/themes/*.css (dark, midnight, cobalt, cream) — prefer aliasing an existing theme token
(e.g. var(--se-main-color-lighter)) over inventing per-theme literal values.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 |
Use .agents/skills/post-edit/SKILL.md for source edits.
ts-build generates types but masks the compiler exit status with tsc || true; always run
npm run lint:type separately before claiming type safety. check:inject writes generated
source sections; check:langs translates files using Google credentials and is not a read-only
check. Do not run the translation command for unrelated changes or without its configured
service. Report an unavailable translation step explicitly.
For documentation/harness-only changes, check links, command names, examples and
git diff --check; do not regenerate source/types or run the source autofixer.