codeplay-common 1.1.71 → 1.1.73

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.
@@ -288,7 +288,7 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
288
288
 
289
289
  // Run the Node.js script to modify plugin.xml
290
290
  if (isAdmobFound) {
291
- child_process.execSync('node modify-plugin-xml.js', { stdio: 'inherit' });
291
+ child_process.execSync('node buildCodeplay/modify-plugin-xml.js', { stdio: 'inherit' });
292
292
  } else {
293
293
  console.log("\x1b[33m%s\x1b[0m", "Seems to Pro Version [No ads found]");
294
294
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.1.71",
3
+ "version": "1.1.73",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",
@@ -1,28 +1,26 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
3
 
4
- const projectRoot = path.resolve(__dirname, "../../../");;//process.cwd(); // Your project's root
4
+ const projectRoot = path.resolve(__dirname, "../../../"); // Your project's root
5
5
  const commonBuildPath = path.join(__dirname, "../files"); // Path to common files
6
+ const buildCodeplayPath = path.join(commonBuildPath, "buildCodeplay"); // Correct path
6
7
  const packageJsonPath = path.join(projectRoot, "package.json");
7
8
 
8
-
9
9
  // Ensure package.json exists
10
10
  if (!fs.existsSync(packageJsonPath)) {
11
- process.stderr.write("❌ package.json not found!");
11
+ process.stderr.write("❌ package.json not found!\n");
12
12
  process.exit(1);
13
13
  }
14
14
 
15
-
16
15
  function copyFolderSync(source, destination) {
17
16
  try {
18
17
  fs.cpSync(source, destination, { recursive: true });
19
- process.stdout.write(`✅ Copied folder: ${source} -> ${destination}`);
18
+ process.stdout.write(`✅ Copied folder: ${source} -> ${destination}\n`);
20
19
  } catch (error) {
21
- process.stderr.write(`⚠️ Failed to copy folder: ${source} - ${error.message}`);
20
+ process.stderr.write(`⚠️ Failed to copy folder: ${source} - ${error.message}\n`);
22
21
  }
23
22
  }
24
23
 
25
-
26
24
  // Copy all files from `common-build-files/files/` to the project root
27
25
  fs.readdirSync(commonBuildPath).forEach(file => {
28
26
  const sourcePath = path.join(commonBuildPath, file);
@@ -33,31 +31,23 @@ fs.readdirSync(commonBuildPath).forEach(file => {
33
31
  } else {
34
32
  try {
35
33
  fs.copyFileSync(sourcePath, destPath);
36
- process.stdout.write(`✅ Copied file: ${file}`);
37
- }
38
- catch (error) {
39
- process.stderr.write(`⚠️ Failed to copy file: ${file} - ${error.message}`);
34
+ process.stdout.write(`✅ Copied file: ${file}\n`);
35
+ } catch (error) {
36
+ process.stderr.write(`⚠️ Failed to copy file: ${file} - ${error.message}\n`);
40
37
  }
41
38
  }
42
39
  });
43
40
 
44
-
45
-
46
- // Function to get the latest versioned file
41
+ // Function to get the latest versioned file from files/buildCodeplay
47
42
  function getLatestFile(prefix) {
48
- const files = fs.readdirSync(commonBuildPath).filter(file => file.startsWith(prefix));
43
+ if (!fs.existsSync(buildCodeplayPath)) return null; // Ensure directory exists
44
+
45
+ const files = fs.readdirSync(buildCodeplayPath).filter(file => file.startsWith(prefix));
49
46
  if (files.length === 0) return null;
50
47
  files.sort((a, b) => b.localeCompare(a, undefined, { numeric: true }));
51
48
  return files[0];
52
49
  }
53
50
 
54
-
55
-
56
-
57
-
58
-
59
- //const packageJsonPath = path.join(projectRoot, "package.json");
60
-
61
51
  // Detect latest script versions
62
52
  const latestSplashScreen = getLatestFile("add-splash-screen-");
63
53
  const latestSplashAnimation = getLatestFile("setSplashAnimation-");
@@ -85,4 +75,4 @@ packageJson.scripts["build:storeid7"] = "vite build --mode storeid7";
85
75
 
86
76
  // Save changes
87
77
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf8");
88
- process.stdout.write("✅ package.json updated!");
78
+ process.stdout.write("✅ package.json updated!\n");