@applicaster/zapplicaster-cli 15.0.0-rc.12 → 15.0.0-rc.121
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/package.json +5 -5
- package/src/commands/index.js +1 -1
- package/src/commands/prepareWorkspace/appBootstrapper.js +4 -0
- package/src/commands/prepareWorkspace/parseFonts.js +6 -0
- package/src/commands/publishPlugin/__tests__/configurator.test.js +3 -1
- package/src/commands/publishPlugin/__tests__/generateManifest.test.js +14 -5
- package/src/commands/publishPlugin/generateManifest.js +21 -3
- package/src/commands/publishPlugin/zappifestPublish.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapplicaster-cli",
|
|
3
|
-
"version": "15.0.0-rc.
|
|
3
|
+
"version": "15.0.0-rc.121",
|
|
4
4
|
"description": "CLI Tool for the zapp app and Quick Brick project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/zapp-react-dom-cli-template": "15.0.0-rc.
|
|
32
|
-
"@applicaster/zapp-react-native-android-tv-cli-template": "15.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-cli-template": "15.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-tvos-cli-template": "15.0.0-rc.
|
|
31
|
+
"@applicaster/zapp-react-dom-cli-template": "15.0.0-rc.121",
|
|
32
|
+
"@applicaster/zapp-react-native-android-tv-cli-template": "15.0.0-rc.121",
|
|
33
|
+
"@applicaster/zapp-react-native-cli-template": "15.0.0-rc.121",
|
|
34
|
+
"@applicaster/zapp-react-native-tvos-cli-template": "15.0.0-rc.121",
|
|
35
35
|
"axios": "^0.28.0",
|
|
36
36
|
"camelize": "^1.0.0",
|
|
37
37
|
"chalk": "^2.3.2",
|
package/src/commands/index.js
CHANGED
|
@@ -117,7 +117,7 @@ const commands = [
|
|
|
117
117
|
["-g, --skip-git", "Doesn't commit changes to git"],
|
|
118
118
|
[
|
|
119
119
|
"-s, --single-platform [singlePlatform]",
|
|
120
|
-
"Platform to deploy.
|
|
120
|
+
"Platform to deploy. Omit to publish for all supported platforms",
|
|
121
121
|
],
|
|
122
122
|
[
|
|
123
123
|
"-m, --manifest-only",
|
|
@@ -133,6 +133,12 @@ const defaultFonts = {
|
|
|
133
133
|
"Miso-Bold.ttf",
|
|
134
134
|
...commonFonts,
|
|
135
135
|
],
|
|
136
|
+
vizio: [
|
|
137
|
+
"Miso-Light.ttf",
|
|
138
|
+
"Miso-Regular.ttf",
|
|
139
|
+
"Miso-Bold.ttf",
|
|
140
|
+
...commonFonts,
|
|
141
|
+
],
|
|
136
142
|
samsung_tv: [
|
|
137
143
|
"SamsungOne-200.ttf",
|
|
138
144
|
"SamsungOne-300.ttf",
|
|
@@ -102,7 +102,9 @@ describe("publish plugin configurator", () => {
|
|
|
102
102
|
|
|
103
103
|
it("returns the configuration", async () => {
|
|
104
104
|
const options = getOptions();
|
|
105
|
-
|
|
105
|
+
const config = await configurator(options);
|
|
106
|
+
|
|
107
|
+
expect(config).toMatchSnapshot();
|
|
106
108
|
expect(logger.log.mock.calls).toMatchSnapshot();
|
|
107
109
|
});
|
|
108
110
|
|
|
@@ -42,9 +42,19 @@ function clearMocks() {
|
|
|
42
42
|
describe("generate manifest", () => {
|
|
43
43
|
beforeEach(clearMocks);
|
|
44
44
|
|
|
45
|
-
it("
|
|
45
|
+
it("throws if an invalid platform is provided", async () => {
|
|
46
|
+
const configuration = getConfig({
|
|
47
|
+
platforms: ["android", "invalid_platform"],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
await expect(generateManifest(configuration)).rejects.toThrow(
|
|
51
|
+
/Invalid platform provided/
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("doesn't create the manifest if there is no platform", async () => {
|
|
46
56
|
const configuration = getConfig({ platforms: undefined });
|
|
47
|
-
expect(generateManifest(configuration)).resolves.toBe(true);
|
|
57
|
+
await expect(generateManifest(configuration)).resolves.toBe(true);
|
|
48
58
|
expect(writeJsonToFile).not.toHaveBeenCalled();
|
|
49
59
|
});
|
|
50
60
|
|
|
@@ -91,12 +101,11 @@ describe("generate manifest", () => {
|
|
|
91
101
|
|
|
92
102
|
it("throws if the config file cannot be found", async () => {
|
|
93
103
|
const configuration = getConfig({ pluginPath: "resolve_error" });
|
|
94
|
-
|
|
95
|
-
expect(generateManifest(configuration)).rejects.toMatchSnapshot();
|
|
104
|
+
await expect(generateManifest(configuration)).rejects.toMatchSnapshot();
|
|
96
105
|
});
|
|
97
106
|
|
|
98
107
|
it("throws if the manifests cannot be written", async () => {
|
|
99
108
|
const configuration = getConfig({ pluginPath: "write_error" });
|
|
100
|
-
expect(generateManifest(configuration)).rejects.toMatchSnapshot();
|
|
109
|
+
await expect(generateManifest(configuration)).rejects.toMatchSnapshot();
|
|
101
110
|
});
|
|
102
111
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const R = require("ramda");
|
|
2
1
|
const { resolve } = require("path");
|
|
3
2
|
const { inspect } = require("util");
|
|
4
3
|
|
|
@@ -48,15 +47,34 @@ function renderManifest({
|
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
const validPlatforms = [
|
|
51
|
+
"lg_tv",
|
|
52
|
+
"samsung_tv",
|
|
53
|
+
"vizio",
|
|
54
|
+
"android_tv_for_quickbrick",
|
|
55
|
+
"amazon_fire_tv_for_quickbrick",
|
|
56
|
+
"tvos_for_quickbrick",
|
|
57
|
+
"android_for_quickbrick",
|
|
58
|
+
"ios_for_quickbrick",
|
|
59
|
+
"ios",
|
|
60
|
+
"android",
|
|
61
|
+
];
|
|
62
|
+
|
|
51
63
|
async function generateManifest(configuration) {
|
|
52
64
|
const { pluginPath, platforms, version, dryRun } = configuration;
|
|
53
65
|
|
|
54
66
|
if (!platforms) {
|
|
55
|
-
logger.log("Manifest does not
|
|
67
|
+
logger.log("Manifest does not exist, Skipping generation");
|
|
56
68
|
|
|
57
69
|
return true;
|
|
58
70
|
}
|
|
59
71
|
|
|
72
|
+
if (!platforms.every((platform) => validPlatforms.includes(platform))) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
`Invalid platform provided. Valid platforms are: ${validPlatforms.join(", ")}`
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
60
78
|
try {
|
|
61
79
|
const manifestConfig = require(
|
|
62
80
|
resolve(pluginPath, "manifests/manifest.config.js")
|
|
@@ -72,7 +90,7 @@ async function generateManifest(configuration) {
|
|
|
72
90
|
dryRun,
|
|
73
91
|
});
|
|
74
92
|
|
|
75
|
-
return Promise.all(
|
|
93
|
+
return Promise.all(platforms.map(manifestRenderer));
|
|
76
94
|
} catch (e) {
|
|
77
95
|
throw new Error(
|
|
78
96
|
"An error occured when generating the manifest: " + e.message
|