@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
57 lines (44 loc) • 1.7 kB
JavaScript
;
const {
applyClassReplacementsJs,
transformStringLiterals,
transformTemplateLiterals,
removeDeprecatedWindowOptions,
} = require('../_shared.cjs');
const SCRIPT_RE = /(<script(?![^>]*\bsrc\b)[^>]*>)([\s\S]*?)(<\/script>)/gi;
function transformScriptContent(content, j) {
let root;
try {
root = j(content);
} catch {
return content;
}
const c1 = transformStringLiterals(root, j, applyClassReplacementsJs);
const c2 = transformTemplateLiterals(root, j, applyClassReplacementsJs);
const c3 = removeDeprecatedWindowOptions(root, j);
if (!c1 && !c2 && !c3) {
return content;
}
return root.toSource({ quote: 'single' });
}
module.exports = function transformer(fileInfo, api) {
if (!/\.html?$/i.test(fileInfo.path)) {
return undefined;
}
const j = api.jscodeshift;
let source = fileInfo.source;
let changed = false;
source = source.replace(SCRIPT_RE, (match, open, content, close) => {
const transformed = transformScriptContent(content, j);
if (transformed !== content) {
changed = true;
return open + transformed + close;
}
return match;
});
return changed ? source : undefined;
};
module.exports.aiInstructions = `Applies all JavaScript transforms to inline <script> blocks in HTML files for Kendo UI 2026 Q3. This includes:
1. Scheduler class string renames (k-event-actions, k-scheduler-tooltip, k-tooltip-* classes)
2. Removal of deprecated Window options from kendoScheduler editable.window configuration (draggable, resizable, pinned, appendTo, loadContentFrom, position, etc.)
See js/scheduler-class-strings and js/scheduler-editable-window-options codemods for full details.`;