@applicaster/zapplicaster-cli 15.0.0-alpha.1602457009 → 15.0.0-alpha.1634008915
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 -5
- package/src/commands/prepareWorkspace/appBootstrapper.js +4 -0
- package/src/commands/publishPlugin/__tests__/__snapshots__/configurator.test.js.snap +0 -3
- package/src/commands/publishPlugin/__tests__/configurator.test.js +3 -2
- package/src/commands/publishPlugin/__tests__/generateManifest.test.js +14 -5
- package/src/commands/publishPlugin/configurator.js +0 -6
- package/src/commands/publishPlugin/generateManifest.js +23 -7
- 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-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.1634008915",
|
|
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.1634008915",
|
|
32
|
+
"@applicaster/zapp-react-native-android-tv-cli-template": "15.0.0-alpha.1634008915",
|
|
33
|
+
"@applicaster/zapp-react-native-cli-template": "15.0.0-alpha.1634008915",
|
|
34
|
+
"@applicaster/zapp-react-native-tvos-cli-template": "15.0.0-alpha.1634008915",
|
|
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,16 +117,12 @@ 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
|
-
],
|
|
130
126
|
],
|
|
131
127
|
action: publishPlugin,
|
|
132
128
|
},
|
|
@@ -10,7 +10,6 @@ const getOptions = (opts = {}) => ({
|
|
|
10
10
|
version: "1.5.0",
|
|
11
11
|
singlePlatform: "",
|
|
12
12
|
skipGit: false,
|
|
13
|
-
targets: "tv",
|
|
14
13
|
...opts,
|
|
15
14
|
},
|
|
16
15
|
});
|
|
@@ -103,7 +102,9 @@ describe("publish plugin configurator", () => {
|
|
|
103
102
|
|
|
104
103
|
it("returns the configuration", async () => {
|
|
105
104
|
const options = getOptions();
|
|
106
|
-
|
|
105
|
+
const config = await configurator(options);
|
|
106
|
+
|
|
107
|
+
expect(config).toMatchSnapshot();
|
|
107
108
|
expect(logger.log.mock.calls).toMatchSnapshot();
|
|
108
109
|
});
|
|
109
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
|
});
|
|
@@ -74,7 +74,6 @@ async function configurator({ cliArgs, cliOptions }) {
|
|
|
74
74
|
singlePlatform: platform = "",
|
|
75
75
|
skipGit = false,
|
|
76
76
|
manifestOnly = false,
|
|
77
|
-
targets,
|
|
78
77
|
} = cliOptions;
|
|
79
78
|
|
|
80
79
|
if (!version || !semver.valid(version)) {
|
|
@@ -122,10 +121,6 @@ async function configurator({ cliArgs, cliOptions }) {
|
|
|
122
121
|
);
|
|
123
122
|
}
|
|
124
123
|
|
|
125
|
-
const parsedTargets = targets
|
|
126
|
-
? targets.split(",").map((t) => t.trim())
|
|
127
|
-
: undefined;
|
|
128
|
-
|
|
129
124
|
const config = {
|
|
130
125
|
pluginPath: resolvedPluginPath,
|
|
131
126
|
pluginPackageJson,
|
|
@@ -138,7 +133,6 @@ async function configurator({ cliArgs, cliOptions }) {
|
|
|
138
133
|
skipGit,
|
|
139
134
|
zappOwnerAccountId,
|
|
140
135
|
manifestOnly,
|
|
141
|
-
targets: parsedTargets,
|
|
142
136
|
};
|
|
143
137
|
|
|
144
138
|
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,10 +26,9 @@ function renderManifest({
|
|
|
27
26
|
pluginPath,
|
|
28
27
|
version,
|
|
29
28
|
dryRun,
|
|
30
|
-
targets,
|
|
31
29
|
}) {
|
|
32
30
|
return async function (platform) {
|
|
33
|
-
const manifest = manifestConfig({ platform, version
|
|
31
|
+
const manifest = manifestConfig({ platform, version });
|
|
34
32
|
|
|
35
33
|
const enrichedManifest = enrichManifest({ manifest, packageJson });
|
|
36
34
|
|
|
@@ -49,15 +47,34 @@ function renderManifest({
|
|
|
49
47
|
};
|
|
50
48
|
}
|
|
51
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
|
+
|
|
52
63
|
async function generateManifest(configuration) {
|
|
53
|
-
const { pluginPath, platforms, version, dryRun
|
|
64
|
+
const { pluginPath, platforms, version, dryRun } = configuration;
|
|
54
65
|
|
|
55
66
|
if (!platforms) {
|
|
56
|
-
logger.log("Manifest does not
|
|
67
|
+
logger.log("Manifest does not exist, Skipping generation");
|
|
57
68
|
|
|
58
69
|
return true;
|
|
59
70
|
}
|
|
60
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
|
+
|
|
61
78
|
try {
|
|
62
79
|
const manifestConfig = require(
|
|
63
80
|
resolve(pluginPath, "manifests/manifest.config.js")
|
|
@@ -71,10 +88,9 @@ async function generateManifest(configuration) {
|
|
|
71
88
|
packageJson,
|
|
72
89
|
version,
|
|
73
90
|
dryRun,
|
|
74
|
-
targets,
|
|
75
91
|
});
|
|
76
92
|
|
|
77
|
-
return Promise.all(
|
|
93
|
+
return Promise.all(platforms.map(manifestRenderer));
|
|
78
94
|
} catch (e) {
|
|
79
95
|
throw new Error(
|
|
80
96
|
"An error occured when generating the manifest: " + e.message
|