@applicaster/zapplicaster-cli 15.0.0-alpha.6141436051 → 15.0.0-alpha.6351072502
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 +5 -1
- package/src/commands/prepareWorkspace/parseFonts.js +6 -0
- package/src/commands/publishPlugin/__tests__/__snapshots__/configurator.test.js.snap +3 -0
- package/src/commands/publishPlugin/__tests__/configurator.test.js +1 -0
- package/src/commands/publishPlugin/__tests__/generateManifest.test.js +14 -5
- package/src/commands/publishPlugin/configurator.js +6 -0
- package/src/commands/publishPlugin/generateManifest.js +24 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapplicaster-cli",
|
|
3
|
-
"version": "15.0.0-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.6351072502",
|
|
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-alpha.
|
|
32
|
-
"@applicaster/zapp-react-native-android-tv-cli-template": "15.0.0-alpha.
|
|
33
|
-
"@applicaster/zapp-react-native-cli-template": "15.0.0-alpha.
|
|
34
|
-
"@applicaster/zapp-react-native-tvos-cli-template": "15.0.0-alpha.
|
|
31
|
+
"@applicaster/zapp-react-dom-cli-template": "15.0.0-alpha.6351072502",
|
|
32
|
+
"@applicaster/zapp-react-native-android-tv-cli-template": "15.0.0-alpha.6351072502",
|
|
33
|
+
"@applicaster/zapp-react-native-cli-template": "15.0.0-alpha.6351072502",
|
|
34
|
+
"@applicaster/zapp-react-native-tvos-cli-template": "15.0.0-alpha.6351072502",
|
|
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,12 +117,16 @@ 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",
|
|
124
124
|
"Only generates the manifest file, doesn't publish the plugin",
|
|
125
125
|
],
|
|
126
|
+
[
|
|
127
|
+
"-t, --targets [targets]",
|
|
128
|
+
"Comma-separated list of targets (e.g., 'tv,mobile,tablet') for iterative releases",
|
|
129
|
+
],
|
|
126
130
|
],
|
|
127
131
|
action: publishPlugin,
|
|
128
132
|
},
|
|
@@ -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",
|
|
@@ -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
|
});
|
|
@@ -74,6 +74,7 @@ async function configurator({ cliArgs, cliOptions }) {
|
|
|
74
74
|
singlePlatform: platform = "",
|
|
75
75
|
skipGit = false,
|
|
76
76
|
manifestOnly = false,
|
|
77
|
+
targets,
|
|
77
78
|
} = cliOptions;
|
|
78
79
|
|
|
79
80
|
if (!version || !semver.valid(version)) {
|
|
@@ -121,6 +122,10 @@ async function configurator({ cliArgs, cliOptions }) {
|
|
|
121
122
|
);
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
const parsedTargets = targets
|
|
126
|
+
? targets.split(",").map((t) => t.trim())
|
|
127
|
+
: undefined;
|
|
128
|
+
|
|
124
129
|
const config = {
|
|
125
130
|
pluginPath: resolvedPluginPath,
|
|
126
131
|
pluginPackageJson,
|
|
@@ -133,6 +138,7 @@ async function configurator({ cliArgs, cliOptions }) {
|
|
|
133
138
|
skipGit,
|
|
134
139
|
zappOwnerAccountId,
|
|
135
140
|
manifestOnly,
|
|
141
|
+
targets: parsedTargets,
|
|
136
142
|
};
|
|
137
143
|
|
|
138
144
|
return config;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const R = require("ramda");
|
|
2
1
|
const { resolve } = require("path");
|
|
3
2
|
const { inspect } = require("util");
|
|
4
3
|
|
|
@@ -27,9 +26,10 @@ function renderManifest({
|
|
|
27
26
|
pluginPath,
|
|
28
27
|
version,
|
|
29
28
|
dryRun,
|
|
29
|
+
targets,
|
|
30
30
|
}) {
|
|
31
31
|
return async function (platform) {
|
|
32
|
-
const manifest = manifestConfig({ platform, version });
|
|
32
|
+
const manifest = manifestConfig({ platform, version, targets });
|
|
33
33
|
|
|
34
34
|
const enrichedManifest = enrichManifest({ manifest, packageJson });
|
|
35
35
|
|
|
@@ -48,8 +48,21 @@ function renderManifest({
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
const validPlatforms = [
|
|
52
|
+
"lg_tv",
|
|
53
|
+
"samsung_tv",
|
|
54
|
+
"vizio",
|
|
55
|
+
"android_tv_for_quickbrick",
|
|
56
|
+
"amazon_fire_tv_for_quickbrick",
|
|
57
|
+
"tvos_for_quickbrick",
|
|
58
|
+
"android_for_quickbrick",
|
|
59
|
+
"ios_for_quickbrick",
|
|
60
|
+
"ios",
|
|
61
|
+
"android",
|
|
62
|
+
];
|
|
63
|
+
|
|
51
64
|
async function generateManifest(configuration) {
|
|
52
|
-
const { pluginPath, platforms, version, dryRun } = configuration;
|
|
65
|
+
const { pluginPath, platforms, version, dryRun, targets } = configuration;
|
|
53
66
|
|
|
54
67
|
if (!platforms) {
|
|
55
68
|
logger.log("Manifest does not exsist, Skipping generation");
|
|
@@ -57,6 +70,12 @@ async function generateManifest(configuration) {
|
|
|
57
70
|
return true;
|
|
58
71
|
}
|
|
59
72
|
|
|
73
|
+
if (!platforms.every((platform) => validPlatforms.includes(platform))) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
`Invalid platform provided. Valid platforms are: ${validPlatforms.join(", ")}`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
60
79
|
try {
|
|
61
80
|
const manifestConfig = require(
|
|
62
81
|
resolve(pluginPath, "manifests/manifest.config.js")
|
|
@@ -70,9 +89,10 @@ async function generateManifest(configuration) {
|
|
|
70
89
|
packageJson,
|
|
71
90
|
version,
|
|
72
91
|
dryRun,
|
|
92
|
+
targets,
|
|
73
93
|
});
|
|
74
94
|
|
|
75
|
-
return Promise.all(
|
|
95
|
+
return Promise.all(platforms.map(manifestRenderer));
|
|
76
96
|
} catch (e) {
|
|
77
97
|
throw new Error(
|
|
78
98
|
"An error occured when generating the manifest: " + e.message
|