codeplay-common 4.11.6 → 4.11.8

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +99 -96
  2. package/LICENSE +21 -21
  3. package/README.md +229 -229
  4. package/RELEASE_NOTES.md +20 -17
  5. package/files/buildCodeplay/add-splash-screen.js +255 -255
  6. package/files/buildCodeplay/apk-store-builder.js +97 -97
  7. package/files/buildCodeplay/codeplayBeforeBuild.js +40 -45
  8. package/files/buildCodeplay/ensure-current-build.cjs +42 -42
  9. package/files/buildCodeplay/fix-onesignal-plugin.js +96 -96
  10. package/files/buildCodeplay/ios-emi-admob-modification.js +49 -49
  11. package/files/buildCodeplay/manifestModification.js +38 -38
  12. package/files/buildCodeplay/newly added.txt +89 -89
  13. package/files/buildCodeplay/packageidBaseModification.js +445 -445
  14. package/files/buildCodeplay/project-scripts.cjs +62 -62
  15. package/files/buildCodeplay/release-sync.config.json +4 -4
  16. package/files/buildCodeplay/remove-force-kotlin-disable.js +43 -43
  17. package/files/buildCodeplay/setSplashAnimation.js +226 -226
  18. package/files/buildCodeplay/sync-admob-nextgen.js +219 -219
  19. package/files/buildCodeplay/versions.json +27 -27
  20. package/files/finalrelease +1246 -1246
  21. package/files/generate-ai-promo-video.js +23 -23
  22. package/files/ionic.config.json +6 -6
  23. package/files/scripts-common/generate-baseline-profile.js +46 -46
  24. package/files/scripts-common/run-codeplay-sync-after.js +21 -21
  25. package/files/scripts-common/screenshot/background-decorations.js +120 -120
  26. package/files/scripts-common/screenshot/frame-samples.js +117 -117
  27. package/files/scripts-common/setup-baseline-profile.js +291 -291
  28. package/files/take-screen-image.js +4382 -4352
  29. package/files/take-screen-video.js +644 -644
  30. package/package.json +27 -27
  31. package/scripts/ensure-current-build.test.cjs +76 -76
  32. package/scripts/sync-files.js +113 -113
  33. package/scripts/uninstall.js +2 -2
@@ -1,62 +1,62 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const tasks = {
4
- 'before-build': 'node buildCodeplay/codeplayBeforeBuild.js',
5
- 'package-id': 'node buildCodeplay/packageidBaseModification.js',
6
- 'splash': 'node buildCodeplay/add-splash-screen.js',
7
- 'splash-animation': 'node buildCodeplay/setSplashAnimation.js',
8
- 'manifest': 'node buildCodeplay/manifestModification.js',
9
- 'admob-sync': 'node buildCodeplay/sync-admob-nextgen.js',
10
- 'apk': 'node buildCodeplay/apk-store-builder.js',
11
- 'final-release': 'node finalrelease',
12
- };
13
- const syncAfter = `${tasks.splash} && ${tasks['splash-animation']} && ${tasks.manifest} && node scripts-common/setup-baseline-profile.js`;
14
- function updateBuildScripts(scripts) {
15
- const next = { ...scripts };
16
- for (const key of Object.keys(next)) {
17
- if (typeof next[key] !== 'string') continue;
18
- next[key] = next[key].replace(/(^|[\s"'=])(\.\/)?scripts\//g, '$1$2scripts-common/');
19
- next[key] = next[key].replace(/node\s+node_modules\/codeplay-common\/scripts\/run\.cjs\s+([\w-]+)/g, (match, task) => tasks[task] || (task === 'sync-after' ? syncAfter : match))
20
- .replace(/buildCodeplay\/(codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)/g, 'buildCodeplay/$1.js')
21
- .replace(/node\s+iap-install-\d+(?:\.\d+)*\.js/g, tasks['before-build']);
22
- }
23
- if (!next.build) next.build = `${tasks['before-build']} && ${tasks['package-id']} && cross-env NODE_ENV=production vite build --logLevel warn`;
24
- else if (!next.build.includes(tasks['before-build'])) next.build = `${tasks['before-build']} && ${next.build}`;
25
- for (const id of [1, 2, 3, 4, 5, 7, 8]) {
26
- const key = `build:storeid${id}`;
27
- if (!next[key]) next[key] = `vite build --mode storeid${id}`;
28
- if (!next[key].includes(tasks['before-build'])) next[key] = `cross-env VITE_STORE_ID=${id} ${tasks['before-build']} && cross-env VITE_STORE_ID=${id} ${next[key]}`;
29
- }
30
- if (next['build:storeid6'] && !next['build:storeid6'].includes(tasks['before-build'])) next['build:storeid6'] = `cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ${tasks['before-build']} && cross-env VITE_STORE_ID=6 ${next['build:storeid6']}`;
31
- next['build:ios'] = next['build:ios'] || 'cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 npm run build';
32
- if (!/VITE_STORE_ID=6\b/.test(next['build:ios'])) next['build:ios'] = next['build:ios'].replace('CODEPLAY_BUILD_PLATFORM=ios ', 'CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ');
33
- next['capacitor:sync:after'] = next['capacitor:sync:after'] || syncAfter;
34
- next['build-capacitor-android'] = next['build-capacitor-android'] || 'npm run build && npx cap copy android';
35
- next['build-capacitor-ios'] = next['build-capacitor-ios']
36
- ? next['build-capacitor-ios'].replace(/^(?:cross-env\s+NODE_ENV=production\s+)?vite\s+build(?=\s*&&\s*npx\s+cap\s+copy\s+ios\b)/, 'npm run build:ios')
37
- : 'npm run build:ios && npx cap copy ios';
38
- next['ionic:build'] = next['ionic:build'] || 'npm run build';
39
- next['ionic:serve'] = next['ionic:serve'] || 'cross-env NODE_ENV=development vite';
40
- next['baseline-profile:setup'] = next['baseline-profile:setup'] || 'node scripts-common/setup-baseline-profile.js';
41
- const r8Command = next['android:r8-rules'];
42
- if (!r8Command || r8Command === 'node buildCodeplay/android-r8-rules.cjs' || /^node\s+(?:\.\/)?(?:Scripts|scripts|scripts-common)\/restore-android-r8-rules\.cjs$/.test(r8Command)) {
43
- next['android:r8-rules'] = 'node buildCodeplay/fix-optimize-builld/restore-android-r8-rules.cjs';
44
- }
45
- if (!next['baseline-profile:generate'] || next['baseline-profile:generate'] === 'cd android && gradlew.bat :app:generateBaselineProfile --console=plain') {
46
- next['baseline-profile:generate'] = 'node scripts-common/generate-baseline-profile.js';
47
- }
48
- next.release = next.release || 'node finalrelease';
49
- return next;
50
- }
51
- function removeVersionedBuildScripts(projectRoot) {
52
- const directory = path.resolve(projectRoot, 'buildCodeplay');
53
- if (!fs.existsSync(directory)) return;
54
- if (fs.lstatSync(directory).isSymbolicLink()) throw new Error('Refusing to clean a linked buildCodeplay directory.');
55
- for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
56
- if (!entry.isFile() || (entry.name !== 'sync-startup.cjs' && !/^(?:codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)$/.test(entry.name))) continue;
57
- const target = path.resolve(directory, entry.name);
58
- if (path.dirname(target) !== directory) throw new Error('Invalid legacy build path.');
59
- fs.unlinkSync(target);
60
- }
61
- }
62
- module.exports = { updateBuildScripts, removeVersionedBuildScripts };
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const tasks = {
4
+ 'before-build': 'node buildCodeplay/codeplayBeforeBuild.js',
5
+ 'package-id': 'node buildCodeplay/packageidBaseModification.js',
6
+ 'splash': 'node buildCodeplay/add-splash-screen.js',
7
+ 'splash-animation': 'node buildCodeplay/setSplashAnimation.js',
8
+ 'manifest': 'node buildCodeplay/manifestModification.js',
9
+ 'admob-sync': 'node buildCodeplay/sync-admob-nextgen.js',
10
+ 'apk': 'node buildCodeplay/apk-store-builder.js',
11
+ 'final-release': 'node finalrelease',
12
+ };
13
+ const syncAfter = `${tasks.splash} && ${tasks['splash-animation']} && ${tasks.manifest} && node scripts-common/setup-baseline-profile.js`;
14
+ function updateBuildScripts(scripts) {
15
+ const next = { ...scripts };
16
+ for (const key of Object.keys(next)) {
17
+ if (typeof next[key] !== 'string') continue;
18
+ next[key] = next[key].replace(/(^|[\s"'=])(\.\/)?scripts\//g, '$1$2scripts-common/');
19
+ next[key] = next[key].replace(/node\s+node_modules\/codeplay-common\/scripts\/run\.cjs\s+([\w-]+)/g, (match, task) => tasks[task] || (task === 'sync-after' ? syncAfter : match))
20
+ .replace(/buildCodeplay\/(codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)/g, 'buildCodeplay/$1.js')
21
+ .replace(/node\s+iap-install-\d+(?:\.\d+)*\.js/g, tasks['before-build']);
22
+ }
23
+ if (!next.build) next.build = `${tasks['before-build']} && ${tasks['package-id']} && cross-env NODE_ENV=production vite build --logLevel warn`;
24
+ else if (!next.build.includes(tasks['before-build'])) next.build = `${tasks['before-build']} && ${next.build}`;
25
+ for (const id of [1, 2, 3, 4, 5, 7, 8]) {
26
+ const key = `build:storeid${id}`;
27
+ if (!next[key]) next[key] = `vite build --mode storeid${id}`;
28
+ if (!next[key].includes(tasks['before-build'])) next[key] = `cross-env VITE_STORE_ID=${id} ${tasks['before-build']} && cross-env VITE_STORE_ID=${id} ${next[key]}`;
29
+ }
30
+ if (next['build:storeid6'] && !next['build:storeid6'].includes(tasks['before-build'])) next['build:storeid6'] = `cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ${tasks['before-build']} && cross-env VITE_STORE_ID=6 ${next['build:storeid6']}`;
31
+ next['build:ios'] = next['build:ios'] || 'cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 npm run build';
32
+ if (!/VITE_STORE_ID=6\b/.test(next['build:ios'])) next['build:ios'] = next['build:ios'].replace('CODEPLAY_BUILD_PLATFORM=ios ', 'CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ');
33
+ next['capacitor:sync:after'] = next['capacitor:sync:after'] || syncAfter;
34
+ next['build-capacitor-android'] = next['build-capacitor-android'] || 'npm run build && npx cap copy android';
35
+ next['build-capacitor-ios'] = next['build-capacitor-ios']
36
+ ? next['build-capacitor-ios'].replace(/^(?:cross-env\s+NODE_ENV=production\s+)?vite\s+build(?=\s*&&\s*npx\s+cap\s+copy\s+ios\b)/, 'npm run build:ios')
37
+ : 'npm run build:ios && npx cap copy ios';
38
+ next['ionic:build'] = next['ionic:build'] || 'npm run build';
39
+ next['ionic:serve'] = next['ionic:serve'] || 'cross-env NODE_ENV=development vite';
40
+ next['baseline-profile:setup'] = next['baseline-profile:setup'] || 'node scripts-common/setup-baseline-profile.js';
41
+ const r8Command = next['android:r8-rules'];
42
+ if (!r8Command || r8Command === 'node buildCodeplay/android-r8-rules.cjs' || /^node\s+(?:\.\/)?(?:Scripts|scripts|scripts-common)\/restore-android-r8-rules\.cjs$/.test(r8Command)) {
43
+ next['android:r8-rules'] = 'node buildCodeplay/fix-optimize-builld/restore-android-r8-rules.cjs';
44
+ }
45
+ if (!next['baseline-profile:generate'] || next['baseline-profile:generate'] === 'cd android && gradlew.bat :app:generateBaselineProfile --console=plain') {
46
+ next['baseline-profile:generate'] = 'node scripts-common/generate-baseline-profile.js';
47
+ }
48
+ next.release = next.release || 'node finalrelease';
49
+ return next;
50
+ }
51
+ function removeVersionedBuildScripts(projectRoot) {
52
+ const directory = path.resolve(projectRoot, 'buildCodeplay');
53
+ if (!fs.existsSync(directory)) return;
54
+ if (fs.lstatSync(directory).isSymbolicLink()) throw new Error('Refusing to clean a linked buildCodeplay directory.');
55
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
56
+ if (!entry.isFile() || (entry.name !== 'sync-startup.cjs' && !/^(?:codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)$/.test(entry.name))) continue;
57
+ const target = path.resolve(directory, entry.name);
58
+ if (path.dirname(target) !== directory) throw new Error('Invalid legacy build path.');
59
+ fs.unlinkSync(target);
60
+ }
61
+ }
62
+ module.exports = { updateBuildScripts, removeVersionedBuildScripts };
@@ -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
+ }
@@ -1,43 +1,43 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const legacyPluginXmlPath = path.resolve(
5
- __dirname,
6
- '../node_modules/emi-indo-cordova-plugin-admob/plugin.xml'
7
- );
8
-
9
- const nextGenPackagePath = path.resolve(
10
- __dirname,
11
- '../node_modules/capacitor-admob-nextgen/package.json'
12
- );
13
-
14
- if (!fs.existsSync(legacyPluginXmlPath)) {
15
- if (fs.existsSync(nextGenPackagePath)) {
16
- console.log('ℹ️ Skipping legacy Kotlin patch. capacitor-admob-nextgen is installed and does not use plugin.xml.');
17
- process.exit(0);
18
- }
19
-
20
- console.log('ℹ️ Legacy AdMob plugin.xml not found, skipping Kotlin patch.');
21
- process.exit(0);
22
- }
23
-
24
- fs.readFile(legacyPluginXmlPath, 'utf8', (err, data) => {
25
- if (err) {
26
- console.error('Error reading plugin.xml:', err);
27
- process.exit(1);
28
- }
29
-
30
- const modifiedData = data.replace(
31
- /<framework\s+src="src\/android\/force-kotlin\.gradle"\s+custom="true"\s+type="gradleReference"\s*\/>\s*\n?/g,
32
- ''
33
- );
34
-
35
- fs.writeFile(legacyPluginXmlPath, modifiedData, 'utf8', (writeErr) => {
36
- if (writeErr) {
37
- console.error('Error writing plugin.xml:', writeErr);
38
- process.exit(1);
39
- }
40
-
41
- console.log('plugin.xml updated successfully.');
42
- });
43
- });
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const legacyPluginXmlPath = path.resolve(
5
+ __dirname,
6
+ '../node_modules/emi-indo-cordova-plugin-admob/plugin.xml'
7
+ );
8
+
9
+ const nextGenPackagePath = path.resolve(
10
+ __dirname,
11
+ '../node_modules/capacitor-admob-nextgen/package.json'
12
+ );
13
+
14
+ if (!fs.existsSync(legacyPluginXmlPath)) {
15
+ if (fs.existsSync(nextGenPackagePath)) {
16
+ console.log('ℹ️ Skipping legacy Kotlin patch. capacitor-admob-nextgen is installed and does not use plugin.xml.');
17
+ process.exit(0);
18
+ }
19
+
20
+ console.log('ℹ️ Legacy AdMob plugin.xml not found, skipping Kotlin patch.');
21
+ process.exit(0);
22
+ }
23
+
24
+ fs.readFile(legacyPluginXmlPath, 'utf8', (err, data) => {
25
+ if (err) {
26
+ console.error('Error reading plugin.xml:', err);
27
+ process.exit(1);
28
+ }
29
+
30
+ const modifiedData = data.replace(
31
+ /<framework\s+src="src\/android\/force-kotlin\.gradle"\s+custom="true"\s+type="gradleReference"\s*\/>\s*\n?/g,
32
+ ''
33
+ );
34
+
35
+ fs.writeFile(legacyPluginXmlPath, modifiedData, 'utf8', (writeErr) => {
36
+ if (writeErr) {
37
+ console.error('Error writing plugin.xml:', writeErr);
38
+ process.exit(1);
39
+ }
40
+
41
+ console.log('plugin.xml updated successfully.');
42
+ });
43
+ });