codeplay-common 1.0.50 → 1.0.52
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/package.json +1 -2
- package/scripts/sync-files.js +6 -12
- package/scripts/uninstall.js +6 -6
package/package.json
CHANGED
package/scripts/sync-files.js
CHANGED
|
@@ -5,16 +5,10 @@ const projectRoot = path.resolve(__dirname, "../../../");;//process.cwd(); // Yo
|
|
|
5
5
|
const commonBuildPath = path.join(__dirname, "../files"); // Path to common files
|
|
6
6
|
const packageJsonPath = path.join(projectRoot, "package.json");
|
|
7
7
|
|
|
8
|
-
console.log("PROJECT ROOT IS ",projectRoot)
|
|
9
|
-
console.log("commonBuildPath IS ",commonBuildPath)
|
|
10
|
-
console.log("PROJECT ROOT IS PACKAGE.JSON",packageJsonPath)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
8
|
|
|
15
9
|
// Ensure package.json exists
|
|
16
10
|
if (!fs.existsSync(packageJsonPath)) {
|
|
17
|
-
|
|
11
|
+
process.stderr.write("❌ package.json not found!");
|
|
18
12
|
process.exit(1);
|
|
19
13
|
}
|
|
20
14
|
|
|
@@ -22,9 +16,9 @@ if (!fs.existsSync(packageJsonPath)) {
|
|
|
22
16
|
function copyFolderSync(source, destination) {
|
|
23
17
|
try {
|
|
24
18
|
fs.cpSync(source, destination, { recursive: true });
|
|
25
|
-
|
|
19
|
+
process.stdout.write(`✅ Copied folder: ${source} -> ${destination}`);
|
|
26
20
|
} catch (error) {
|
|
27
|
-
|
|
21
|
+
process.stderr.write(`⚠️ Failed to copy folder: ${source} - ${error.message}`);
|
|
28
22
|
}
|
|
29
23
|
}
|
|
30
24
|
|
|
@@ -39,10 +33,10 @@ fs.readdirSync(commonBuildPath).forEach(file => {
|
|
|
39
33
|
} else {
|
|
40
34
|
try {
|
|
41
35
|
fs.copyFileSync(sourcePath, destPath);
|
|
42
|
-
|
|
36
|
+
process.stdout.write(`✅ Copied file: ${file}`);
|
|
43
37
|
}
|
|
44
38
|
catch (error) {
|
|
45
|
-
|
|
39
|
+
process.stderr.write(`⚠️ Failed to copy file: ${file} - ${error.message}`);
|
|
46
40
|
}
|
|
47
41
|
}
|
|
48
42
|
});
|
|
@@ -91,4 +85,4 @@ packageJson.scripts["build:storeid7"] = "vite build --mode storeid7";
|
|
|
91
85
|
|
|
92
86
|
// Save changes
|
|
93
87
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf8");
|
|
94
|
-
|
|
88
|
+
process.stdout.write("✅ package.json updated!");
|
package/scripts/uninstall.js
CHANGED
|
@@ -4,7 +4,7 @@ const path = require("path");
|
|
|
4
4
|
const projectRoot = path.resolve(__dirname, "../../../"); // Project root
|
|
5
5
|
const commonBuildPath = path.join(__dirname, "../files"); // Path where files were copied from
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
process.stdout.write("🚀 Uninstalling: Removing old and copied files...");
|
|
8
8
|
|
|
9
9
|
// Helper function to extract version from filename
|
|
10
10
|
const extractVersion = (filename) => {
|
|
@@ -45,9 +45,9 @@ filesInProject1.forEach(file => {
|
|
|
45
45
|
const filePath = path.join(projectRoot, file);
|
|
46
46
|
try {
|
|
47
47
|
fs.unlinkSync(filePath);
|
|
48
|
-
|
|
48
|
+
process.stdout.write(`🗑️ Removed file: ${filePath}`);
|
|
49
49
|
} catch (error) {
|
|
50
|
-
|
|
50
|
+
process.stderr.write(`⚠️ Failed to remove ${filePath}: ${error.message}`);
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -62,12 +62,12 @@ if (fs.existsSync(commonBuildPath)) {
|
|
|
62
62
|
if (fs.existsSync(destPath)) {
|
|
63
63
|
try {
|
|
64
64
|
fs.unlinkSync(destPath);
|
|
65
|
-
|
|
65
|
+
process.stdout.write(`🗑️ Removed file: ${destPath}`);
|
|
66
66
|
} catch (error) {
|
|
67
|
-
|
|
67
|
+
process.stderr.write(`⚠️ Failed to remove ${destPath}: ${error.message}`);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
process.stdout.write("✅ Uninstall cleanup complete!");
|