codeplay-common 1.0.18 → 1.0.20

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 CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "Common build scripts and files",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "postinstall": "node scripts/sync-files.js"
7
+ "postinstall": "node scripts/sync-files.js",
8
+ "preuninstall": "node scripts/remove-files.js"
8
9
  },
9
10
  "repository": {
10
11
  "type": "git",
@@ -0,0 +1,28 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ const projectRoot = path.resolve(__dirname, "../../../");
5
+ const commonBuildPath = path.join(__dirname, "../files");
6
+
7
+ console.log("🚀 Uninstalling: Removing copied files...");
8
+
9
+ // Remove all copied files and folders
10
+ fs.readdirSync(commonBuildPath).forEach(file => {
11
+ const destPath = path.join(projectRoot, file);
12
+
13
+ if (fs.existsSync(destPath)) {
14
+ try {
15
+ if (fs.statSync(destPath).isDirectory()) {
16
+ fs.rmSync(destPath, { recursive: true, force: true });
17
+ console.log(`🗑️ Removed folder: ${destPath}`);
18
+ } else {
19
+ fs.unlinkSync(destPath);
20
+ console.log(`🗑️ Removed file: ${destPath}`);
21
+ }
22
+ } catch (error) {
23
+ console.warn(`⚠️ Failed to remove ${destPath}: ${error.message}`);
24
+ }
25
+ }
26
+ });
27
+
28
+ console.log("✅ Uninstall cleanup complete!");
@@ -58,6 +58,8 @@ const latestSplashScreen = getLatestFile("add-splash-screen-");
58
58
  const latestSplashAnimation = getLatestFile("setSplashAnimation-");
59
59
  const latestCodeplayBuild = getLatestFile("codeplayBeforeBuild-");
60
60
 
61
+
62
+ /*
61
63
  // Update package.json
62
64
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
63
65
 
@@ -77,3 +79,4 @@ if (latestCodeplayBuild) {
77
79
  // Save changes
78
80
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf8");
79
81
  console.log("✅ package.json updated!");
82
+ */