codeplay-common 4.8.4 → 4.8.6

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/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Merbin Joe
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Merbin Joe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,169 +1,169 @@
1
- # codeplay-common
2
- Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
3
-
4
-
5
- Easy add splashscreen and set animation
6
- Admob id automatically from capacitor.config.json file
7
- Make three build file for different store as per our requirement
8
- Based on store install various IAP plugins
9
- Make it to ionic project
10
-
11
- ## Platform builds and shared validation
12
-
13
- Installing or updating `codeplay-common` updates the consuming project's `package.json`
14
- to use the latest bundled pre-build script and adds these commands:
15
-
16
- - `npm run build`: Android by default, including on macOS.
17
- - `npm run build:ios`: sets `CODEPLAY_BUILD_PLATFORM=ios` and runs the same build pipeline.
18
- - `npm run build-capacitor-android`: runs the shared checks and copies the web build to Android.
19
-
20
- The pre-build script migrates direct `saveToGalleryAndSaveAnyFile` imports to
21
- `@saveGallery` and sets the Vite alias to the matching Android or iOS helper.
22
- Before changing source imports or the alias, it lists the build target, affected files,
23
- and exact replacements. Press Enter or type `y` to continue; any other answer cancels.
24
- Correct imports and alias targets continue without prompting. Missing helpers, mixed
25
- versions and query/hash imports stop with an actionable error.
26
-
27
- Source validation reuses a directory inventory and combines the gallery and editor
28
- checks in one content pass. The inventory refreshes when generated or downloaded
29
- files change the source tree.
30
-
31
- Builds also keep `agent-temp/` ignored and remove existing `buildCodeplay/` ignore entries.
32
- If `onesignal-cordova-plugin` is declared or installed, the pre-build script warns and
33
- runs `npm uninstall onesignal-cordova-plugin`. It stops if removal fails or active
34
- package imports remain. Legacy OneSignal patching and helper downloads are disabled.
35
-
36
- ## Screenshot data
37
-
38
- Shared screenshot helpers are installed into `scripts/screenshot/` and updated with
39
- the package. App-specific data is not bundled with the package.
40
- During an upgrade, cleanup removes only the two legacy helpers `frame-samples.js`
41
- and `background-decorations.js` from `scripts-screenshot/screenshot/`, preserving
42
- the folder, JSON data, and other app files.
43
-
44
- `take-screen-image.js` creates `scripts-screenshot/screenshot/` and empty
45
- `screenshot-copy.json` and `screenshot-info.json` files when needed. Existing files
46
- are preserved during initialization, package installation, and cleanup. Capture
47
- updates screenshot information; the AI text-generation workflow fills screenshot
48
- copy. `--delete` removes matching records, and screenshot runs reconcile records
49
- against the captured images (except dry runs and `--refresh-info`).
50
-
51
- ## Agent instructions
52
-
53
- Agent instructions are updated during `npm run build`, not during npm installation.
54
- The build script reads the `agents` version from
55
- `https://htmlcodeplay.com/code-play-plugin/versions.json` and downloads the matching
56
- `agents-<version>.zip` archive when the project has no agent instructions or the
57
- server version is newer.
58
-
59
- The ZIP root must contain `AGENTS.md` and `AGENTS/`. These are copied directly to
60
- the project root. The installed version is stored in `AGENTS/.codeplay-version`.
61
- Existing files with matching names are replaced; project-only files with other
62
- names inside `AGENTS/` are preserved.
63
-
64
- For example, publish `agents-1.1.zip` and add this entry to the server's
65
- `versions.json`:
66
-
67
- ```json
68
- "agents": "1.1"
69
- ```
70
-
71
- Donate to get full code including many common functions
72
- https://ko-fi.com/codeplay
73
-
74
- Version 4.6.1
75
- Added automatic IAP startup integration for Framework7 home pages.
76
- Updated minimum shared versions to IAP 4.2 and AdMob nextgen 2.5.
77
-
78
- 4.2.8
79
- baseline profile code modifications
80
-
81
- Version 4.2.3
82
- Added build warning confirmation when android.ORIENTATION is not "auto" or android.RESIZEABLE_ACTIVITY is not true.
83
-
84
- Version 4.2.2
85
- Added "bannerDisabledPages" property and its default value
86
- The admob configuration default value priority is updated
87
-
88
- Version 4.2.1
89
- Updated AdMob nextgen file validation to match admob-emi-nextgen file names.
90
-
91
- Version 4.2.0
92
- Firebase related automatic changes updated
93
-
94
- Version 4.1.9
95
- Added AdMob nextgen 1.7 validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
96
-
97
- Version 4.1.8
98
- "consentDebug: false" is added
99
-
100
- Version 4.1.7
101
- admob configuration automatically added.
102
-
103
- Version 4.1.6
104
- "setup-baseline-profile.js" modification, duplicate validation error fixed
105
-
106
- Version 4.1.5
107
- While isTesting is true it is not validated from our new configuration admob file, now it is solved
108
-
109
- Version 4.1.4
110
- hardcoded version is removed for the admob-emi-nextgen
111
-
112
-
113
- Version 4.1.3
114
- "consentDebug": false automatically adds if not
115
-
116
- Version 4.1.2
117
- Speedup
118
-
119
- Version 4.1.1
120
- Auto admob integration updated
121
-
122
-
123
- version 4.0.9
124
- packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
125
-
126
-
127
- version 4.0.8
128
- safearea plugin is checked and removed automatically
129
- Automatically added following in capacitor.config.json file
130
- "SystemBars": {
131
- "insetsHandling": "css"
132
- }
133
- patchFile() method is removed
134
-
135
-
136
-
137
-
138
- Version 4.0.6
139
- IAP related some automatic variable creation and validation
140
- Fetch from vite.config.json file
141
- 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
142
- 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
143
- 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
144
- 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
145
-
146
-
147
- Version 4.0.5
148
- In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
149
-
150
-
151
- Version 4.0.4
152
- patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
153
-
154
- Version 4.0.3
155
- Old admob check performs through plugin location, but not it is validated from capacitor.config.json
156
-
157
-
158
- Version: 4.0.2
159
- After check & install/download the latest version, the re-check is cancelled now
160
-
161
- Version: 4.0.1
162
- Base profile script added
163
-
164
-
165
- "version": "",
166
- Version : 4.0.0 (Previous version 3.2.19)
167
- 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
168
- 2) Removed "modify-plugin-xml.js"
169
- 3)
1
+ # codeplay-common
2
+ Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
3
+
4
+
5
+ Easy add splashscreen and set animation
6
+ Admob id automatically from capacitor.config.json file
7
+ Make three build file for different store as per our requirement
8
+ Based on store install various IAP plugins
9
+ Make it to ionic project
10
+
11
+ ## Platform builds and shared validation
12
+
13
+ Installing or updating `codeplay-common` updates the consuming project's `package.json`
14
+ to use the latest bundled pre-build script and adds these commands:
15
+
16
+ - `npm run build`: Android by default, including on macOS.
17
+ - `npm run build:ios`: sets `CODEPLAY_BUILD_PLATFORM=ios` and runs the same build pipeline.
18
+ - `npm run build-capacitor-android`: runs the shared checks and copies the web build to Android.
19
+
20
+ The pre-build script migrates direct `saveToGalleryAndSaveAnyFile` imports to
21
+ `@saveGallery` and sets the Vite alias to the matching Android or iOS helper.
22
+ Before changing source imports or the alias, it lists the build target, affected files,
23
+ and exact replacements. Press Enter or type `y` to continue; any other answer cancels.
24
+ Correct imports and alias targets continue without prompting. Missing helpers, mixed
25
+ versions and query/hash imports stop with an actionable error.
26
+
27
+ Source validation reuses a directory inventory and combines the gallery and editor
28
+ checks in one content pass. The inventory refreshes when generated or downloaded
29
+ files change the source tree.
30
+
31
+ Builds also keep `agent-temp/` ignored and remove existing `buildCodeplay/` ignore entries.
32
+ If `onesignal-cordova-plugin` is declared or installed, the pre-build script warns and
33
+ runs `npm uninstall onesignal-cordova-plugin`. It stops if removal fails or active
34
+ package imports remain. Legacy OneSignal patching and helper downloads are disabled.
35
+
36
+ ## Screenshot data
37
+
38
+ Shared screenshot helpers are installed into `scripts/screenshot/` and updated with
39
+ the package. App-specific data is not bundled with the package.
40
+ During an upgrade, cleanup removes only the two legacy helpers `frame-samples.js`
41
+ and `background-decorations.js` from `scripts-screenshot/screenshot/`, preserving
42
+ the folder, JSON data, and other app files.
43
+
44
+ `take-screen-image.js` creates `scripts-screenshot/screenshot/` and empty
45
+ `screenshot-copy.json` and `screenshot-info.json` files when needed. Existing files
46
+ are preserved during initialization, package installation, and cleanup. Capture
47
+ updates screenshot information; the AI text-generation workflow fills screenshot
48
+ copy. `--delete` removes matching records, and screenshot runs reconcile records
49
+ against the captured images (except dry runs and `--refresh-info`).
50
+
51
+ ## Agent instructions
52
+
53
+ Agent instructions are updated during `npm run build`, not during npm installation.
54
+ The build script reads the `agents` version from
55
+ `https://htmlcodeplay.com/code-play-plugin/versions.json` and downloads the matching
56
+ `agents-<version>.zip` archive when the project has no agent instructions or the
57
+ server version is newer.
58
+
59
+ The ZIP root must contain `AGENTS.md` and `AGENTS/`. These are copied directly to
60
+ the project root. The installed version is stored in `AGENTS/.codeplay-version`.
61
+ Existing files with matching names are replaced; project-only files with other
62
+ names inside `AGENTS/` are preserved.
63
+
64
+ For example, publish `agents-1.1.zip` and add this entry to the server's
65
+ `versions.json`:
66
+
67
+ ```json
68
+ "agents": "1.1"
69
+ ```
70
+
71
+ Donate to get full code including many common functions
72
+ https://ko-fi.com/codeplay
73
+
74
+ Version 4.6.1
75
+ Added automatic IAP startup integration for Framework7 home pages.
76
+ Updated minimum shared versions to IAP 4.2 and AdMob nextgen 2.5.
77
+
78
+ 4.2.8
79
+ baseline profile code modifications
80
+
81
+ Version 4.2.3
82
+ Added build warning confirmation when android.ORIENTATION is not "auto" or android.RESIZEABLE_ACTIVITY is not true.
83
+
84
+ Version 4.2.2
85
+ Added "bannerDisabledPages" property and its default value
86
+ The admob configuration default value priority is updated
87
+
88
+ Version 4.2.1
89
+ Updated AdMob nextgen file validation to match admob-emi-nextgen file names.
90
+
91
+ Version 4.2.0
92
+ Firebase related automatic changes updated
93
+
94
+ Version 4.1.9
95
+ Added AdMob nextgen 1.7 validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
96
+
97
+ Version 4.1.8
98
+ "consentDebug: false" is added
99
+
100
+ Version 4.1.7
101
+ admob configuration automatically added.
102
+
103
+ Version 4.1.6
104
+ "setup-baseline-profile.js" modification, duplicate validation error fixed
105
+
106
+ Version 4.1.5
107
+ While isTesting is true it is not validated from our new configuration admob file, now it is solved
108
+
109
+ Version 4.1.4
110
+ hardcoded version is removed for the admob-emi-nextgen
111
+
112
+
113
+ Version 4.1.3
114
+ "consentDebug": false automatically adds if not
115
+
116
+ Version 4.1.2
117
+ Speedup
118
+
119
+ Version 4.1.1
120
+ Auto admob integration updated
121
+
122
+
123
+ version 4.0.9
124
+ packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
125
+
126
+
127
+ version 4.0.8
128
+ safearea plugin is checked and removed automatically
129
+ Automatically added following in capacitor.config.json file
130
+ "SystemBars": {
131
+ "insetsHandling": "css"
132
+ }
133
+ patchFile() method is removed
134
+
135
+
136
+
137
+
138
+ Version 4.0.6
139
+ IAP related some automatic variable creation and validation
140
+ Fetch from vite.config.json file
141
+ 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
142
+ 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
143
+ 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
144
+ 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
145
+
146
+
147
+ Version 4.0.5
148
+ In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
149
+
150
+
151
+ Version 4.0.4
152
+ patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
153
+
154
+ Version 4.0.3
155
+ Old admob check performs through plugin location, but not it is validated from capacitor.config.json
156
+
157
+
158
+ Version: 4.0.2
159
+ After check & install/download the latest version, the re-check is cancelled now
160
+
161
+ Version: 4.0.1
162
+ Base profile script added
163
+
164
+
165
+ "version": "",
166
+ Version : 4.0.0 (Previous version 3.2.19)
167
+ 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
168
+ 2) Removed "modify-plugin-xml.js"
169
+ 3)
@@ -2956,7 +2956,8 @@ const CODEPLAY_SYSTEM_BARS_PLUGIN = "capacitor-codeplay-system-bars";
2956
2956
  function ensureMandatoryCapacitorPlugins() {
2957
2957
  const requiredPackages = [
2958
2958
  "@capacitor/device",
2959
- "@capacitor-community/in-app-review"
2959
+ "@capacitor-community/in-app-review",
2960
+ "@capawesome/capacitor-app-update"
2960
2961
  ];
2961
2962
 
2962
2963
  for (const packageName of requiredPackages) {
@@ -1,4 +1,4 @@
1
- {
2
- "url": "https://htmlcodeplay.com/codeplay/api/v1/release/sync",
3
- "token": "b_TiY0Lu7q7Yb0Kx9djVxA6ST8k4CFiwFQNxgci7AAU"
4
- }
1
+ {
2
+ "url": "https://htmlcodeplay.com/codeplay/api/v1/release/sync",
3
+ "token": "b_TiY0Lu7q7Yb0Kx9djVxA6ST8k4CFiwFQNxgci7AAU"
4
+ }
@@ -7,7 +7,7 @@ node finalrelease "1,2,7"
7
7
 
8
8
  import { existsSync, readFileSync, readdirSync, promises, constants, writeFileSync, unlinkSync, mkdirSync, renameSync } from 'fs';
9
9
  import { join, resolve } from 'path';
10
- import { execSync, execFileSync } from 'child_process';
10
+ import { execSync, execFileSync } from 'child_process';
11
11
  import { createInterface } from 'readline';
12
12
 
13
13
  import { fileURLToPath } from 'url';
@@ -179,49 +179,49 @@ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
179
179
 
180
180
  const _appUniqueId = config.android?.APP_UNIQUE_ID;
181
181
  const _appName=config.appName;
182
- const _appPackageId=config.appId;
183
-
184
- const releaseSyncConfigPath = join(__dirname, 'buildCodeplay', 'release-sync.config.json');
185
- let releaseSyncConfig = {};
186
- if (existsSync(releaseSyncConfigPath)) {
187
- try {
188
- releaseSyncConfig = JSON.parse(readFileSync(releaseSyncConfigPath, 'utf8'));
189
- } catch (error) {
190
- console.warn(`⚠️ Could not read ${releaseSyncConfigPath}: ${error.message}`);
191
- }
192
- }
193
- const RELEASE_SYNC_URL = process.env.CODEPLAY_RELEASE_SYNC_URL || releaseSyncConfig.url || 'https://htmlcodeplay.com/codeplay/api/v1/release/sync';
194
- const RELEASE_SYNC_TOKEN = process.env.CODEPLAY_RELEASE_SYNC_TOKEN || releaseSyncConfig.token || '';
195
- const RELEASE_PLATFORM_IDS = { PlayStore: 1, SamsungStore: 13, AmazonStore: 17, MiStore: 15, HuaweiStore: 12, OppoStore: 14, VivoStore: 16 };
196
-
197
- function syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, releasedDate) {
198
- if (!RELEASE_SYNC_TOKEN) {
199
- console.warn(`⚠️ Codeplay release sync skipped: add a token to ${releaseSyncConfigPath}.`);
200
- return;
201
- }
202
- const payload = JSON.stringify({
203
- app_name: _appName,
204
- package_id: _appPackageId,
205
- version_name: String(finalVersionName),
206
- version_code: String(finalVersionCode),
207
- released_date: releasedDate,
208
- language_id: 0,
209
- language_name: 'Capacitor+ Framework 7',
210
- notes: 'Automated release update',
211
- status: 1,
212
- folder_name: path.basename(process.cwd()),
213
- app_unique_id: String(_appUniqueId || ''),
214
- platform_id: RELEASE_PLATFORM_IDS[storeName],
215
- });
216
- try {
217
- const response = execFileSync('curl.exe', ['-sS', '--fail-with-body', '-X', 'POST', RELEASE_SYNC_URL,
218
- '-H', 'Content-Type: application/json', '-H', `X-Release-Token: ${RELEASE_SYNC_TOKEN}`, '--data-binary', payload],
219
- { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
220
- console.log(`✅ Codeplay sync (${storeName}): ${response.trim()}`);
221
- } catch (error) {
222
- console.warn(`⚠️ Codeplay sync failed for ${storeName}; continuing release builds: ${error.message}`);
223
- }
224
- }
182
+ const _appPackageId=config.appId;
183
+
184
+ const releaseSyncConfigPath = join(__dirname, 'buildCodeplay', 'release-sync.config.json');
185
+ let releaseSyncConfig = {};
186
+ if (existsSync(releaseSyncConfigPath)) {
187
+ try {
188
+ releaseSyncConfig = JSON.parse(readFileSync(releaseSyncConfigPath, 'utf8'));
189
+ } catch (error) {
190
+ console.warn(`⚠️ Could not read ${releaseSyncConfigPath}: ${error.message}`);
191
+ }
192
+ }
193
+ const RELEASE_SYNC_URL = process.env.CODEPLAY_RELEASE_SYNC_URL || releaseSyncConfig.url || 'https://htmlcodeplay.com/codeplay/api/v1/release/sync';
194
+ const RELEASE_SYNC_TOKEN = process.env.CODEPLAY_RELEASE_SYNC_TOKEN || releaseSyncConfig.token || '';
195
+ const RELEASE_PLATFORM_IDS = { PlayStore: 1, SamsungStore: 13, AmazonStore: 17, MiStore: 15, HuaweiStore: 12, OppoStore: 14, VivoStore: 16 };
196
+
197
+ function syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, releasedDate) {
198
+ if (!RELEASE_SYNC_TOKEN) {
199
+ console.warn(`⚠️ Codeplay release sync skipped: add a token to ${releaseSyncConfigPath}.`);
200
+ return;
201
+ }
202
+ const payload = JSON.stringify({
203
+ app_name: _appName,
204
+ package_id: _appPackageId,
205
+ version_name: String(finalVersionName),
206
+ version_code: String(finalVersionCode),
207
+ released_date: releasedDate,
208
+ language_id: 0,
209
+ language_name: 'Capacitor+ Framework 7',
210
+ notes: 'Automated release update',
211
+ status: 1,
212
+ folder_name: path.basename(process.cwd()),
213
+ app_unique_id: String(_appUniqueId || ''),
214
+ platform_id: RELEASE_PLATFORM_IDS[storeName],
215
+ });
216
+ try {
217
+ const response = execFileSync('curl.exe', ['-sS', '--fail-with-body', '-X', 'POST', RELEASE_SYNC_URL,
218
+ '-H', 'Content-Type: application/json', '-H', `X-Release-Token: ${RELEASE_SYNC_TOKEN}`, '--data-binary', payload],
219
+ { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
220
+ console.log(`✅ Codeplay sync (${storeName}): ${response.trim()}`);
221
+ } catch (error) {
222
+ console.warn(`⚠️ Codeplay sync failed for ${storeName}; continuing release builds: ${error.message}`);
223
+ }
224
+ }
225
225
 
226
226
  const FLOWCHART_API_APP_ID = 228;
227
227
  const FLOWCHART_SHARED_PATH = join('public', 'src', 'shared.js');
@@ -1036,11 +1036,11 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
1036
1036
  const checkFullPath = join("AAB", newFileName.replace(/\.aab$/, `.${newExt}`));
1037
1037
 
1038
1038
  // Rename the output file
1039
- if (existsSync(oldFilePath)) {
1040
- renameSync(oldFilePath, checkFullPath);
1041
- console.log(`✅ Renamed output ${newExt.toUpperCase()} file to: ${path.basename(checkFullPath)}`);
1042
- syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, new Date().toISOString().slice(0, 10));
1043
- } else {
1039
+ if (existsSync(oldFilePath)) {
1040
+ renameSync(oldFilePath, checkFullPath);
1041
+ console.log(`✅ Renamed output ${newExt.toUpperCase()} file to: ${path.basename(checkFullPath)}`);
1042
+ syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, new Date().toISOString().slice(0, 10));
1043
+ } else {
1044
1044
  console.error(`❌ ${newExt.toUpperCase()} file not found after build.`);
1045
1045
  }
1046
1046
 
@@ -86,8 +86,8 @@ const analysisFrameDirectory = path.join(temporaryDirectory, 'ai-analysis');
86
86
  const endCardBannerPath = path.join(outputVideoDirectory, `${appFilePrefix}-ai-end-card-banner.png`);
87
87
  const promoCopySchemaPath = path.join(temporaryDirectory, 'promo-copy-schema.json');
88
88
  const promoCopyResultPath = path.join(temporaryDirectory, 'promo-copy-result.json');
89
- const ffmpegFallbackDirectory = String(process.env.FFMPEG_BIN || '').trim()
90
- || path.join(projectDirectory, 'tools', 'ffmpeg');
89
+ const ffmpegFallbackDirectory = String(process.env.FFMPEG_BIN || '').trim()
90
+ || path.join(projectDirectory, 'tools', 'ffmpeg');
91
91
  const minimumSceneCount = 7;
92
92
  const minimumSourceDuration = 12;
93
93
  let expectedDuration = 34;
@@ -209,15 +209,15 @@ async function ensureEndCardBanner() {
209
209
  + '- Keep all logos and badge text sharp, correctly proportioned, and completely visible.\n'
210
210
  + '- Match the background colors and visual style to the actual app icon.\n'
211
211
  + '- Create a polished, professional background related to the app’s purpose.\n'
212
- + '- Keep the background subtle so it does not compete with the icon, title, feature text, or download badges.\n'
212
+ + '- Keep the background subtle so it does not compete with the icon, title, feature text, or download badges.\n'
213
213
  + '- Use a balanced landscape composition:\n'
214
214
  + ' - Large actual app icon on the left.\n'
215
215
  + ' - App Store badge followed by Google Play badge on the right.\n'
216
216
  + ' - Maintain comfortable margins and clear space around every element.\n'
217
- + '- Add the application title prominently.\n'
218
- + '- Add concise promotional text describing the application’s actual features, presenting each feature one by one.\n'
219
- + '- Keep the title and feature text sharp, readable, accurate, and visually balanced with the icon and download badges.\n'
220
- + '- Do not invent unsupported features or add unrelated marketing text.\n'
217
+ + '- Add the application title prominently.\n'
218
+ + '- Add concise promotional text describing the application’s actual features, presenting each feature one by one.\n'
219
+ + '- Keep the title and feature text sharp, readable, accurate, and visually balanced with the icon and download badges.\n'
220
+ + '- Do not invent unsupported features or add unrelated marketing text.\n'
221
221
  + '- Do not add watermarks, fake UI, generated symbols, or unrelated decorations.\n'
222
222
  + '- Rounded corners and a subtle shadow may be applied around the app icon, but its internal artwork must remain unchanged.\n'
223
223
  + '- Use image generation only for the background.\n'
@@ -467,12 +467,12 @@ function commandExists(command) {
467
467
  return !result.error && result.status === 0;
468
468
  }
469
469
 
470
- function getExecutable(command) {
471
- const executableName = process.platform === 'win32' ? `${command}.exe` : command;
472
- const fallbackPath = path.join(ffmpegFallbackDirectory, executableName);
473
- if (fs.existsSync(fallbackPath)) return fallbackPath;
474
- return commandExists(command) ? command : '';
475
- }
470
+ function getExecutable(command) {
471
+ const executableName = process.platform === 'win32' ? `${command}.exe` : command;
472
+ const fallbackPath = path.join(ffmpegFallbackDirectory, executableName);
473
+ if (fs.existsSync(fallbackPath)) return fallbackPath;
474
+ return commandExists(command) ? command : '';
475
+ }
476
476
 
477
477
  function detectRedundantStaticRanges(ffmpegCommand, inputPath, sourceDuration) {
478
478
  const minimumStaticDuration = Math.max(2, Math.min(4, sourceDuration / 60));
@@ -640,7 +640,7 @@ function resolvePromoLayout(requestedLayout) {
640
640
  }
641
641
 
642
642
  function getPythonExecutable() {
643
- for (const candidate of ['py', 'python', 'python3']) {
643
+ for (const candidate of ['py', 'python', 'python3']) {
644
644
  const result = spawnSync(candidate, ['-m', 'edge_tts', '--version'], {
645
645
  encoding: 'utf8',
646
646
  windowsHide: true,
@@ -915,7 +915,7 @@ Rules:
915
915
  - footer_keywords must contain exactly 3 distinct, natural app-search phrases, each 2-24 characters.
916
916
  - Generate a YouTube upload title and description from the same verified features.
917
917
  - YouTube title: 40-100 characters, include ${JSON.stringify(appName)} and one strong natural search phrase, without clickbait.
918
- - YouTube description: 350-1500 characters with readable paragraphs. Put the clearest app summary and primary search phrase in the opening two lines, explain the demonstrated features, add a simple call to action, then insert a newline and finish with exactly 3 relevant hashtags on that separate final line. The hashtags must not be appended to the preceding paragraph.
918
+ - YouTube description: 350-1500 characters with readable paragraphs. Put the clearest app summary and primary search phrase in the opening two lines, explain the demonstrated features, add a simple call to action, then insert a newline and finish with exactly 3 relevant hashtags on that separate final line. The hashtags must not be appended to the preceding paragraph.
919
919
  - Do not add download links or URLs; the script will append the verified Google Play URL built from the configured package ID. Do not add chapter timestamps or unsupported availability claims.
920
920
  - Keep YouTube text natural and useful; do not repeat keywords unnaturally.
921
921
  - Avoid prices, ratings, awards, competitor names, unsupported superlatives, and words such as best, guaranteed, or free.
@@ -1025,14 +1025,14 @@ function validatePromoCopy(value) {
1025
1025
  throw new Error(`The final scene must mention the app name ${JSON.stringify(appName)}.`);
1026
1026
  }
1027
1027
 
1028
- const youtubeTitle = cleanGeneratedString(value.youtube.title);
1029
- let youtubeDescription = cleanGeneratedDescription(value.youtube.description);
1030
- const trailingHashtagGroup = youtubeDescription.match(
1031
- /(?:^|\s)(#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+)\s*$/u,
1032
- );
1033
- if (trailingHashtagGroup) {
1034
- youtubeDescription = `${youtubeDescription.slice(0, trailingHashtagGroup.index).trimEnd()}\n${trailingHashtagGroup[1]}`;
1035
- }
1028
+ const youtubeTitle = cleanGeneratedString(value.youtube.title);
1029
+ let youtubeDescription = cleanGeneratedDescription(value.youtube.description);
1030
+ const trailingHashtagGroup = youtubeDescription.match(
1031
+ /(?:^|\s)(#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+)\s*$/u,
1032
+ );
1033
+ if (trailingHashtagGroup) {
1034
+ youtubeDescription = `${youtubeDescription.slice(0, trailingHashtagGroup.index).trimEnd()}\n${trailingHashtagGroup[1]}`;
1035
+ }
1036
1036
  if (youtubeTitle.length < 40 || youtubeTitle.length > 100) {
1037
1037
  throw new Error('YouTube title must be 40-100 characters.');
1038
1038
  }