@common-stack/rollup-vite-utils 4.0.1-alpha.36 → 4.0.1-alpha.38
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import*as fs from'fs';import*as path from'path';import {sha256}from'js-sha256';
|
|
1
|
+
import*as fs from'fs';import*as path from'path';import {sha256}from'js-sha256';const DIALOG_PATH = 'app/dialog';
|
|
2
|
+
function wrapComponent(currentFilePath) {
|
|
2
3
|
const imports = `import DialogComponent from '${currentFilePath}'`;
|
|
3
4
|
const componentLogic = `
|
|
4
5
|
export default function Component() {
|
|
@@ -11,7 +12,7 @@ function dialogWrapperUtility(file, options) {
|
|
|
11
12
|
const basePath = path.join(rootPath, 'node-modules');
|
|
12
13
|
let fileName = path.basename(file, '.js');
|
|
13
14
|
fileName = `Wrapped${fileName}-${sha256(file).slice(0, 8)}.tsx`;
|
|
14
|
-
const dialogComponentDirectory =
|
|
15
|
+
const dialogComponentDirectory = DIALOG_PATH;
|
|
15
16
|
if (!fs.existsSync(dialogComponentDirectory)) {
|
|
16
17
|
fs.mkdirSync(dialogComponentDirectory, { recursive: false });
|
|
17
18
|
}
|
|
@@ -25,7 +26,7 @@ function writeDialogsSwitch(paths) {
|
|
|
25
26
|
function __variableDynamicDialog(path) {
|
|
26
27
|
switch (path) {
|
|
27
28
|
`;
|
|
28
|
-
paths.forEach(path => {
|
|
29
|
+
paths.forEach((path) => {
|
|
29
30
|
content += `
|
|
30
31
|
case '${path}':
|
|
31
32
|
return import('${path}');
|
|
@@ -43,8 +44,12 @@ function writeDialogsSwitch(paths) {
|
|
|
43
44
|
const rootPath = process.cwd();
|
|
44
45
|
const basePath = path.join(rootPath, 'node-modules');
|
|
45
46
|
const fileName = `WrappedDialogsSwitch.js`;
|
|
46
|
-
const dialogComponentDirectory =
|
|
47
|
+
const dialogComponentDirectory = DIALOG_PATH;
|
|
47
48
|
const newFilePath = path.join(rootPath, dialogComponentDirectory, fileName);
|
|
49
|
+
// Ensure the directory exists
|
|
50
|
+
if (!fs.existsSync(path.dirname(newFilePath))) {
|
|
51
|
+
fs.mkdirSync(path.dirname(newFilePath), { recursive: true });
|
|
52
|
+
}
|
|
48
53
|
fs.writeFileSync(newFilePath, content, 'utf8');
|
|
49
54
|
return path.relative(basePath, newFilePath);
|
|
50
55
|
}export{dialogWrapperUtility,writeDialogsSwitch};//# sourceMappingURL=dialog-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-wrapper.js","sources":["../../src/vite-wrappers/dialog-wrapper.ts"],"sourcesContent":[null],"names":[],"mappings":"+
|
|
1
|
+
{"version":3,"file":"dialog-wrapper.js","sources":["../../src/vite-wrappers/dialog-wrapper.ts"],"sourcesContent":[null],"names":[],"mappings":"+EAKA,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,SAAS,aAAa,CAAC,eAAuB,EAAA;AAC1C,IAAA,MAAM,OAAO,GAAG,CAAgC,6BAAA,EAAA,eAAe,GAAG,CAAC;AACnE,IAAA,MAAM,cAAc,GAAG,CAAA;;;WAGhB,CAAC;IAER,OAAO,OAAO,GAAG,cAAc,CAAC;AACpC,CAAC;AAEe,SAAA,oBAAoB,CAChC,IAAY,EACZ,OAEC,EAAA;AAED,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACrD,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1C,IAAA,QAAQ,GAAG,CAAU,OAAA,EAAA,QAAQ,CAAI,CAAA,EAAA,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;IAChE,MAAM,wBAAwB,GAAG,WAAW,CAAC;IAC7C,IAAI,C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AC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KAChE;IAED,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/rollup-vite-utils",
|
|
3
|
-
"version": "4.0.1-alpha.
|
|
3
|
+
"version": "4.0.1-alpha.38",
|
|
4
4
|
"description": "Client Module for react app",
|
|
5
5
|
"homepage": "https://github.com/cdmbase/fullstack-pro#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"typescript": {
|
|
55
55
|
"definition": "lib/index.d.ts"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "2c39f894fd54bb42ccdc5b391cf4c32d74bb21d8"
|
|
58
58
|
}
|