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.
- package/CHANGELOG.md +16 -1
- package/__TEST__/tests/fixtures/check-project/non-unity/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/non-unity/src/game.json +3 -0
- package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/webgl-wasm-split.json +3 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/webgl-wasm-split.json +3 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.json +4 -0
- package/__TEST__/tests/fixtures/check-project/unity-small/src/game.js +1 -0
- package/__TEST__/tests/fixtures/check-project/unity-small/src/game.json +4 -0
- package/__TEST__/tests/fixtures/game-cocos/game.json +3 -0
- package/__TEST__/tests/fixtures/game-invalid-json/game.json +1 -0
- package/__TEST__/tests/fixtures/game-no-config/game.js +1 -0
- package/__TEST__/tests/fixtures/game-no-engine/game.json +3 -0
- package/__TEST__/tests/fixtures/game-unity/game.json +15 -0
- package/__TEST__/tests/libs/checkProject.test.js +68 -0
- package/__TEST__/tests/runner-simple.js +120 -0
- package/__TEST__/tests/runner.js +102 -0
- package/__TEST__/tests/utils/Deferred.test.js +69 -0
- package/__TEST__/tests/utils/asyncPool.test.js +48 -0
- package/__TEST__/tests/utils/getCheckConfig.test.js +24 -0
- package/__TEST__/tests/utils/getGameEngine.test.js +32 -0
- package/__TEST__/tests/utils/getIndependentPackagesConfig.test.js +27 -0
- package/__TEST__/tests/utils/getMd5.test.js +31 -0
- package/__TEST__/tests/utils/getSubpackagesConfig.test.js +26 -0
- package/__TEST__/tests/utils/unity.test.js +30 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/index.js +367 -101
- package/dist/index.js.map +1 -1
- package/dist/libs/buildPkgs/index.d.ts +2 -2
- package/dist/libs/checkPkgs/checkAPI.d.ts +2 -1
- package/dist/libs/checkPkgs/checkIndependentPackages.d.ts +4 -2
- package/dist/libs/checkPkgs/checkMainpackage.d.ts +4 -3
- package/dist/libs/checkPkgs/checkProject.d.ts +4 -3
- package/dist/libs/checkPkgs/checkSubpackages.d.ts +2 -1
- package/dist/libs/checkPkgs/index.d.ts +2 -2
- package/dist/libs/debugPkgs/index.d.ts +2 -2
- package/dist/typings/index.d.ts +7 -0
- package/dist/utils/i18n.d.ts +158 -0
- package/dist/utils/index.d.ts +2 -0
- 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
|
+
});
|