@applicaster/zapplicaster-cli 16.0.0-alpha.1740103407 → 16.0.0-alpha.1774022213

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 (24) hide show
  1. package/package.json +5 -5
  2. package/src/commands/prepareWorkspace/__tests__/__snapshots__/configurator.test.js.snap +2 -0
  3. package/src/commands/prepareWorkspace/appBootstrapper.js +9 -0
  4. package/src/commands/prepareWorkspace/configurator.js +26 -1
  5. package/src/commands/prepareWorkspace/parseFonts.js +6 -0
  6. package/src/commands/publishPlugin/__tests__/commitToGit.test.js +1 -1
  7. package/src/commands/publishPlugin/__tests__/configurator.test.js +2 -2
  8. package/src/commands/publishPlugin/__tests__/zappApi.test.js +268 -0
  9. package/src/commands/publishPlugin/__tests__/zappifestPublish.test.js +35 -32
  10. package/src/commands/publishPlugin/commitToGit.js +1 -1
  11. package/src/commands/publishPlugin/configurator.js +1 -1
  12. package/src/commands/publishPlugin/generateManifest.js +1 -0
  13. package/src/commands/publishPlugin/updateCorePluginsIfNeeded.js +22 -12
  14. package/src/commands/publishPlugin/zappApi.js +285 -0
  15. package/src/commands/publishPlugin/zappifestPublish.js +72 -7
  16. package/src/commands/reloadConfig/__tests__/__snapshots__/reloadConfig.test.js.snap +58 -0
  17. package/src/commands/reloadConfig/__tests__/reloadConfig.test.js +86 -0
  18. package/src/commands/reloadConfig/index.js +6 -6
  19. package/src/download/__tests__/download.test.js +53 -0
  20. package/src/download/index.js +65 -1
  21. package/src/file/index.js +15 -9
  22. package/src/templates/__tests__/__snapshots__/templates.test.js.snap +1 -1
  23. package/src/templates/index.js +1 -0
  24. package/src/commands/publishPlugin/__tests__/__snapshots__/zappifestPublish.test.js.snap +0 -5
package/src/file/index.js CHANGED
@@ -61,8 +61,13 @@ function destinationFileNameMapper(destinationFileName) {
61
61
  /**
62
62
  * Copies an array of files from a folder to another
63
63
  *
64
+ * Each entry can either be a string (same relative path for source and
65
+ * destination) or an object `{ source, destination }` when a file should be
66
+ * read from one relative path and written to another. The latter lets several
67
+ * platforms reuse a single set of bundled assets without duplicating them.
68
+ *
64
69
  * @param {String} source folder of the files
65
- * @param {String[]} files list of the files
70
+ * @param {(String|{source: String, destination: String})[]} files list of the files
66
71
  * @param {String} destination path
67
72
  * @returns {Promise[]} array of promises with the status of the copied files
68
73
  */
@@ -72,14 +77,15 @@ function copyFiles(source, filesOrFilesGetter, destination, config) {
72
77
  ? filesOrFilesGetter(config)
73
78
  : filesOrFilesGetter;
74
79
 
75
- return R.map(
76
- (file) =>
77
- copyFileSync(
78
- join(source, file),
79
- destinationFileNameMapper(join(destination, file))
80
- ),
81
- files
82
- );
80
+ return R.map((file) => {
81
+ const sourceFile = typeof file === "string" ? file : file.source;
82
+ const destinationFile = typeof file === "string" ? file : file.destination;
83
+
84
+ return copyFileSync(
85
+ join(source, sourceFile),
86
+ destinationFileNameMapper(join(destination, destinationFile))
87
+ );
88
+ }, files);
83
89
  }
84
90
 
85
91
  module.exports = {
@@ -32,4 +32,4 @@ exports[`resolveAppTemplate retrieves the template from the provided path if pro
32
32
  }
33
33
  `;
34
34
 
35
- exports[`resolveAppTemplate throws if resolving a template for an unknown platform 1`] = `"could not find template for foo - available templates: ios,android,samsung_tv,lg_tv,vizio,apple_tv,android_tv,amazon"`;
35
+ exports[`resolveAppTemplate throws if resolving a template for an unknown platform 1`] = `"could not find template for foo - available templates: ios,android,samsung_tv,lg_tv,vidaa,vizio,apple_tv,android_tv,amazon"`;
@@ -27,6 +27,7 @@ const templatesMap = {
27
27
  android: "@applicaster/zapp-react-native-cli-template",
28
28
  samsung_tv: "@applicaster/zapp-react-dom-cli-template",
29
29
  lg_tv: "@applicaster/zapp-react-dom-cli-template",
30
+ vidaa: "@applicaster/zapp-react-dom-cli-template",
30
31
  vizio: "@applicaster/zapp-react-dom-cli-template",
31
32
  apple_tv: "@applicaster/zapp-react-native-tvos-cli-template",
32
33
  android_tv: "@applicaster/zapp-react-native-android-tv-cli-template",
@@ -1,5 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`publish zappifests it throws if a manifest cannot be found 1`] = `[Error: cannot resolve manifest]`;
4
-
5
- exports[`publish zappifests it throws if the zappifest command fails 1`] = `[Error: zappifest failed]`;