@rnx-kit/cli 0.12.6 → 0.14.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/README.md +90 -65
  3. package/coverage/clover.xml +92 -104
  4. package/coverage/coverage-final.json +7 -6
  5. package/coverage/lcov-report/index.html +29 -29
  6. package/coverage/lcov-report/src/bundle/index.html +29 -29
  7. package/coverage/lcov-report/src/bundle/kit-config.ts.html +63 -117
  8. package/coverage/lcov-report/src/bundle/metro.ts.html +40 -163
  9. package/coverage/lcov-report/src/bundle/overrides.ts.html +28 -58
  10. package/coverage/lcov-report/src/bundler-plugin-defaults.ts.html +115 -0
  11. package/coverage/lcov-report/src/copy-assets.ts.html +1 -1
  12. package/coverage/lcov-report/src/index.html +26 -11
  13. package/coverage/lcov-report/src/metro-config.ts.html +49 -31
  14. package/coverage/lcov-report/src/typescript/index.html +1 -1
  15. package/coverage/lcov-report/src/typescript/project-cache.ts.html +5 -5
  16. package/coverage/lcov.info +173 -193
  17. package/lib/bundle/kit-config.d.ts +9 -15
  18. package/lib/bundle/kit-config.d.ts.map +1 -1
  19. package/lib/bundle/kit-config.js +29 -43
  20. package/lib/bundle/kit-config.js.map +1 -1
  21. package/lib/bundle/metro.d.ts +7 -11
  22. package/lib/bundle/metro.d.ts.map +1 -1
  23. package/lib/bundle/metro.js +10 -40
  24. package/lib/bundle/metro.js.map +1 -1
  25. package/lib/bundle/overrides.d.ts +11 -9
  26. package/lib/bundle/overrides.d.ts.map +1 -1
  27. package/lib/bundle/overrides.js +10 -18
  28. package/lib/bundle/overrides.js.map +1 -1
  29. package/lib/bundle/types.d.ts +4 -17
  30. package/lib/bundle/types.d.ts.map +1 -1
  31. package/lib/bundle.d.ts +8 -7
  32. package/lib/bundle.d.ts.map +1 -1
  33. package/lib/bundle.js +3 -19
  34. package/lib/bundle.js.map +1 -1
  35. package/lib/bundler-plugin-defaults.d.ts +3 -0
  36. package/lib/bundler-plugin-defaults.d.ts.map +1 -0
  37. package/lib/bundler-plugin-defaults.js +13 -0
  38. package/lib/bundler-plugin-defaults.js.map +1 -0
  39. package/lib/index.d.ts +1 -1
  40. package/lib/index.d.ts.map +1 -1
  41. package/lib/index.js +2 -1
  42. package/lib/index.js.map +1 -1
  43. package/lib/metro-config.d.ts +3 -2
  44. package/lib/metro-config.d.ts.map +1 -1
  45. package/lib/metro-config.js +7 -5
  46. package/lib/metro-config.js.map +1 -1
  47. package/lib/parsers.d.ts +2 -0
  48. package/lib/parsers.d.ts.map +1 -1
  49. package/lib/parsers.js +16 -1
  50. package/lib/parsers.js.map +1 -1
  51. package/lib/serve/kit-config.d.ts +6 -5
  52. package/lib/serve/kit-config.d.ts.map +1 -1
  53. package/lib/serve/kit-config.js +16 -6
  54. package/lib/serve/kit-config.js.map +1 -1
  55. package/lib/start.d.ts +2 -2
  56. package/lib/start.d.ts.map +1 -1
  57. package/lib/start.js +4 -11
  58. package/lib/start.js.map +1 -1
  59. package/package.json +9 -7
  60. package/react-native.config.js +65 -59
  61. package/src/bundle/kit-config.ts +42 -60
  62. package/src/bundle/metro.ts +15 -56
  63. package/src/bundle/overrides.ts +24 -34
  64. package/src/bundle/types.ts +17 -23
  65. package/src/bundle.ts +18 -36
  66. package/src/bundler-plugin-defaults.ts +10 -0
  67. package/src/index.ts +1 -1
  68. package/src/metro-config.ts +12 -6
  69. package/src/parsers.ts +19 -0
  70. package/src/serve/kit-config.ts +23 -11
  71. package/src/start.ts +8 -15
  72. package/test/bundle/__mocks__/@rnx-kit/config.js +2 -3
  73. package/test/bundle/__mocks__/@rnx-kit/console.js +1 -0
  74. package/test/bundle/__mocks__/@rnx-kit/metro-service.js +1 -0
  75. package/test/bundle/kit-config.test.ts +102 -100
  76. package/test/bundle/metro.test.ts +58 -98
  77. package/test/bundle/overrides.test.ts +29 -25
  78. package/test/copy-assets/assembleAarBundle.test.ts +1 -0
  79. package/lib/types.d.ts +0 -5
  80. package/lib/types.d.ts.map +0 -1
  81. package/lib/types.js +0 -3
  82. package/lib/types.js.map +0 -1
  83. package/src/types.ts +0 -4
@@ -0,0 +1 @@
1
+ module.exports = jest.createMockFromModule("@rnx-kit/console");
@@ -0,0 +1 @@
1
+ module.exports = jest.createMockFromModule("@rnx-kit/metro-service");
@@ -1,55 +1,12 @@
1
1
  import "jest-extended";
2
- import type { BundleDefinitionWithRequiredParameters } from "@rnx-kit/config";
3
2
  import {
4
- getKitBundleConfigs,
5
- getKitBundleDefinition,
6
3
  getTargetPlatforms,
4
+ getCliPlatformBundleConfigs,
7
5
  } from "../../src/bundle/kit-config";
8
6
 
9
7
  const rnxKitConfig = require("@rnx-kit/config");
10
- const consoleWarnSpy = jest.spyOn(global.console, "warn");
11
8
 
12
- describe("CLI > Bundle > Kit Config > getKitBundleDefinition", () => {
13
- beforeEach(() => {
14
- rnxKitConfig.__setMockConfig(undefined);
15
- consoleWarnSpy.mockReset();
16
- });
17
-
18
- test("throws when kit config is not found", () => {
19
- expect(() => getKitBundleDefinition()).toThrowError();
20
- });
21
-
22
- test("returns undefined with a warning message when bundle configuration is missing", () => {
23
- rnxKitConfig.__setMockConfig({});
24
- expect(getKitBundleDefinition()).toBeUndefined();
25
- expect(consoleWarnSpy).toBeCalledTimes(1);
26
- expect(consoleWarnSpy).toBeCalledWith(
27
- expect.anything(),
28
- expect.stringContaining("No bundle configuration found")
29
- );
30
- });
31
-
32
- test("returns undefined with a warning message when bundling is disabled", () => {
33
- rnxKitConfig.__setMockConfig({ bundle: false });
34
- expect(getKitBundleDefinition()).toBeUndefined();
35
- expect(consoleWarnSpy).toBeCalledTimes(1);
36
- expect(consoleWarnSpy).toBeCalledWith(
37
- expect.anything(),
38
- expect.stringContaining("Bundling is disabled")
39
- );
40
- });
41
-
42
- test("returns a bundle definition when bundling is enabled", () => {
43
- rnxKitConfig.__setMockConfig({ bundle: true });
44
- const definition = getKitBundleDefinition();
45
- expect(consoleWarnSpy).not.toBeCalled();
46
- expect(definition).toBeObject();
47
- expect(definition.entryPath).toBeString();
48
- expect(definition.entryPath.length).toBeGreaterThan(0);
49
- });
50
- });
51
-
52
- describe("CLI > Bundle > Kit Config > getTargetPlatforms ", () => {
9
+ describe("CLI > Bundle > Kit Config > getTargetPlatforms", () => {
53
10
  test("returns the override platform", () => {
54
11
  const platforms = getTargetPlatforms("ios", ["android", "ios", "windows"]);
55
12
  expect(platforms).toBeArrayOfSize(1);
@@ -71,78 +28,123 @@ describe("CLI > Bundle > Kit Config > getTargetPlatforms ", () => {
71
28
  });
72
29
  });
73
30
 
74
- describe("CLI > Bundle > Kit Config > getKitBundleConfigs", () => {
75
- const definition: BundleDefinitionWithRequiredParameters = {
76
- entryPath: "start.js",
77
- distPath: "out",
78
- assetsPath: "out/assets",
79
- bundlePrefix: "fabrikam",
31
+ describe("CLI > Bundle > Kit Config > getCliPlatformBundleConfigs", () => {
32
+ const defaultConfig = {
33
+ entryFile: "index.js",
34
+ sourcemapUseAbsolutePath: false,
80
35
  detectCyclicDependencies: true,
81
36
  detectDuplicateDependencies: true,
82
37
  typescriptValidation: true,
83
- treeShake: true,
84
- targets: ["ios", "android"],
85
- platforms: {
86
- ios: {
87
- entryPath: "entry.ios.js",
88
- },
89
- },
38
+ treeShake: false,
39
+ };
40
+
41
+ const defaultConfigIOS = {
42
+ ...defaultConfig,
43
+ bundleOutput: "index.ios.jsbundle",
44
+ platform: "ios",
45
+ };
46
+
47
+ const defaultConfigMacOS = {
48
+ ...defaultConfig,
49
+ bundleOutput: "index.macos.jsbundle",
50
+ platform: "macos",
51
+ };
52
+
53
+ const defaultConfigAndroid = {
54
+ ...defaultConfig,
55
+ bundleOutput: "index.android.bundle",
56
+ platform: "android",
57
+ };
58
+
59
+ const defaultConfigWindows = {
60
+ ...defaultConfig,
61
+ bundleOutput: "index.windows.bundle",
62
+ platform: "windows",
90
63
  };
91
64
 
92
65
  beforeEach(() => {
93
- rnxKitConfig.__setMockConfig({
94
- bundle: {
95
- ...definition,
96
- },
97
- });
98
- consoleWarnSpy.mockReset();
66
+ rnxKitConfig.__setMockConfig(undefined);
67
+ });
68
+
69
+ test("returns defaults for iOS when package has no config", () => {
70
+ const configs = getCliPlatformBundleConfigs(undefined, "ios");
71
+ expect(configs).toBeArrayOfSize(1);
72
+ expect(configs[0]).toEqual(defaultConfigIOS);
73
+ });
74
+
75
+ test("returns defaults for MacOS when package has no config", () => {
76
+ const configs = getCliPlatformBundleConfigs(undefined, "macos");
77
+ expect(configs).toBeArrayOfSize(1);
78
+ expect(configs[0]).toEqual(defaultConfigMacOS);
99
79
  });
100
80
 
101
- test("returns one kit bundle config when an override platform is given", () => {
102
- const kitBundleConfigs = getKitBundleConfigs(undefined, "ios");
103
- expect(kitBundleConfigs).toBeArrayOfSize(1);
81
+ test("returns defaults for Android when package has no config", () => {
82
+ const configs = getCliPlatformBundleConfigs(undefined, "android");
83
+ expect(configs).toBeArrayOfSize(1);
84
+ expect(configs[0]).toEqual(defaultConfigAndroid);
104
85
  });
105
86
 
106
- test("sets the platform property", () => {
107
- const kitBundleConfigs = getKitBundleConfigs();
108
- expect(kitBundleConfigs).toBeArrayOfSize(2);
109
- expect(kitBundleConfigs[0].platform).toEqual("ios");
110
- expect(kitBundleConfigs[1].platform).toEqual("android");
87
+ test("returns defaults for Windows when package has no config", () => {
88
+ const configs = getCliPlatformBundleConfigs(undefined, "windows");
89
+ expect(configs).toBeArrayOfSize(1);
90
+ expect(configs[0]).toEqual(defaultConfigWindows);
111
91
  });
112
92
 
113
- test("sets all bundle definition properties", () => {
114
- const kitBundleConfigs = getKitBundleConfigs();
115
- expect(kitBundleConfigs).toBeArrayOfSize(2);
116
- expect(kitBundleConfigs[0]).toEqual({
117
- ...definition,
118
- entryPath: "entry.ios.js",
119
- platform: "ios",
93
+ const testConfig = {
94
+ bundle: {
95
+ entryFile: "entry.js",
96
+ typescriptValidation: false,
97
+ assetsDest: "dist",
98
+ targets: ["ios", "macos", "android", "windows"],
99
+ },
100
+ };
101
+
102
+ test("returns config with defaults for all target platforms", () => {
103
+ rnxKitConfig.__setMockConfig(testConfig);
104
+ const configs = getCliPlatformBundleConfigs();
105
+ expect(configs).toBeArrayOfSize(4);
106
+ expect(configs[0]).toEqual({ ...defaultConfigIOS, ...testConfig.bundle });
107
+ expect(configs[1]).toEqual({ ...defaultConfigMacOS, ...testConfig.bundle });
108
+ expect(configs[2]).toEqual({
109
+ ...defaultConfigAndroid,
110
+ ...testConfig.bundle,
120
111
  });
121
- expect(kitBundleConfigs[1]).toEqual({
122
- ...definition,
123
- platform: "android",
112
+ expect(configs[3]).toEqual({
113
+ ...defaultConfigWindows,
114
+ ...testConfig.bundle,
124
115
  });
125
116
  });
126
117
 
127
- test("uses deprecated experimental_treeShake", () => {
128
- const d: Record<string, unknown> = { ...definition };
129
- delete d.treeShake;
130
- d.experimental_treeShake = true;
131
- rnxKitConfig.__setMockConfig({
132
- bundle: {
133
- ...d,
118
+ const testMultiConfig = {
119
+ bundle: [
120
+ {
121
+ id: "first",
122
+ entryFile: "first.js",
134
123
  },
124
+ {
125
+ id: "second",
126
+ entryFile: "second.js",
127
+ },
128
+ ],
129
+ };
130
+
131
+ test("returns the first config when no id is given", () => {
132
+ rnxKitConfig.__setMockConfig(testMultiConfig);
133
+ const configs = getCliPlatformBundleConfigs(undefined, "ios");
134
+ expect(configs).toBeArrayOfSize(1);
135
+ expect(configs[0]).toEqual({
136
+ ...defaultConfigIOS,
137
+ ...testMultiConfig.bundle[0],
138
+ });
139
+ });
140
+
141
+ test("returns the selected config when an id is given", () => {
142
+ rnxKitConfig.__setMockConfig(testMultiConfig);
143
+ const configs = getCliPlatformBundleConfigs("second", "android");
144
+ expect(configs).toBeArrayOfSize(1);
145
+ expect(configs[0]).toEqual({
146
+ ...defaultConfigAndroid,
147
+ ...testMultiConfig.bundle[1],
135
148
  });
136
- consoleWarnSpy.mockReset();
137
-
138
- const kitBundleConfigs = getKitBundleConfigs(undefined, "ios");
139
- expect(kitBundleConfigs[0].treeShake).toBe(true);
140
- expect(consoleWarnSpy).toBeCalledTimes(1);
141
- expect(consoleWarnSpy).toBeCalledWith(
142
- expect.stringContaining("deprecated")
143
- );
144
- expect(consoleWarnSpy).toBeCalledWith(
145
- expect.stringContaining("experimental_treeShake")
146
- );
147
149
  });
148
150
  });
@@ -1,115 +1,75 @@
1
- import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
2
- import path from "path";
3
- import { createMetroBundleArgs } from "../../src/bundle/metro";
4
- import type { BundleConfig } from "../../src/bundle/types";
1
+ import "jest-extended";
2
+ import { metroBundle } from "../../src/bundle/metro";
3
+ import type { CliPlatformBundleConfig } from "../../src/bundle/types";
5
4
 
6
- describe("CLI > Bundle > Metro > createMetroBundleArgs", () => {
7
- const bundleConfig: BundleConfig = {
8
- detectCyclicDependencies: true,
9
- detectDuplicateDependencies: true,
10
- typescriptValidation: true,
11
- treeShake: true,
12
- entryPath: "out/entry.js",
13
- distPath: "out",
14
- assetsPath: "out/assets",
15
- bundlePrefix: "my-app",
16
- platform: "ios",
17
- dev: true,
18
- minify: true,
19
- sourceMapPath: "abc.map",
20
- sourceMapSourceRootPath: "root-path-for-source-maps",
21
- };
22
-
23
- test("sets assetsDest", () => {
24
- expect(createMetroBundleArgs(bundleConfig).assetsDest).toEqual(
25
- bundleConfig.assetsPath
26
- );
27
- });
28
-
29
- test("sets entryFile", () => {
30
- expect(createMetroBundleArgs(bundleConfig).entryFile).toEqual(
31
- bundleConfig.entryPath
32
- );
33
- });
34
-
35
- test("sets minify", () => {
36
- expect(createMetroBundleArgs(bundleConfig).minify).toEqual(
37
- bundleConfig.minify
38
- );
39
- });
40
-
41
- test("sets platform", () => {
42
- expect(createMetroBundleArgs(bundleConfig).platform).toEqual(
43
- bundleConfig.platform
44
- );
45
- });
46
-
47
- test("sets dev", () => {
48
- expect(createMetroBundleArgs(bundleConfig).dev).toEqual(bundleConfig.dev);
49
- });
50
-
51
- function testBundleFileExtension(
52
- platform: AllPlatforms,
53
- expectedExtension: string
54
- ): void {
55
- const copy: BundleConfig = { ...bundleConfig, platform };
56
- const args = createMetroBundleArgs(copy);
57
- expect(path.extname(args.bundleOutput).toLowerCase()).toEqual(
58
- expectedExtension
59
- );
60
- }
5
+ const { getDefaultConfig } = require("metro-config");
61
6
 
62
- test("sets bundle file extension to .bundle for android", () => {
63
- testBundleFileExtension("android", ".bundle");
64
- });
7
+ const mockCreateDirectory = jest.fn();
8
+ const toolsNodeFS = require("@rnx-kit/tools-node/fs");
9
+ toolsNodeFS.createDirectory = mockCreateDirectory;
65
10
 
66
- test("sets bundle file extension to .jsbundle for ios", () => {
67
- testBundleFileExtension("ios", ".jsbundle");
68
- });
11
+ const metroService = require("@rnx-kit/metro-service");
12
+ const mockBundle = metroService.bundle;
69
13
 
70
- test("sets bundle file extension to .jsbundle for macos", () => {
71
- testBundleFileExtension("macos", ".jsbundle");
14
+ describe("CLI > Bundle > Metro > metroBundle", () => {
15
+ afterEach(() => {
16
+ jest.resetAllMocks();
72
17
  });
73
18
 
74
- test("sets bundle file extension to .bundle for windows", () => {
75
- testBundleFileExtension("windows", ".bundle");
76
- });
19
+ const bundleConfigNoPlugins: CliPlatformBundleConfig = {
20
+ entryFile: "out/entry.js",
21
+ bundleOutput: "src/main.jsbundle",
22
+ detectCyclicDependencies: false,
23
+ detectDuplicateDependencies: false,
24
+ typescriptValidation: false,
25
+ treeShake: false,
26
+ platform: "ios",
27
+ sourcemapOutput: "map/main.map",
28
+ sourcemapSourcesRoot: "root-path-for-source-maps",
29
+ sourcemapUseAbsolutePath: false,
30
+ assetsDest: "dist",
31
+ };
77
32
 
78
- test("sets bundle file extension to .bundle for win32", () => {
79
- testBundleFileExtension("win32", ".bundle");
80
- });
33
+ const bundleConfig: CliPlatformBundleConfig = {
34
+ ...bundleConfigNoPlugins,
35
+ detectCyclicDependencies: true,
36
+ detectDuplicateDependencies: true,
37
+ typescriptValidation: true,
38
+ treeShake: true,
39
+ };
81
40
 
82
- test("sets bundleOutput to prefix + platform + extension under distPath", () => {
83
- expect(createMetroBundleArgs(bundleConfig).bundleOutput).toEqual(
84
- path.join(bundleConfig.distPath, "my-app.ios.jsbundle")
85
- );
86
- });
41
+ const dev = true;
42
+ const minify = true;
87
43
 
88
- test("sets bundleEncoding", () => {
89
- expect(createMetroBundleArgs(bundleConfig).bundleEncoding).toEqual(
90
- bundleConfig.bundleEncoding
91
- );
44
+ it("does not use a custom serializer when all plugins are disabled", async () => {
45
+ const metroConfig = await getDefaultConfig();
46
+ expect(metroConfig.serializer.customSerializer).toBeNil();
47
+ await metroBundle(metroConfig, bundleConfigNoPlugins, dev, minify);
48
+ expect(metroConfig.serializer.customSerializer).toBeNil();
92
49
  });
93
50
 
94
- test("always sets sourcemapOutput in dev mode", () => {
95
- const copy: BundleConfig = { ...bundleConfig, dev: true };
96
- delete copy.sourceMapPath;
97
-
98
- const args = createMetroBundleArgs(copy);
99
- expect(args.sourcemapOutput).toEqual(args.bundleOutput + ".map");
51
+ it("uses a custom serializer when at least one plugin is enabled", async () => {
52
+ const metroConfig = await getDefaultConfig();
53
+ expect(metroConfig.serializer.customSerializer).toBeNil();
54
+ await metroBundle(metroConfig, bundleConfig, dev, minify);
55
+ expect(metroConfig.serializer.customSerializer).not.toBeNil();
100
56
  });
101
57
 
102
- test("sets sourcemapOutput in production mode", () => {
103
- const copy: BundleConfig = { ...bundleConfig, dev: false };
104
- const args = createMetroBundleArgs(copy);
105
- expect(args.sourcemapOutput).toEqual(
106
- path.join(bundleConfig.distPath, bundleConfig.sourceMapPath)
107
- );
58
+ it("creates directories for the bundle, the source map, and assets", async () => {
59
+ await metroBundle(await getDefaultConfig(), bundleConfig, dev, minify);
60
+ expect(mockCreateDirectory).toHaveBeenCalledTimes(3);
61
+ expect(mockCreateDirectory).toHaveBeenNthCalledWith(1, "src");
62
+ expect(mockCreateDirectory).toHaveBeenNthCalledWith(2, "map");
63
+ expect(mockCreateDirectory).toHaveBeenNthCalledWith(3, "dist");
108
64
  });
109
65
 
110
- test("sets sourcemapSourcesRoot", () => {
111
- expect(createMetroBundleArgs(bundleConfig).sourcemapSourcesRoot).toEqual(
112
- bundleConfig.sourceMapSourceRootPath
113
- );
66
+ it("invokes the Metro bundler using all input parameters", async () => {
67
+ await metroBundle(await getDefaultConfig(), bundleConfig, dev, minify);
68
+ expect(mockBundle).toHaveBeenCalledTimes(1);
69
+ expect(mockBundle.mock.calls[0][0]).toEqual({
70
+ ...bundleConfig,
71
+ dev,
72
+ minify,
73
+ });
114
74
  });
115
75
  });
@@ -1,29 +1,33 @@
1
1
  import "jest-extended";
2
- import { applyKitBundleConfigOverrides } from "../../src/bundle/overrides";
3
- import type { KitBundleConfig } from "../../src/bundle/types";
2
+ import { applyBundleConfigOverrides } from "../../src/bundle/overrides";
3
+ import type { CliPlatformBundleConfig } from "../../src/bundle/types";
4
4
 
5
- describe("CLI > Bundle > Overrides > applyKitBundleConfigOverrides", () => {
6
- const config: KitBundleConfig = {
5
+ describe("CLI > Bundle > Overrides > applyBundleConfigOverrides", () => {
6
+ const config: CliPlatformBundleConfig = {
7
+ entryFile: "src/index.js",
8
+ bundleOutput: "main.jsbundle",
9
+ sourcemapUseAbsolutePath: false,
7
10
  detectCyclicDependencies: true,
8
11
  detectDuplicateDependencies: true,
9
12
  typescriptValidation: true,
10
13
  treeShake: true,
11
- entryPath: "dist/index.js",
12
- distPath: "dist",
13
- assetsPath: "dist",
14
- bundlePrefix: "main",
15
14
  platform: "ios",
16
15
  };
17
16
 
18
17
  test("has no effect when no overrides are given", () => {
19
18
  const copy = { ...config };
20
- applyKitBundleConfigOverrides({}, [copy]);
19
+ applyBundleConfigOverrides({}, [copy]);
21
20
  expect(copy).toEqual(config);
22
21
  });
23
22
 
24
23
  function testOverride(name: string, value: unknown) {
25
24
  const copy = { ...config };
26
- applyKitBundleConfigOverrides(
25
+ if (name in copy) {
26
+ if (name !== undefined && name !== null) {
27
+ expect(copy[name]).not.toEqual(value);
28
+ }
29
+ }
30
+ applyBundleConfigOverrides(
27
31
  {
28
32
  [name]: value,
29
33
  },
@@ -35,35 +39,35 @@ describe("CLI > Bundle > Overrides > applyKitBundleConfigOverrides", () => {
35
39
  });
36
40
  }
37
41
 
38
- test("changes entryPath using an override", () => {
39
- testOverride("entryPath", "out/entry.js");
42
+ test("changes entryFile using an override", () => {
43
+ testOverride("entryFile", "foo.js");
40
44
  });
41
45
 
42
- test("changes distPath using an override", () => {
43
- testOverride("distPath", "out");
46
+ test("changes bundleOutput using an override", () => {
47
+ testOverride("bundleOutput", "foo.bundle");
44
48
  });
45
49
 
46
- test("changes assetsPath using an override", () => {
47
- testOverride("assetsPath", "out/assets");
50
+ test("sets bundleEncoding using an override", () => {
51
+ testOverride("bundleEncoding", "utf8");
48
52
  });
49
53
 
50
- test("changes bundlePrefix using an override", () => {
51
- testOverride("bundlePrefix", "main");
54
+ test("sets sourcemapOutput using an override", () => {
55
+ testOverride("sourcemapOutput", "out/foo.map");
52
56
  });
53
57
 
54
- test("changes bundleEncoding using an override", () => {
55
- testOverride("bundleEncoding", "utf8");
58
+ test("sets sourcemapSourcesRoot using an override", () => {
59
+ testOverride("sourcemapSourcesRoot", "/myrepo/packags/foo");
56
60
  });
57
61
 
58
- test("changes sourcemapOutput using an override", () => {
59
- testOverride("sourcemapOutput", "out/entry.map");
62
+ test("changes sourcemapUseAbsolutePath using an override", () => {
63
+ testOverride("sourcemapUseAbsolutePath", true);
60
64
  });
61
65
 
62
- test("changes sourcemapSourcesRoot using an override", () => {
63
- testOverride("sourcemapSourcesRoot", "out");
66
+ test("sets assetsDest using an override", () => {
67
+ testOverride("assetsDest", "dist");
64
68
  });
65
69
 
66
70
  test("changes treeShake using an override", () => {
67
- testOverride("treeShake", true);
71
+ testOverride("treeShake", false);
68
72
  });
69
73
  });
@@ -5,6 +5,7 @@ import { assembleAarBundle } from "../../src/copy-assets";
5
5
 
6
6
  jest.mock("child_process");
7
7
  jest.mock("fs");
8
+ jest.unmock("@rnx-kit/console");
8
9
 
9
10
  export const options = {
10
11
  platform: "android" as const,
package/lib/types.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare type TypeScriptValidationOptions = {
2
- print?: (message: string) => void;
3
- throwOnError?: boolean;
4
- };
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
package/lib/types.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/src/types.ts DELETED
@@ -1,4 +0,0 @@
1
- export type TypeScriptValidationOptions = {
2
- print?: (message: string) => void;
3
- throwOnError?: boolean;
4
- };