codeplay-common 4.10.0 → 4.10.1

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/CHANGELOG.md CHANGED
@@ -28,20 +28,20 @@ Files changed: `package.json`, `scripts/sync-files.js`, `files/buildCodeplay/cod
28
28
  - Preserve app-owned ad configuration and select each app's existing IAP analytics module.
29
29
  - Download every AdMob folder ZIP from htmlcodeplay.com; no AdMob archive is included in this npm package.
30
30
  - Validate ZIP contents before switching imports; retain the working package when a remote update fails.
31
- - Validate the selected folder controller during final-release checks while continuing to reject test aliases.
32
-
33
- ## 4.7.7 — 2026-10-07
34
-
35
- Version name: 4.7.7. Version code/build number: not applicable to this npm package.
36
- Bundled pre-build script: 6.4.
37
-
38
- Files changed: `package.json`, `scripts/sync-files.js`, `files/buildCodeplay/codeplayBeforeBuild-6.4.js`
39
- (replaces `codeplayBeforeBuild-6.3.js`), `README.md`, `CHANGELOG.md`, `RELEASE_NOTES.md`.
40
-
41
- - Keep `npm run build` as the Android default on every host; add `npm run build:ios` automatically during installation.
42
- - Route `build-capacitor-android` through the same pre-build validation before copying the web build.
43
- - Migrate direct save-gallery imports to `@saveGallery` and select the matching platform helper in Vite after one detailed Enter/y confirmation.
44
- - Stop without import writes on cancellation, missing helpers, mixed versions, unsupported query/hash aliases or concurrent source edits.
45
- - Reuse source directory traversal and combine gallery, retired OneSignal import, StatusBar and editor checks in one content pass.
46
- - Automatically remove an installed/declared `onesignal-cordova-plugin` with a warning; skip legacy OneSignal patching/helper downloads and stop on remaining package imports.
47
- - Keep `agent-temp/` ignored and remove existing `buildCodeplay/` ignore entries without adding them in future projects.
31
+ - Validate the selected folder controller during final-release checks while continuing to reject test aliases.
32
+
33
+ ## 4.7.7 — 2026-10-07
34
+
35
+ Version name: 4.7.7. Version code/build number: not applicable to this npm package.
36
+ Bundled pre-build script: 6.4.
37
+
38
+ Files changed: `package.json`, `scripts/sync-files.js`, `files/buildCodeplay/codeplayBeforeBuild-6.4.js`
39
+ (replaces `codeplayBeforeBuild-6.3.js`), `README.md`, `CHANGELOG.md`, `RELEASE_NOTES.md`.
40
+
41
+ - Keep `npm run build` as the Android default on every host; add `npm run build:ios` automatically during installation.
42
+ - Route `build-capacitor-android` through the same pre-build validation before copying the web build.
43
+ - Migrate direct save-gallery imports to `@saveGallery` and select the matching platform helper in Vite after one detailed Enter/y confirmation.
44
+ - Stop without import writes on cancellation, missing helpers, mixed versions, unsupported query/hash aliases or concurrent source edits.
45
+ - Reuse source directory traversal and combine gallery, retired OneSignal import, StatusBar and editor checks in one content pass.
46
+ - Automatically remove an installed/declared `onesignal-cordova-plugin` with a warning; skip legacy OneSignal patching/helper downloads and stop on remaining package imports.
47
+ - Keep `agent-temp/` ignored and remove existing `buildCodeplay/` ignore entries without adding them in future projects.
package/RELEASE_NOTES.md CHANGED
@@ -28,18 +28,18 @@ Files changed: `package.json`, `scripts/sync-files.js`, `files/buildCodeplay/cod
28
28
  - Preserve app-owned ad configuration and select each app's existing IAP analytics module.
29
29
  - Download every AdMob folder ZIP from htmlcodeplay.com; no AdMob archive is included in this npm package.
30
30
  - Validate ZIP contents before switching imports; retain the working package when a remote update fails.
31
- - Validate the selected folder controller during final-release checks while continuing to reject test aliases.
32
-
33
- ## 4.7.7 — 2026-10-07
34
-
35
- Version name: 4.7.7. Version code/build number: not applicable to this npm package.
36
-
37
- Files changed: `package.json`, `scripts/sync-files.js`, `files/buildCodeplay/codeplayBeforeBuild-6.4.js`
38
- (replaces `codeplayBeforeBuild-6.3.js`), `README.md`, `CHANGELOG.md`, `RELEASE_NOTES.md`.
39
-
40
- - Installation automatically configures Android and iOS build commands in your app's `package.json`.
41
- - Android builds remain the default; use `npm run build:ios` for iOS.
42
- - Save-gallery imports use one alias with a platform-specific helper and a clear confirmation before source changes.
43
- - Shared checks reuse file traversal to reduce repeated scanning.
44
- - Builds warn and automatically uninstall the retired OneSignal Cordova plugin when found.
45
- - `agent-temp/` stays ignored, while `buildCodeplay/` is removed from ignore rules.
31
+ - Validate the selected folder controller during final-release checks while continuing to reject test aliases.
32
+
33
+ ## 4.7.7 — 2026-10-07
34
+
35
+ Version name: 4.7.7. Version code/build number: not applicable to this npm package.
36
+
37
+ Files changed: `package.json`, `scripts/sync-files.js`, `files/buildCodeplay/codeplayBeforeBuild-6.4.js`
38
+ (replaces `codeplayBeforeBuild-6.3.js`), `README.md`, `CHANGELOG.md`, `RELEASE_NOTES.md`.
39
+
40
+ - Installation automatically configures Android and iOS build commands in your app's `package.json`.
41
+ - Android builds remain the default; use `npm run build:ios` for iOS.
42
+ - Save-gallery imports use one alias with a platform-specific helper and a clear confirmation before source changes.
43
+ - Shared checks reuse file traversal to reduce repeated scanning.
44
+ - Builds warn and automatically uninstall the retired OneSignal Cordova plugin when found.
45
+ - `agent-temp/` stays ignored, while `buildCodeplay/` is removed from ignore rules.
@@ -5,6 +5,13 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const plist = require('plist');
7
7
 
8
+ // Preserve comments, strings, and custom tree-shaking objects/functions.
9
+ // Only migrate the explicit boolean opt-out used by older Codeplay configs.
10
+ const migrateViteTreeShaking = (content) => content.replace(
11
+ /\/\*[\s\S]*?\*\/|\/\/[^\r\n]*|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|`(?:\\[\s\S]|[^`\\])*`|\btreeshake([ \t]*:[ \t]*)false\b/g,
12
+ (match, separator) => separator === undefined ? match : `treeshake${separator}true`
13
+ );
14
+
8
15
 
9
16
 
10
17
  // BEGIN IAP BUILD MIGRATION
@@ -2938,6 +2945,17 @@ function getViteConfigPath() {
2938
2945
  .find(filePath => fs.existsSync(filePath));
2939
2946
  };
2940
2947
 
2948
+ const syncViteTreeShaking = () => {
2949
+ const configPath = getViteConfigPath();
2950
+ if (!configPath) return;
2951
+ const current = fs.readFileSync(configPath, 'utf8');
2952
+ const next = migrateViteTreeShaking(current);
2953
+ if (next !== current) {
2954
+ fs.writeFileSync(configPath, next, 'utf8');
2955
+ console.log('✅ Enabled Vite tree shaking for common JavaScript and other unused exports.');
2956
+ }
2957
+ };
2958
+
2941
2959
  const getLatestIapDir = () => {
2942
2960
  const adsDir = path.join(process.cwd(), "src", "js", "Ads");
2943
2961
 
@@ -4483,6 +4501,7 @@ async function main() {
4483
4501
  syncRevenueCatIapSetup();
4484
4502
  syncFirebaseAnalyticsSetup();
4485
4503
  checkAndupdateDropInViteConfig();
4504
+ syncViteTreeShaking();
4486
4505
  checkAdmobConfigurationProperty();
4487
4506
  syncAndroidAdIdPermission();
4488
4507
  syncAndroidBuildOptimization();
@@ -1,27 +1,27 @@
1
- {
2
- "plugins":[
3
- {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
1
+ {
2
+ "plugins":[
3
+ {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
4
4
  {"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.7","baseDir":"js","mandatoryUpdate":true},
5
-
5
+
6
6
  {"name":"admob-nextgen","pattern":"admob-nextgen-(\\d+(?:\\.\\d+)*)$","minVersion":"4.1","baseDir":"js/Ads","mandatoryUpdate":true,"isFolder":true},
7
- {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
- {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
- {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
10
-
11
-
12
- {"name":"localization","pattern":"localization-(\\d+\\.\\d+)$","minVersion":"1.8","baseDir":"js/localization","mandatoryUpdate":true,"isFolder":true},
13
- {"name": "localization_settings","pattern": "localization_settings-(\\d+\\.\\d+)\\.js$","minVersion": "1.1","required": true,"baseDir": "js/localization","mandatoryUpdate": true},
14
-
15
-
16
- {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
17
- {"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
18
- {"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
19
- {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
7
+ {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
+ {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
+ {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
10
+
11
+
12
+ {"name":"localization","pattern":"localization-(\\d+\\.\\d+)$","minVersion":"1.8","baseDir":"js/localization","mandatoryUpdate":true,"isFolder":true},
13
+ {"name": "localization_settings","pattern": "localization_settings-(\\d+\\.\\d+)\\.js$","minVersion": "1.1","required": true,"baseDir": "js/localization","mandatoryUpdate": true},
14
+
15
+
16
+ {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
17
+ {"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
18
+ {"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
19
+ {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
20
20
  {"name":"IAP","pattern":"IAP-(\\d+\\.\\d+)$","minVersion":"4.6","baseDir":"js/Ads","mandatoryUpdate":true,"isFolder":true},
21
- {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
22
- {"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
23
- {"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
24
- {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
- {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
- ]
21
+ {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
22
+ {"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
23
+ {"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
24
+ {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
+ {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
+ ]
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.10.0",
3
+ "version": "4.10.1",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",