Skip to content

Commit d3cf36e

Browse files
author
markusvannorlen
committed
fixed dynamic loading logic
1 parent 75a70bb commit d3cf36e

File tree

18 files changed

+8034
-364
lines changed

18 files changed

+8034
-364
lines changed

copy-modules.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import shell from 'shelljs';
2+
import path from 'path';
3+
import chalk from 'chalk';
4+
5+
const CONFIG = {
6+
filesToCopy: [
7+
'modules/controls/wysiwyg/react-quill-editor.es.js',
8+
'modules/controls/wysiwyg/react-quill-editor.css',
9+
'modules/test/ComponentB.es.js',
10+
],
11+
targetDir: path.normalize('dist/assets/modules')
12+
};
13+
14+
function copyFiles() {
15+
try {
16+
shell.mkdir('-p', CONFIG.targetDir);
17+
18+
CONFIG.filesToCopy.forEach(file => {
19+
const sourceFile = path.normalize(file);
20+
const targetFile = path.join(CONFIG.targetDir, path.basename(file));
21+
22+
if (shell.test('-f', sourceFile)) {
23+
shell.cp(sourceFile, targetFile);
24+
console.log(chalk.green(`Copied: ${chalk.bold(sourceFile)}${targetFile}`));
25+
} else {
26+
console.log(chalk.yellow(`Source file not found: ${sourceFile}`));
27+
}
28+
});
29+
30+
console.log(chalk.green('Copy process completed!'));
31+
} catch (err) {
32+
console.log(chalk.red(`Copy process failed: ${err.message}`));
33+
process.exit(1);
34+
}
35+
}
36+
37+
try {
38+
copyFiles();
39+
} catch (err) {
40+
console.log(chalk.red(`Script execution failed: ${err.message}`));
41+
process.exit(1);
42+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {AbstractControls, ControlType, Config, Path} from "../../../dist/lib/controls/AbstractControls";
22

3-
export class ReactSimple extends AbstractControls {
4-
readonly name: string = 'react-simple';
3+
export class ReactQuill extends AbstractControls {
4+
readonly name: string = 'react-quill';
55
readonly type: ControlType = 'wysiwyg';
66
readonly path: Path = {
7-
dev: '/modules/controls/wysiwyg/react-simple-editor.tsx',
8-
production: '/adminizer/assets/modules/react-simple-editor.es.js'
7+
dev: '/modules/controls/wysiwyg/react-quill-editor.tsx',
8+
production: '/adminizer/assets/modules/react-quill-editor.es.js'
99
}
1010
readonly config: Config = {};
1111

modules/controls/wysiwyg/react-quill-editor.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)