esoftplay 0.0.128-b → 0.0.128-d
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/bin/router.js +28 -22
- package/modules/lib/effect.tsx +2 -1
- package/package.json +1 -1
package/bin/router.js
CHANGED
|
@@ -535,19 +535,22 @@ declare module "esoftplay" {
|
|
|
535
535
|
const [module, task] = clsName.split(/(?=[A-Z])/)
|
|
536
536
|
const nav = module?.toLowerCase() + '/' + task?.toLowerCase()
|
|
537
537
|
|
|
538
|
-
if (
|
|
539
|
-
|
|
538
|
+
if (!nav.includes('.')) {
|
|
539
|
+
|
|
540
|
+
if (module && !fs.existsSync(tmpDir + module?.toLowerCase()))
|
|
541
|
+
fs.mkdirSync(tmpDir + module.toLowerCase());
|
|
540
542
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
+
if (!fs.existsSync(tmpDir + nav))
|
|
544
|
+
fs.mkdirSync(tmpDir + nav)
|
|
543
545
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
546
|
+
PreText += "import '" + tmpDir + nav + "/import.d';\n"
|
|
547
|
+
if (isChange(tmpDir + nav + '/import.d.ts', ItemText)) {
|
|
548
|
+
fs.writeFile(tmpDir + nav + '/import.d.ts', ItemText, { flag: 'w' }, function (err) {
|
|
549
|
+
if (err) {
|
|
550
|
+
return console.log(err);
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
}
|
|
551
554
|
}
|
|
552
555
|
}
|
|
553
556
|
Text += "\n\ttype LibNavigationRoutes = \"" + Navigations.join("\" |\n\t\t\t \"") + "\"\n"
|
|
@@ -638,7 +641,7 @@ function createRouter() {
|
|
|
638
641
|
"import React from 'react'\n" +
|
|
639
642
|
"const _" + ucword(module) + ucword(task) + " = React.lazy(() => import('../../../../." + Modules[module][task] + "')); \n" +
|
|
640
643
|
"import * as " + ucword(module) + ucword(task) + SuffixHooksProperty + " from '../../../../." + Modules[module][task] + "';\n" +
|
|
641
|
-
"const UpdatedComponent = (OriginalComponent) => { function "+ucword(module) + ucword(task)+"Component(props) { return ( <React.Suspense><OriginalComponent {...props} /></React.Suspense> ) } return "+ucword(module) + ucword(task)+"Component; };\n" +
|
|
644
|
+
"const UpdatedComponent = (OriginalComponent) => { function " + ucword(module) + ucword(task) + "Component(props) { return ( <React.Suspense><OriginalComponent {...props} /></React.Suspense> ) } return " + ucword(module) + ucword(task) + "Component; };\n" +
|
|
642
645
|
"const " + ucword(module) + ucword(task) + " = stable(UpdatedComponent(_" + ucword(module) + ucword(task) + ")); \n" +
|
|
643
646
|
"export { " + ucword(module) + ucword(task) + SuffixHooksProperty + ", " + ucword(module) + ucword(task) + " };\n"
|
|
644
647
|
} else if (UseLibs.includes(nav)) {
|
|
@@ -652,18 +655,21 @@ function createRouter() {
|
|
|
652
655
|
item += "export { _" + ucword(module) + ucword(task) + " as " + ucword(module) + ucword(task) + " };\n"
|
|
653
656
|
}
|
|
654
657
|
|
|
655
|
-
if (!
|
|
656
|
-
|
|
658
|
+
if (!nav.includes('.')) {
|
|
659
|
+
console.log(nav)
|
|
660
|
+
if (!fs.existsSync(tmpDir + module))
|
|
661
|
+
fs.mkdirSync(tmpDir + module);
|
|
657
662
|
|
|
658
|
-
|
|
659
|
-
|
|
663
|
+
if (!fs.existsSync(tmpDir + nav))
|
|
664
|
+
fs.mkdirSync(tmpDir + nav)
|
|
660
665
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
666
|
+
if (isChange(tmpDir + nav + "/import." + fileExt, item)) {
|
|
667
|
+
fs.writeFile(tmpDir + nav + '/import.' + fileExt, item, { flag: 'w' }, function (err) {
|
|
668
|
+
if (err) {
|
|
669
|
+
return console.log(err);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}
|
|
667
673
|
}
|
|
668
674
|
|
|
669
675
|
// if (module == 'lib' && task == 'component') {
|
package/modules/lib/effect.tsx
CHANGED