codeplay-common 1.0.36 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",
@@ -58,6 +58,10 @@ function getLatestFile(prefix) {
58
58
  }
59
59
 
60
60
 
61
+
62
+
63
+
64
+
61
65
  //const packageJsonPath = path.join(projectRoot, "package.json");
62
66
 
63
67
  // Detect latest script versions
@@ -65,28 +69,26 @@ const latestSplashScreen = getLatestFile("add-splash-screen-");
65
69
  const latestSplashAnimation = getLatestFile("setSplashAnimation-");
66
70
  const latestCodeplayBuild = getLatestFile("codeplayBeforeBuild-");
67
71
 
68
- console.log("TTTTTTTTTTTTTTTTTT",latestSplashScreen)
69
- console.log("AAAAAAAAA",latestSplashAnimation)
70
- console.log("BBBBBBBBB",latestCodeplayBuild)
71
-
72
-
73
72
  // Update package.json
74
73
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
75
74
 
76
- if (latestSplashScreen) {
77
- packageJson.scripts["capacitor:sync:after"] = packageJson.scripts["capacitor:sync:after"]
78
- .replace(/add-splash-screen-\d+\.\d+\.js/, latestSplashScreen);
79
- }
80
- if (latestSplashAnimation) {
81
- packageJson.scripts["capacitor:sync:after"] = packageJson.scripts["capacitor:sync:after"]
82
- .replace(/setSplashAnimation-\d+\.\d+\.js/, latestSplashAnimation);
83
- }
75
+ // Ensure scripts object exists
76
+ packageJson.scripts = packageJson.scripts || {};
77
+
78
+ // Update or add necessary scripts
84
79
  if (latestCodeplayBuild) {
85
- packageJson.scripts["build"] = packageJson.scripts["build"]
86
- .replace(/codeplayBeforeBuild-\d+\.\d+\.js/, latestCodeplayBuild);
80
+ packageJson.scripts["build"] = `node ${latestCodeplayBuild} && cross-env NODE_ENV=production vite build`;
87
81
  }
82
+ if (latestSplashScreen && latestSplashAnimation) {
83
+ packageJson.scripts["capacitor:sync:after"] = `node ${latestSplashScreen} && node ${latestSplashAnimation}`;
84
+ }
85
+
86
+ packageJson.scripts["ionic:build"] = "npm run build";
87
+ packageJson.scripts["ionic:serve"] = "npm run start";
88
+ packageJson.scripts["build:storeid1"] = "vite build --mode storeid1";
89
+ packageJson.scripts["build:storeid2"] = "vite build --mode storeid2";
90
+ packageJson.scripts["build:storeid7"] = "vite build --mode storeid7";
88
91
 
89
92
  // Save changes
90
93
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf8");
91
- console.log("✅ package.json updated!");
92
-
94
+ console.log("✅ package.json updated!");