ttmg-pack 0.3.10 → 0.4.3

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 (46) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/__TEST__/tests/fixtures/check-project/non-unity/src/game.js +1 -0
  3. package/__TEST__/tests/fixtures/check-project/non-unity/src/game.json +3 -0
  4. package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.js +1 -0
  5. package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.json +4 -0
  6. package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.js +1 -0
  7. package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.json +4 -0
  8. package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/webgl-wasm-split.json +3 -0
  9. package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.js +1 -0
  10. package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.json +4 -0
  11. package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/webgl-wasm-split.json +3 -0
  12. package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.js +1 -0
  13. package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.json +4 -0
  14. package/__TEST__/tests/fixtures/check-project/unity-small/src/game.js +1 -0
  15. package/__TEST__/tests/fixtures/check-project/unity-small/src/game.json +4 -0
  16. package/__TEST__/tests/fixtures/game-cocos/game.json +3 -0
  17. package/__TEST__/tests/fixtures/game-invalid-json/game.json +1 -0
  18. package/__TEST__/tests/fixtures/game-no-config/game.js +1 -0
  19. package/__TEST__/tests/fixtures/game-no-engine/game.json +3 -0
  20. package/__TEST__/tests/fixtures/game-unity/game.json +15 -0
  21. package/__TEST__/tests/libs/checkProject.test.js +68 -0
  22. package/__TEST__/tests/runner-simple.js +120 -0
  23. package/__TEST__/tests/runner.js +102 -0
  24. package/__TEST__/tests/utils/Deferred.test.js +69 -0
  25. package/__TEST__/tests/utils/asyncPool.test.js +48 -0
  26. package/__TEST__/tests/utils/getCheckConfig.test.js +24 -0
  27. package/__TEST__/tests/utils/getGameEngine.test.js +32 -0
  28. package/__TEST__/tests/utils/getIndependentPackagesConfig.test.js +27 -0
  29. package/__TEST__/tests/utils/getMd5.test.js +31 -0
  30. package/__TEST__/tests/utils/getSubpackagesConfig.test.js +26 -0
  31. package/__TEST__/tests/utils/unity.test.js +30 -0
  32. package/dist/constants/index.d.ts +1 -0
  33. package/dist/index.js +367 -101
  34. package/dist/index.js.map +1 -1
  35. package/dist/libs/buildPkgs/index.d.ts +2 -2
  36. package/dist/libs/checkPkgs/checkAPI.d.ts +2 -1
  37. package/dist/libs/checkPkgs/checkIndependentPackages.d.ts +4 -2
  38. package/dist/libs/checkPkgs/checkMainpackage.d.ts +4 -3
  39. package/dist/libs/checkPkgs/checkProject.d.ts +4 -3
  40. package/dist/libs/checkPkgs/checkSubpackages.d.ts +2 -1
  41. package/dist/libs/checkPkgs/index.d.ts +2 -2
  42. package/dist/libs/debugPkgs/index.d.ts +2 -2
  43. package/dist/typings/index.d.ts +7 -0
  44. package/dist/utils/i18n.d.ts +158 -0
  45. package/dist/utils/index.d.ts +2 -0
  46. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ const assert = require('assert');
2
+ const path = require('path');
3
+ const { isUnityEngine } = require('../../../dist/utils/unity');
4
+ const { getUnityBuildConfig } = require('../../../dist/utils/unity/getUnityBuildConfig');
5
+ const { GAME_PKG_SIZE_LIMIT } = require('../../../dist/constants');
6
+
7
+ const fixturesPath = path.join(__dirname, '../fixtures');
8
+
9
+ describe('Unity Utils', function() {
10
+ describe('isUnityEngine', function() {
11
+ it('should return true for unity engine', function() {
12
+ const result = isUnityEngine(path.join(fixturesPath, 'game-unity'));
13
+ assert.strictEqual(result, true);
14
+ });
15
+
16
+ it('should return false for non-unity engine', function() {
17
+ const result = isUnityEngine(path.join(fixturesPath, 'game-cocos'));
18
+ assert.strictEqual(result, false);
19
+ });
20
+ });
21
+
22
+ describe('getUnityBuildConfig', function() {
23
+ it('should return unity build config', function() {
24
+ const config = getUnityBuildConfig();
25
+ assert.strictEqual(config.pkgSizeLimit, GAME_PKG_SIZE_LIMIT.unity.project);
26
+ assert.strictEqual(config.mainPkgSizeLimit, GAME_PKG_SIZE_LIMIT.unity.main);
27
+ assert.strictEqual(config.independentSubPkgSizeLimit, GAME_PKG_SIZE_LIMIT.unity.independent);
28
+ });
29
+ });
30
+ });
@@ -52,3 +52,4 @@ export declare const GAME_PKG_SIZE_LIMIT: {
52
52
  independent: any;
53
53
  };
54
54
  };
55
+ export declare const WASM_FUNC_COUNT_LIMIT = 80000;