@applicaster/zapplicaster-cli 15.0.0-rc.98 → 15.1.0-alpha.2915689988

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapplicaster-cli",
3
- "version": "15.0.0-rc.98",
3
+ "version": "15.1.0-alpha.2915689988",
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.98",
32
- "@applicaster/zapp-react-native-android-tv-cli-template": "15.0.0-rc.98",
33
- "@applicaster/zapp-react-native-cli-template": "15.0.0-rc.98",
34
- "@applicaster/zapp-react-native-tvos-cli-template": "15.0.0-rc.98",
31
+ "@applicaster/zapp-react-dom-cli-template": "15.1.0-alpha.2915689988",
32
+ "@applicaster/zapp-react-native-android-tv-cli-template": "15.1.0-alpha.2915689988",
33
+ "@applicaster/zapp-react-native-cli-template": "15.1.0-alpha.2915689988",
34
+ "@applicaster/zapp-react-native-tvos-cli-template": "15.1.0-alpha.2915689988",
35
35
  "axios": "^0.28.0",
36
36
  "camelize": "^1.0.0",
37
37
  "chalk": "^2.3.2",
@@ -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. Omit to publish for all supported platforms",
120
+ "Platform to deploy. Ommit 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
  },
@@ -82,6 +82,10 @@ const toDayJSLocaleMap = (code) => {
82
82
  tt: null,
83
83
  "es-LA": "es",
84
84
  "en-UK": "en-gb",
85
+ "en-ZA": null,
86
+ "en-NG": null,
87
+ "en-ZW": null,
88
+ "en-ZM": null,
85
89
  };
86
90
 
87
91
  if (map[code] === null) {
@@ -22,9 +22,6 @@ exports[`publish plugin configurator returns the configuration 1`] = `
22
22
  },
23
23
  "pluginPath": "plugins/my-plugin",
24
24
  "skipGit": false,
25
- "targets": [
26
- "tv",
27
- ],
28
25
  "verbose": false,
29
26
  "version": "1.5.0",
30
27
  "yarn": false,
@@ -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
- expect(await configurator(options)).toMatchSnapshot();
105
+ const config = await configurator(options);
106
+
107
+ expect(config).toMatchSnapshot();
107
108
  expect(logger.log.mock.calls).toMatchSnapshot();
108
109
  });
109
110
 
@@ -42,19 +42,9 @@ function clearMocks() {
42
42
  describe("generate manifest", () => {
43
43
  beforeEach(clearMocks);
44
44
 
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 () => {
45
+ it("doesn't create the manifest if there is no platform", () => {
56
46
  const configuration = getConfig({ platforms: undefined });
57
- await expect(generateManifest(configuration)).resolves.toBe(true);
47
+ expect(generateManifest(configuration)).resolves.toBe(true);
58
48
  expect(writeJsonToFile).not.toHaveBeenCalled();
59
49
  });
60
50
 
@@ -101,11 +91,12 @@ describe("generate manifest", () => {
101
91
 
102
92
  it("throws if the config file cannot be found", async () => {
103
93
  const configuration = getConfig({ pluginPath: "resolve_error" });
104
- await expect(generateManifest(configuration)).rejects.toMatchSnapshot();
94
+
95
+ expect(generateManifest(configuration)).rejects.toMatchSnapshot();
105
96
  });
106
97
 
107
98
  it("throws if the manifests cannot be written", async () => {
108
99
  const configuration = getConfig({ pluginPath: "write_error" });
109
- await expect(generateManifest(configuration)).rejects.toMatchSnapshot();
100
+ expect(generateManifest(configuration)).rejects.toMatchSnapshot();
110
101
  });
111
102
  });
@@ -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,3 +1,4 @@
1
+ const R = require("ramda");
1
2
  const { resolve } = require("path");
2
3
  const { inspect } = require("util");
3
4
 
@@ -26,10 +27,9 @@ function renderManifest({
26
27
  pluginPath,
27
28
  version,
28
29
  dryRun,
29
- targets,
30
30
  }) {
31
31
  return async function (platform) {
32
- const manifest = manifestConfig({ platform, version, targets });
32
+ const manifest = manifestConfig({ platform, version });
33
33
 
34
34
  const enrichedManifest = enrichManifest({ manifest, packageJson });
35
35
 
@@ -48,34 +48,15 @@ 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
-
64
51
  async function generateManifest(configuration) {
65
- const { pluginPath, platforms, version, dryRun, targets } = configuration;
52
+ const { pluginPath, platforms, version, dryRun } = configuration;
66
53
 
67
54
  if (!platforms) {
68
- logger.log("Manifest does not exsist, Skipping generation");
55
+ logger.log("Manifest does not exist, Skipping generation");
69
56
 
70
57
  return true;
71
58
  }
72
59
 
73
- if (!platforms.every((platform) => validPlatforms.includes(platform))) {
74
- throw new Error(
75
- `Invalid platform provided. Valid platforms are: ${validPlatforms.join(", ")}`
76
- );
77
- }
78
-
79
60
  try {
80
61
  const manifestConfig = require(
81
62
  resolve(pluginPath, "manifests/manifest.config.js")
@@ -89,10 +70,9 @@ async function generateManifest(configuration) {
89
70
  packageJson,
90
71
  version,
91
72
  dryRun,
92
- targets,
93
73
  });
94
74
 
95
- return Promise.all(platforms.map(manifestRenderer));
75
+ return Promise.all(R.map(manifestRenderer, platforms));
96
76
  } catch (e) {
97
77
  throw new Error(
98
78
  "An error occured when generating the manifest: " + e.message
@@ -37,7 +37,7 @@ async function zappifestPublish(configuration) {
37
37
  }
38
38
 
39
39
  if (!platforms || !zappOwnerAccountId) {
40
- logger.log("Manifest does not exsist, Skipping publishing");
40
+ logger.log("Manifest does not exist, Skipping publishing");
41
41
 
42
42
  return true;
43
43
  }