vk-typescript-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Jenkinsfile +48 -0
- package/README.md +300 -0
- package/bin/sf.js +438 -0
- package/eslint.config.js +90 -0
- package/gulpfile.js +157 -0
- package/lib/commander.js +3370 -0
- package/lib/inquirer-prompts.js +2038 -0
- package/license +13 -0
- package/package.json +43 -0
- package/smoke-test.mjs +38 -0
- package/src/commands/add.js +276 -0
- package/src/commands/info.js +82 -0
- package/src/commands/interactive.js +493 -0
- package/src/commands/mcp.js +135 -0
- package/src/commands/new.js +264 -0
- package/src/commands/skills.js +42 -0
- package/src/commands/theme.js +200 -0
- package/src/commands/upgrade.js +219 -0
- package/src/constants.js +161 -0
- package/src/generators/angular.js +878 -0
- package/src/generators/nextjs.js +817 -0
- package/src/generators/react.js +769 -0
- package/src/generators/typescript.js +258 -0
- package/src/generators/vue.js +800 -0
- package/src/templates/angular/chart.component.html +23 -0
- package/src/templates/angular/chart.component.ts +172 -0
- package/src/templates/angular/diagram.component.html +13 -0
- package/src/templates/angular/diagram.component.ts +224 -0
- package/src/templates/angular/docx-editor.component.html +18 -0
- package/src/templates/angular/docx-editor.component.ts +37 -0
- package/src/templates/angular/filemanager.component.html +4 -0
- package/src/templates/angular/filemanager.component.ts +47 -0
- package/src/templates/angular/gantt.component.html +32 -0
- package/src/templates/angular/gantt.component.ts +95 -0
- package/src/templates/angular/grid.component.html +12 -0
- package/src/templates/angular/grid.component.ts +58 -0
- package/src/templates/angular/pdf-viewer.component.html +9 -0
- package/src/templates/angular/pdf-viewer.component.ts +48 -0
- package/src/templates/angular/rte.component.html +7 -0
- package/src/templates/angular/rte.component.ts +13 -0
- package/src/templates/angular/scheduler.component.html +17 -0
- package/src/templates/angular/scheduler.component.ts +75 -0
- package/src/templates/angular/spreadsheet-editor.component.html +42 -0
- package/src/templates/angular/spreadsheet-editor.component.ts +61 -0
- package/src/templates/chart-template.js +20 -0
- package/src/templates/diagram-template.js +26 -0
- package/src/templates/docx-template.js +20 -0
- package/src/templates/filemanager-template.js +20 -0
- package/src/templates/gantt-template.js +20 -0
- package/src/templates/grid-template.js +20 -0
- package/src/templates/pdfviewer-template.js +20 -0
- package/src/templates/react/Chart.jsx +81 -0
- package/src/templates/react/Chart.tsx +81 -0
- package/src/templates/react/DOCXEditor.jsx +37 -0
- package/src/templates/react/DOCXEditor.tsx +37 -0
- package/src/templates/react/Diagram.jsx +192 -0
- package/src/templates/react/Diagram.tsx +195 -0
- package/src/templates/react/FileManager.jsx +13 -0
- package/src/templates/react/FileManager.tsx +13 -0
- package/src/templates/react/Gantt.jsx +89 -0
- package/src/templates/react/Gantt.tsx +89 -0
- package/src/templates/react/Grid.jsx +45 -0
- package/src/templates/react/Grid.tsx +45 -0
- package/src/templates/react/PDFViewer.jsx +16 -0
- package/src/templates/react/PDFViewer.tsx +16 -0
- package/src/templates/react/RTE.jsx +14 -0
- package/src/templates/react/RTE.tsx +14 -0
- package/src/templates/react/Scheduler.jsx +55 -0
- package/src/templates/react/Scheduler.tsx +55 -0
- package/src/templates/react/SpreadsheetEditor.jsx +96 -0
- package/src/templates/react/SpreadsheetEditor.tsx +98 -0
- package/src/templates/rte-template.js +26 -0
- package/src/templates/scheduler-template.js +20 -0
- package/src/templates/spreadheet-template.js +20 -0
- package/src/templates/typescript/RTE.ts +33 -0
- package/src/templates/typescript/SpreadsheetEditor.ts +39 -0
- package/src/templates/typescript/chart.ts +37 -0
- package/src/templates/typescript/diagram.ts +30 -0
- package/src/templates/typescript/docxeditor.ts +30 -0
- package/src/templates/typescript/filemanager.ts +41 -0
- package/src/templates/typescript/gantt.ts +88 -0
- package/src/templates/typescript/grid.ts +30 -0
- package/src/templates/typescript/pdfviewer.ts +8 -0
- package/src/templates/typescript/scheduler.ts +39 -0
- package/src/templates/vue/Chart.vue +257 -0
- package/src/templates/vue/ChartView.vue +7 -0
- package/src/templates/vue/DOCXEditor.vue +61 -0
- package/src/templates/vue/DOCXEditorView.vue +7 -0
- package/src/templates/vue/Diagram.vue +245 -0
- package/src/templates/vue/DiagramView.vue +7 -0
- package/src/templates/vue/FileManager.vue +58 -0
- package/src/templates/vue/FileManagerView.vue +7 -0
- package/src/templates/vue/Gantt.vue +129 -0
- package/src/templates/vue/GanttView.vue +7 -0
- package/src/templates/vue/Grid.vue +141 -0
- package/src/templates/vue/GridView.vue +7 -0
- package/src/templates/vue/PDFViewer.vue +58 -0
- package/src/templates/vue/PDFViewerView.vue +7 -0
- package/src/templates/vue/RTE.vue +27 -0
- package/src/templates/vue/RTEView.vue +7 -0
- package/src/templates/vue/Scheduler.vue +94 -0
- package/src/templates/vue/SchedulerView.vue +7 -0
- package/src/templates/vue/SpreadsheetEditor.vue +115 -0
- package/src/templates/vue/SpreadsheetEditorView.vue +7 -0
- package/src/utils/ansi-colors.js +38 -0
- package/src/utils/banner.js +179 -0
- package/src/utils/common.js +64 -0
- package/src/utils/config-generator.js +73 -0
- package/src/utils/folder-structure.js +26 -0
- package/src/utils/logger.js +19 -0
- package/src/utils/mcp-generator.js +122 -0
- package/src/utils/package-manager.js +128 -0
- package/src/utils/project-bootstrap.js +98 -0
- package/src/utils/project-detector.js +195 -0
- package/src/utils/prompt-utils.js +29 -0
- package/src/utils/run-command.js +110 -0
- package/src/utils/skills-installer.js +69 -0
- package/src/utils/template-file.js +35 -0
- package/src/utils/theme-loader.js +47 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { rm, readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import readline from 'node:readline/promises';
|
|
4
|
+
import { stdin as input, stdout as output } from 'node:process';
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
6
|
+
import { requireSyncfusionProject } from '../utils/project-detector.js';
|
|
7
|
+
import { updateSyncfusionConfig } from '../utils/config-generator.js';
|
|
8
|
+
import {
|
|
9
|
+
addPackagesToJson,
|
|
10
|
+
getSyncfusionPackages,
|
|
11
|
+
detectPackageManager,
|
|
12
|
+
getUpgradeCommand
|
|
13
|
+
} from '../utils/package-manager.js';
|
|
14
|
+
import { runCommand } from '../utils/run-command.js';
|
|
15
|
+
import { pathExists } from '../utils/common.js';
|
|
16
|
+
|
|
17
|
+
export const DEFAULT_SYNCFUSION_VERSION = '34.2.2';
|
|
18
|
+
|
|
19
|
+
function normalizeUpgradeVersion(versionArg) {
|
|
20
|
+
if (!versionArg) return DEFAULT_SYNCFUSION_VERSION;
|
|
21
|
+
|
|
22
|
+
const version = String(versionArg)
|
|
23
|
+
.trim()
|
|
24
|
+
.replace(/^--/, '')
|
|
25
|
+
.replace(/^~/, '');
|
|
26
|
+
|
|
27
|
+
if (!/^\d{1,2}\.\d\.\d{1,2}(?:[-+][0-9A-Za-z.-]+)?$/.test(version)) {
|
|
28
|
+
logger.error(`❌ Invalid Syncfusion version: ${versionArg}`);
|
|
29
|
+
logger.info('Please specify a Main Release or Service Pack (SP) version to install a Syncfusion package.');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return version;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
function normalizePackageVersion(version) {
|
|
38
|
+
return String(version || '')
|
|
39
|
+
.trim()
|
|
40
|
+
.replace(/^[~^]/, '');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isSameSyncfusionVersion(currentVersion, targetVersion) {
|
|
44
|
+
return normalizePackageVersion(currentVersion) === normalizePackageVersion(targetVersion);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getMajorVersion(version) {
|
|
48
|
+
const normalizedVersion = normalizePackageVersion(version);
|
|
49
|
+
const major = Number.parseInt(normalizedVersion.split('.')[0], 10);
|
|
50
|
+
return Number.isNaN(major) ? null : major;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function hasScssStyling(styling) {
|
|
54
|
+
if (!styling) return false;
|
|
55
|
+
if (typeof styling === 'string') {
|
|
56
|
+
return styling.trim().toLowerCase() === 'scss';
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(styling)) {
|
|
59
|
+
return styling.some((item) => hasScssStyling(item));
|
|
60
|
+
}
|
|
61
|
+
if (typeof styling === 'object') {
|
|
62
|
+
return Object.values(styling).some((value) => hasScssStyling(value));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function getSyncfusionConfig(projectRoot) {
|
|
69
|
+
const configPath = path.join(projectRoot, 'syncfusion.config.json');
|
|
70
|
+
if (!(await pathExists(configPath))) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
return JSON.parse(await readFile(configPath, 'utf8'));
|
|
75
|
+
} catch (error) {
|
|
76
|
+
logger.warning(`⚠️ Unable to read syncfusion.config.json: ${error.message}`);
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function isScssThemePackageUnsupported(projectRoot, version) {
|
|
82
|
+
const majorVersion = getMajorVersion(version);
|
|
83
|
+
if (majorVersion === null || majorVersion >= 34) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const syncfusionConfig = await getSyncfusionConfig(projectRoot);
|
|
87
|
+
return hasScssStyling(syncfusionConfig?.styling);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getPackagesDifferentFromVersion(syncfusionPackages, packageVersion) {
|
|
91
|
+
return Object.entries(syncfusionPackages)
|
|
92
|
+
.filter(([, currentVersion]) => !isSameSyncfusionVersion(currentVersion, packageVersion))
|
|
93
|
+
.map(([name]) => name);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function askYesNo(question, defaultValue = true) {
|
|
97
|
+
const suffix = defaultValue ? 'Y/n' : 'y/N';
|
|
98
|
+
const rl = readline.createInterface({ input, output });
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
const answer = (await rl.question(`${question} (${suffix}) `)).trim().toLowerCase();
|
|
102
|
+
if (!answer) return defaultValue;
|
|
103
|
+
return ['y', 'yes', 'true', '1'].includes(answer);
|
|
104
|
+
} finally {
|
|
105
|
+
rl.close();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function printManualSteps() {
|
|
110
|
+
logger.info('\nManual steps to reinstall Syncfusion packages:');
|
|
111
|
+
logger.info(' 1. Delete Syncfusion packages from node_modules:');
|
|
112
|
+
logger.info(' 2. Reinstall the updated Syncfusion packages: npm install');
|
|
113
|
+
logger.info(' 3. Start/rebuild your application to verify the upgrade.\n');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function removeInstalledSyncfusionPackages(projectRoot) {
|
|
117
|
+
const syncfusionNodeModulesPath = path.join(projectRoot, 'node_modules', '@syncfusion');
|
|
118
|
+
|
|
119
|
+
if (await pathExists(syncfusionNodeModulesPath)) {
|
|
120
|
+
await rm(syncfusionNodeModulesPath, { recursive: true, force: true });
|
|
121
|
+
logger.success('✅ Deleted node_modules/@syncfusion');
|
|
122
|
+
} else {
|
|
123
|
+
logger.info('ℹ️ node_modules/@syncfusion was not found, skipping delete step.');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* `sf upgrade` — upgrade every installed @syncfusion/* package in the current
|
|
129
|
+
* project to the requested version. The package.json version is written with a
|
|
130
|
+
* tilde range, e.g. ~34.2.2.
|
|
131
|
+
*/
|
|
132
|
+
export async function upgradeCommand(options = {}) {
|
|
133
|
+
const project = await requireSyncfusionProject(process.cwd());
|
|
134
|
+
if (!project) process.exit(1);
|
|
135
|
+
|
|
136
|
+
const versionArg = options.version;
|
|
137
|
+
const hasExplicitVersion = Boolean(versionArg);
|
|
138
|
+
const version = normalizeUpgradeVersion(versionArg);
|
|
139
|
+
if (hasExplicitVersion) {
|
|
140
|
+
logger.info('\nPlease ensure that the entered Syncfusion version is a Main Release or Service Pack (SP) version. The patch release versions may cause issues during the upgrade process.');
|
|
141
|
+
}
|
|
142
|
+
if (await isScssThemePackageUnsupported(project.root, version)) {
|
|
143
|
+
logger.warning(
|
|
144
|
+
'\n⚠️ SCSS theme not supported in theme package less than 34 version, you can use Component packages for this version SCSS.'
|
|
145
|
+
);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const packageVersion = `~${version}`;
|
|
150
|
+
|
|
151
|
+
const syncfusionPackages = await getSyncfusionPackages(project.root);
|
|
152
|
+
const packageNames = Object.keys(syncfusionPackages);
|
|
153
|
+
|
|
154
|
+
if (!packageNames.length) {
|
|
155
|
+
logger.warning('\n⚠️ No @syncfusion/* packages found in package.json.\n');
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const packagesToUpgrade = getPackagesDifferentFromVersion(syncfusionPackages, packageVersion);
|
|
160
|
+
|
|
161
|
+
if (!packagesToUpgrade.length) {
|
|
162
|
+
logger.success(`✅ Syncfusion packages are already updated with latest version ${packageVersion}.`);
|
|
163
|
+
logger.info('\nPlease specify a Service Pack (SP) or Main Release version to install a different Syncfusion version.');
|
|
164
|
+
logger.info('Example: sf upgrade 33.1.44');
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (!hasExplicitVersion) {
|
|
169
|
+
const shouldUpgradeToLatest = await askYesNo(
|
|
170
|
+
`\nThe latest Syncfusion packages version is ${version}. Do you want to upgrade?`,
|
|
171
|
+
true
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
if (!shouldUpgradeToLatest) {
|
|
175
|
+
logger.warning('\n⚠️ Upgrade cancelled.\n');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
logger.info(`
|
|
181
|
+
🔄 Upgrading ${packagesToUpgrade.length} Syncfusion package(s) to ${packageVersion}:
|
|
182
|
+
`);
|
|
183
|
+
packagesToUpgrade.forEach((name) => logger.info(` • ${name} (${syncfusionPackages[name]} -> ${packageVersion})`));
|
|
184
|
+
|
|
185
|
+
const pkgManager = await detectPackageManager(project.root);
|
|
186
|
+
const { command, args } = getUpgradeCommand(pkgManager, packagesToUpgrade, version);
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
await addPackagesToJson(
|
|
190
|
+
project.root,
|
|
191
|
+
packagesToUpgrade.map((name) => `${name}@${packageVersion}`)
|
|
192
|
+
);
|
|
193
|
+
await updateSyncfusionConfig(project.root, { syncfusionVersion: packageVersion });
|
|
194
|
+
|
|
195
|
+
let shouldReinstall = options.reinstallSyncfusionPackages;
|
|
196
|
+
if (typeof shouldReinstall !== 'boolean') {
|
|
197
|
+
shouldReinstall = await askYesNo(
|
|
198
|
+
'\nDelete node_modules/@syncfusion packages and reinstall updated packages now?',
|
|
199
|
+
true
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (!shouldReinstall) {
|
|
204
|
+
logger.warning('\n⚠️ package.json was updated, but packages were not reinstalled.');
|
|
205
|
+
printManualSteps();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
await removeInstalledSyncfusionPackages(project.root);
|
|
210
|
+
|
|
211
|
+
logger.info(`\n▶ Running: ${command} ${args.join(' ')}\n`);
|
|
212
|
+
await runCommand(command, args, { cwd: project.root });
|
|
213
|
+
|
|
214
|
+
logger.success(`\n✅ Syncfusion packages upgraded successfully to ${packageVersion}!\n`);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
logger.error(`❌ Upgrade failed: ${error.message}`);
|
|
217
|
+
process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
}
|
package/src/constants.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
export const TEMPLATES = {
|
|
2
|
+
EMPTY: 'empty',
|
|
3
|
+
GRID: 'grid',
|
|
4
|
+
CHART: 'chart',
|
|
5
|
+
SCHEDULER: 'scheduler',
|
|
6
|
+
GANTT: 'gantt',
|
|
7
|
+
FILEMANAGER: 'file-manager',
|
|
8
|
+
DIAGRAM: 'diagram',
|
|
9
|
+
RICHTEXTEDITOR: 'rich-text-editor',
|
|
10
|
+
PDFVIEWER: 'pdf-viewer',
|
|
11
|
+
DOCXEDITOR: 'docx-editor',
|
|
12
|
+
SPREADSHEETEDITOR: 'spreadsheet-editor'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const THEMES = {
|
|
16
|
+
'FLUENT2': 'fluent2',
|
|
17
|
+
'BOOTSTRAP5.3': 'bootstrap5.3',
|
|
18
|
+
'TAILWIND3': 'tailwind3',
|
|
19
|
+
'MATERIAL3': 'material3'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const COMPONENT_PACKAGES = {
|
|
23
|
+
grid: {
|
|
24
|
+
react: ['@syncfusion/ej2-react-grids'],
|
|
25
|
+
nextjs: ['@syncfusion/ej2-react-grids'],
|
|
26
|
+
angular: ['@syncfusion/ej2-angular-grids'],
|
|
27
|
+
vue: ['@syncfusion/ej2-vue-grids'],
|
|
28
|
+
typescript: ['@syncfusion/ej2-grids']
|
|
29
|
+
},
|
|
30
|
+
chart: {
|
|
31
|
+
react: ['@syncfusion/ej2-react-charts'],
|
|
32
|
+
nextjs: ['@syncfusion/ej2-react-charts'],
|
|
33
|
+
angular: ['@syncfusion/ej2-angular-charts'],
|
|
34
|
+
vue: ['@syncfusion/ej2-vue-charts'],
|
|
35
|
+
typescript: ['@syncfusion/ej2-charts']
|
|
36
|
+
},
|
|
37
|
+
scheduler: {
|
|
38
|
+
react: ['@syncfusion/ej2-react-schedule'],
|
|
39
|
+
nextjs: ['@syncfusion/ej2-react-schedule'],
|
|
40
|
+
angular: ['@syncfusion/ej2-angular-schedule'],
|
|
41
|
+
vue: ['@syncfusion/ej2-vue-schedule'],
|
|
42
|
+
typescript: ['@syncfusion/ej2-schedule']
|
|
43
|
+
},
|
|
44
|
+
gantt: {
|
|
45
|
+
react: ['@syncfusion/ej2-react-gantt'],
|
|
46
|
+
nextjs: ['@syncfusion/ej2-react-gantt'],
|
|
47
|
+
angular: ['@syncfusion/ej2-angular-gantt'],
|
|
48
|
+
vue: ['@syncfusion/ej2-vue-gantt'],
|
|
49
|
+
typescript: ['@syncfusion/ej2-gantt']
|
|
50
|
+
},
|
|
51
|
+
'file-manager': {
|
|
52
|
+
react: ['@syncfusion/ej2-react-filemanager'],
|
|
53
|
+
nextjs: ['@syncfusion/ej2-react-filemanager'],
|
|
54
|
+
angular: ['@syncfusion/ej2-angular-filemanager'],
|
|
55
|
+
vue: ['@syncfusion/ej2-vue-filemanager'],
|
|
56
|
+
typescript: ['@syncfusion/ej2-filemanager']
|
|
57
|
+
},
|
|
58
|
+
diagram: {
|
|
59
|
+
react: ['@syncfusion/ej2-react-diagrams'],
|
|
60
|
+
nextjs: ['@syncfusion/ej2-react-diagrams'],
|
|
61
|
+
angular: ['@syncfusion/ej2-angular-diagrams'],
|
|
62
|
+
vue: ['@syncfusion/ej2-vue-diagrams'],
|
|
63
|
+
typescript: ['@syncfusion/ej2-diagrams']
|
|
64
|
+
},
|
|
65
|
+
'rich-text-editor': {
|
|
66
|
+
react: ['@syncfusion/ej2-react-richtexteditor'],
|
|
67
|
+
nextjs: ['@syncfusion/ej2-react-richtexteditor'],
|
|
68
|
+
angular: ['@syncfusion/ej2-angular-richtexteditor'],
|
|
69
|
+
vue: ['@syncfusion/ej2-vue-richtexteditor'],
|
|
70
|
+
typescript: ['@syncfusion/ej2-richtexteditor']
|
|
71
|
+
},
|
|
72
|
+
'pdf-viewer': {
|
|
73
|
+
react: ['@syncfusion/ej2-react-pdfviewer'],
|
|
74
|
+
nextjs: ['@syncfusion/ej2-react-pdfviewer'],
|
|
75
|
+
angular: ['@syncfusion/ej2-angular-pdfviewer'],
|
|
76
|
+
vue: ['@syncfusion/ej2-vue-pdfviewer'],
|
|
77
|
+
typescript: ['@syncfusion/ej2-pdfviewer']
|
|
78
|
+
},
|
|
79
|
+
'docx-editor': {
|
|
80
|
+
react: ['@syncfusion/ej2-react-documenteditor'],
|
|
81
|
+
nextjs: ['@syncfusion/ej2-react-documenteditor'],
|
|
82
|
+
angular: ['@syncfusion/ej2-angular-documenteditor'],
|
|
83
|
+
vue: ['@syncfusion/ej2-vue-documenteditor'],
|
|
84
|
+
typescript: ['@syncfusion/ej2-documenteditor']
|
|
85
|
+
},
|
|
86
|
+
'spreadsheet-editor': {
|
|
87
|
+
react: ['@syncfusion/ej2-react-spreadsheet'],
|
|
88
|
+
nextjs: ['@syncfusion/ej2-react-spreadsheet'],
|
|
89
|
+
angular: ['@syncfusion/ej2-angular-spreadsheet'],
|
|
90
|
+
vue: ['@syncfusion/ej2-vue-spreadsheet'],
|
|
91
|
+
typescript: ['@syncfusion/ej2-spreadsheet']
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const TEMPLATE_PACKAGES = {
|
|
96
|
+
empty: {
|
|
97
|
+
react: ['react-router@8.3.0'],
|
|
98
|
+
nextjs: [],
|
|
99
|
+
angular: [],
|
|
100
|
+
vue: ['vue-router@^4.0.0'],
|
|
101
|
+
typescript: ['typescript@^5.0.0', 'vite@^5.0.0']
|
|
102
|
+
},
|
|
103
|
+
grid: COMPONENT_PACKAGES.grid,
|
|
104
|
+
chart: COMPONENT_PACKAGES.chart,
|
|
105
|
+
scheduler: COMPONENT_PACKAGES.scheduler,
|
|
106
|
+
gantt: COMPONENT_PACKAGES.gantt,
|
|
107
|
+
'file-manager': COMPONENT_PACKAGES['file-manager'],
|
|
108
|
+
diagram: COMPONENT_PACKAGES.diagram,
|
|
109
|
+
'rich-text-editor': COMPONENT_PACKAGES['rich-text-editor'],
|
|
110
|
+
'pdf-viewer': COMPONENT_PACKAGES['pdf-viewer'],
|
|
111
|
+
'docx-editor': COMPONENT_PACKAGES['docx-editor'],
|
|
112
|
+
'spreadsheet-editor': COMPONENT_PACKAGES['spreadsheet-editor']
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const TEMPLATE_ROUTES = {
|
|
116
|
+
grid: { label: 'Grid', route: '/grid', file: 'Grid' },
|
|
117
|
+
chart: { label: 'Chart', route: '/chart', file: 'Chart' },
|
|
118
|
+
scheduler: { label: 'Scheduler', route: '/scheduler', file: 'Scheduler' },
|
|
119
|
+
gantt: { label: 'Gantt', route: '/gantt', file: 'Gantt' },
|
|
120
|
+
'file-manager': { label: 'File Manager', route: '/file-manager', file: 'FileManager' },
|
|
121
|
+
diagram: { label: 'Diagram', route: '/diagram', file: 'Diagram' },
|
|
122
|
+
'rich-text-editor': { label: 'Rich Text Editor', route: '/rich-text-editor', file: 'RTE' },
|
|
123
|
+
'pdf-viewer': { label: 'PDF Viewer', route: '/pdf-viewer', file: 'PDFViewer' },
|
|
124
|
+
'docx-editor': { label: 'DOCX Editor', route: '/docx-editor', file: 'DOCXEditor' },
|
|
125
|
+
'spreadsheet-editor': { label: 'Spreadsheet Editor', route: '/spreadsheet-editor', file: 'SpreadsheetEditor' }
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// Components that can be added on-demand to an existing project via `sf add <component>`
|
|
129
|
+
export const ADDABLE_COMPONENTS = ['grid', 'chart', 'scheduler', 'gantt', 'file-manager', 'diagram', 'rich-text-editor', 'pdf-viewer', 'docx-editor', 'spreadsheet-editor'];
|
|
130
|
+
|
|
131
|
+
// -----------------------------------------------------------------------------
|
|
132
|
+
// MCP (Model Context Protocol) server integration
|
|
133
|
+
// -----------------------------------------------------------------------------
|
|
134
|
+
// Per-framework Syncfusion AI-assistant MCP server package.
|
|
135
|
+
export const MCP_ASSISTANT_PACKAGES = {
|
|
136
|
+
react: '@syncfusion/react-mcp',
|
|
137
|
+
angular: '@syncfusion/angular-mcp',
|
|
138
|
+
vue: '@syncfusion/vue-mcp',
|
|
139
|
+
typescript: '@syncfusion/typescript-mcp'
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// Editors supported for MCP configuration generation.
|
|
143
|
+
export const EDITORS = {
|
|
144
|
+
vscode: { label: 'VS Code', configDir: '.vscode', configFile: 'mcp.json', rootKey: 'servers' },
|
|
145
|
+
cursor: { label: 'Cursor', configDir: '.cursor', configFile: 'mcp.json', rootKey: 'mcpServers' },
|
|
146
|
+
codestudio: { label: 'Code Studio', configDir: '.codestudio', configFile: 'mcp.json', rootKey: 'servers' },
|
|
147
|
+
jetbrains: { label: 'JetBrains (AI Assistant)', configDir: null, configFile: null, rootKey: 'mcpServers' }
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// -----------------------------------------------------------------------------
|
|
151
|
+
// Syncfusion component skills (npx skills add ...)
|
|
152
|
+
// -----------------------------------------------------------------------------
|
|
153
|
+
export const SKILLS_PACKAGES = {
|
|
154
|
+
react: 'syncfusion/react-ui-components-skills',
|
|
155
|
+
angular: 'syncfusion/angular-ui-components-skills',
|
|
156
|
+
vue: 'syncfusion/vue-ui-components-skills',
|
|
157
|
+
typescript: 'syncfusion/typescript-ui-components-skills'
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// Valid themes accepted across commands like `syncfusion theme switch`.
|
|
161
|
+
export const VALID_THEMES = ['material3', 'tailwind3', 'bootstrap5.3', 'fluent2'];
|