@applicaster/zapplicaster-cli 13.0.0-alpha.1338463240 → 13.0.0-alpha.1354246175
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 +32 -37
- package/src/commands/migrateZappPlugin/__tests__/__snapshots__/migrateZappPlugin.test.js.snap +5 -5
- package/src/commands/prepareWorkspace/__tests__/__snapshots__/appBootstrapper.test.js.snap +2 -2
- package/src/commands/prepareWorkspace/__tests__/__snapshots__/configurator.test.js.snap +6 -6
- package/src/commands/prepareWorkspace/__tests__/__snapshots__/prepareWorkspace.test.js.snap +22 -22
- package/src/commands/prepareWorkspace/__tests__/__snapshots__/workspaceCreator.test.js.snap +16 -16
- package/src/commands/prepareWorkspace/appBootstrapper.js +8 -6
- package/src/commands/publishPlugin/__tests__/__snapshots__/configurator.test.js.snap +7 -7
- package/src/commands/publishPlugin/__tests__/__snapshots__/generateManifest.test.js.snap +5 -5
- package/src/commands/publishPlugin/__tests__/__snapshots__/publishPlugin.test.js.snap +27 -27
- package/src/commands/publishPlugin/__tests__/npmPublish.test.js +8 -6
- package/src/commands/publishPlugin/generateManifest.js +3 -4
- package/src/commands/publishPlugin/updateCorePluginsIfNeeded.js +6 -9
- package/src/file/__tests__/__snapshots__/file.test.js.snap +6 -6
- package/src/logger/__tests__/loggerError.test.js +4 -6
- package/src/plugins/__tests__/__snapshots__/plugins.test.js.snap +10 -10
- package/src/plugins/__tests__/plugins.test.js +1 -1
- package/src/render/__tests__/fixtures/packageWithDependencies/package.json +0 -3
- package/src/render/__tests__/render.test.js +6 -8
- package/src/settings/__tests__/settings.test.js +3 -4
- package/src/shell/__tests__/__snapshots__/shell.test.js.snap +3 -3
- package/src/taskRunner/__tests__/taskRunner.test.js +1 -1
- package/src/templates/__tests__/__snapshots__/templates.test.js.snap +6 -6
- package/src/templates/newWorkspaceTemplate/index.js +0 -13
- package/src/zapp/__tests__/zapp.test.js +7 -9
- package/src/logger/__tests__/__snapshots__/loggerError.test.js.snap +0 -22
- package/src/zapp/__tests__/__snapshots__/zapp.test.js.snap +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapplicaster-cli",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.1354246175",
|
|
4
4
|
"description": "CLI Tool for the zapp app and Quick Brick project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,10 +11,6 @@
|
|
|
11
11
|
"yarn": "^1.3.2"
|
|
12
12
|
},
|
|
13
13
|
"bin": "./index.js",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "node_modules/.bin/jest -w=2",
|
|
16
|
-
"coverage": "node_modules/.bin/jest --coverage"
|
|
17
|
-
},
|
|
18
14
|
"repository": {
|
|
19
15
|
"type": "git",
|
|
20
16
|
"url": "git+ssh://git@github.com/applicaster/quickbrick.git"
|
|
@@ -32,49 +28,48 @@
|
|
|
32
28
|
},
|
|
33
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
34
30
|
"dependencies": {
|
|
35
|
-
"@applicaster/zapp-react-dom-cli-template": "13.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-android-tv-cli-template": "13.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-cli-template": "13.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-tvos-cli-template": "13.0.0-alpha.
|
|
31
|
+
"@applicaster/zapp-react-dom-cli-template": "13.0.0-alpha.1354246175",
|
|
32
|
+
"@applicaster/zapp-react-native-android-tv-cli-template": "13.0.0-alpha.1354246175",
|
|
33
|
+
"@applicaster/zapp-react-native-cli-template": "13.0.0-alpha.1354246175",
|
|
34
|
+
"@applicaster/zapp-react-native-tvos-cli-template": "13.0.0-alpha.1354246175",
|
|
39
35
|
"axios": "^0.28.0",
|
|
40
36
|
"camelize": "^1.0.0",
|
|
41
37
|
"chalk": "^2.3.2",
|
|
42
38
|
"commander": "^2.15.1",
|
|
43
39
|
"ejs": "3.1.10",
|
|
44
40
|
"inquirer": "^7.0.5",
|
|
41
|
+
"lodash": "4.17.21",
|
|
45
42
|
"ramda": "0.26.1",
|
|
46
43
|
"semver": "^7.5.2",
|
|
47
44
|
"shelljs": "^0.8.1",
|
|
48
45
|
"simple-git": "^3.16.0"
|
|
49
46
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
],
|
|
77
|
-
"testEnvironment": "node"
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@applicaster/applicaster-types": "*",
|
|
49
|
+
"@applicaster/blur": "*",
|
|
50
|
+
"@applicaster/quick-brick-xray": "*",
|
|
51
|
+
"@applicaster/react-native-color-thief": "*",
|
|
52
|
+
"@applicaster/zapp-react-dom-ui-components": "*",
|
|
53
|
+
"@applicaster/zapp-react-native-redux": "*",
|
|
54
|
+
"@applicaster/zapp-react-native-tvos-app": "*",
|
|
55
|
+
"@applicaster/zapp-react-native-tvos-ui-components": "*",
|
|
56
|
+
"@babel/runtime": "*",
|
|
57
|
+
"@react-native-community/netinfo": "*",
|
|
58
|
+
"core-js": "*",
|
|
59
|
+
"immer": "*",
|
|
60
|
+
"react": "*",
|
|
61
|
+
"react-dom": "*",
|
|
62
|
+
"react-native": "*",
|
|
63
|
+
"react-native-fs": "*",
|
|
64
|
+
"react-native-gesture-handler": "*",
|
|
65
|
+
"react-native-linear-gradient": "*",
|
|
66
|
+
"react-native-safe-area-context": "*",
|
|
67
|
+
"react-native-svg": "*",
|
|
68
|
+
"react-native-web": "*",
|
|
69
|
+
"react-native-webview": "*",
|
|
70
|
+
"uglify-js": "*",
|
|
71
|
+
"validate-color": "*",
|
|
72
|
+
"zustand": "*"
|
|
78
73
|
},
|
|
79
74
|
"gitHead": "a473487564142c55cdb50f02505cf0b60fe75658"
|
|
80
75
|
}
|
package/src/commands/migrateZappPlugin/__tests__/__snapshots__/migrateZappPlugin.test.js.snap
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`migrateZappPlugin returns the properly formatted command object 1`] = `
|
|
4
|
-
|
|
4
|
+
{
|
|
5
5
|
"configurator": [MockFunction],
|
|
6
6
|
"name": "migrate Zapp Plugin",
|
|
7
7
|
"startMessage": "We're updating your plugin to be compatible with QuickBrick",
|
|
8
|
-
"steps":
|
|
9
|
-
|
|
8
|
+
"steps": [
|
|
9
|
+
{
|
|
10
10
|
"completion": "Done !",
|
|
11
11
|
"error": "Could not update your package.json",
|
|
12
12
|
"run": [MockFunction],
|
|
13
13
|
"start": "Updating package.json",
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
{
|
|
16
16
|
"completion": "Done !",
|
|
17
17
|
"error": "Could not create the plugin entry point",
|
|
18
18
|
"run": [MockFunction],
|
|
19
19
|
"start": "Creating plugin entry point",
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
{
|
|
22
22
|
"completion": "Your plugin is ready ! Simply publish it to npm, and it will be ready to use in any QuickBrick app",
|
|
23
23
|
"error": "Could not update Zappifest ! please update it manually by refering to https://developer-zapp.applicaster.com/quick-brick/migration-guide.html",
|
|
24
24
|
"run": [MockFunction],
|
|
@@ -454,8 +454,8 @@ Array [
|
|
|
454
454
|
exports[`appBootstrapper throws if npm install fails 1`] = `[Error: Couldn't not install npm dependencies !]`;
|
|
455
455
|
|
|
456
456
|
exports[`appBootstrapper uses yarn to install if provided in the options 1`] = `
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
[
|
|
458
|
+
[
|
|
459
459
|
"cd path/to/workspace && yarn",
|
|
460
460
|
],
|
|
461
461
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`configurator builds the configuration object 1`] = `
|
|
4
|
-
|
|
4
|
+
{
|
|
5
5
|
"appVersionId": "APP_VERSION_ID",
|
|
6
6
|
"buildMobile": undefined,
|
|
7
|
-
"buildParams":
|
|
7
|
+
"buildParams": {
|
|
8
8
|
"appVersionId": "APP_VERSION_ID",
|
|
9
9
|
"assets_url": "https://assets-secure.applicaster.com/zapp/accounts/5ae06cef8fba0f00084bd3c6/apps/com.quickbricktest/apple_store/1.8/styles/assets_styles.json",
|
|
10
10
|
"otherParam": "param",
|
|
@@ -15,7 +15,7 @@ Object {
|
|
|
15
15
|
"openSdk": false,
|
|
16
16
|
"platform": "ios",
|
|
17
17
|
"spinnerColor": undefined,
|
|
18
|
-
"template":
|
|
18
|
+
"template": {
|
|
19
19
|
"foo": "bar",
|
|
20
20
|
},
|
|
21
21
|
"verbose": false,
|
|
@@ -25,10 +25,10 @@ Object {
|
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
exports[`configurator sets a null path if none is provided and the cli doesn't run in zapp RN repo 1`] = `
|
|
28
|
-
|
|
28
|
+
{
|
|
29
29
|
"appVersionId": "APP_VERSION_ID",
|
|
30
30
|
"buildMobile": undefined,
|
|
31
|
-
"buildParams":
|
|
31
|
+
"buildParams": {
|
|
32
32
|
"appVersionId": "APP_VERSION_ID",
|
|
33
33
|
"assets_url": "https://assets-secure.applicaster.com/zapp/accounts/5ae06cef8fba0f00084bd3c6/apps/com.quickbricktest/apple_store/1.8/styles/assets_styles.json",
|
|
34
34
|
"otherParam": "param",
|
|
@@ -39,7 +39,7 @@ Object {
|
|
|
39
39
|
"openSdk": false,
|
|
40
40
|
"platform": "ios",
|
|
41
41
|
"spinnerColor": undefined,
|
|
42
|
-
"template":
|
|
42
|
+
"template": {
|
|
43
43
|
"foo": "bar",
|
|
44
44
|
},
|
|
45
45
|
"verbose": false,
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`prepareWorkspace runs the task 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
6
|
"prepare workspace",
|
|
7
7
|
"We're preparing your app - you'll be happily coding in no time !",
|
|
8
8
|
],
|
|
9
9
|
]
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
|
-
exports[`prepareWorkspace runs the task 2`] = `
|
|
12
|
+
exports[`prepareWorkspace runs the task 2`] = `[]`;
|
|
13
13
|
|
|
14
|
-
exports[`prepareWorkspace runs the task 3`] = `
|
|
14
|
+
exports[`prepareWorkspace runs the task 3`] = `[]`;
|
|
15
15
|
|
|
16
|
-
exports[`prepareWorkspace runs the task 4`] = `
|
|
16
|
+
exports[`prepareWorkspace runs the task 4`] = `[]`;
|
|
17
17
|
|
|
18
18
|
exports[`prepareWorkspace runs the task 5`] = `
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
[
|
|
20
|
+
[
|
|
21
21
|
"checking prerequisites...",
|
|
22
22
|
],
|
|
23
|
-
|
|
23
|
+
[
|
|
24
24
|
"Gathering configuration",
|
|
25
25
|
],
|
|
26
|
-
|
|
26
|
+
[
|
|
27
27
|
"Creating workspace",
|
|
28
28
|
],
|
|
29
|
-
|
|
29
|
+
[
|
|
30
30
|
"Creating runtime URLs configuration file",
|
|
31
31
|
],
|
|
32
|
-
|
|
32
|
+
[
|
|
33
33
|
"Retrieving configuration files",
|
|
34
34
|
],
|
|
35
|
-
|
|
35
|
+
[
|
|
36
36
|
"Bootstraping app project",
|
|
37
37
|
],
|
|
38
|
-
|
|
38
|
+
[
|
|
39
39
|
"Checking workspace dependencies",
|
|
40
40
|
],
|
|
41
41
|
]
|
|
42
42
|
`;
|
|
43
43
|
|
|
44
44
|
exports[`prepareWorkspace runs the task 6`] = `
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
[
|
|
46
|
+
[
|
|
47
47
|
"All good - moving on",
|
|
48
48
|
],
|
|
49
|
-
|
|
49
|
+
[
|
|
50
50
|
"configuration retrieved",
|
|
51
51
|
],
|
|
52
|
-
|
|
52
|
+
[
|
|
53
53
|
"Workspace created !",
|
|
54
54
|
],
|
|
55
|
-
|
|
55
|
+
[
|
|
56
56
|
"Runtime configuration URLs file created",
|
|
57
57
|
],
|
|
58
|
-
|
|
58
|
+
[
|
|
59
59
|
"Configuration files retrieved !",
|
|
60
60
|
],
|
|
61
|
-
|
|
61
|
+
[
|
|
62
62
|
"Successfully bootstrapped the app!",
|
|
63
63
|
],
|
|
64
|
-
|
|
64
|
+
[
|
|
65
65
|
"Your app is ready!",
|
|
66
66
|
],
|
|
67
67
|
]
|
|
68
68
|
`;
|
|
69
69
|
|
|
70
|
-
exports[`prepareWorkspace runs the task 7`] = `
|
|
70
|
+
exports[`prepareWorkspace runs the task 7`] = `[]`;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`workspaceCreator creates the directories if they don't exist 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
6
|
"path/to/workspace",
|
|
7
7
|
],
|
|
8
|
-
|
|
8
|
+
[
|
|
9
9
|
"path/to/workspace/config/ios",
|
|
10
10
|
],
|
|
11
|
-
|
|
11
|
+
[
|
|
12
12
|
"path/to/workspace/config",
|
|
13
13
|
],
|
|
14
|
-
|
|
14
|
+
[
|
|
15
15
|
"path/to/workspace/fonts/ios",
|
|
16
16
|
],
|
|
17
|
-
|
|
17
|
+
[
|
|
18
18
|
"path/to/workspace/fonts",
|
|
19
19
|
],
|
|
20
|
-
|
|
20
|
+
[
|
|
21
21
|
"path/to/workspace",
|
|
22
22
|
],
|
|
23
|
-
|
|
23
|
+
[
|
|
24
24
|
"path/to/workspace/assets/ios",
|
|
25
25
|
],
|
|
26
|
-
|
|
26
|
+
[
|
|
27
27
|
"path/to/workspace/assets",
|
|
28
28
|
],
|
|
29
|
-
|
|
29
|
+
[
|
|
30
30
|
"path/to/workspace",
|
|
31
31
|
],
|
|
32
32
|
]
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
35
|
exports[`workspaceCreator creates the directories if they don't exist 2`] = `
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
[
|
|
37
|
+
[
|
|
38
38
|
"path/to/workspace/config/ios",
|
|
39
39
|
],
|
|
40
|
-
|
|
40
|
+
[
|
|
41
41
|
"path/to/workspace/fonts",
|
|
42
42
|
],
|
|
43
|
-
|
|
43
|
+
[
|
|
44
44
|
"path/to/workspace/fonts/ios",
|
|
45
45
|
],
|
|
46
|
-
|
|
46
|
+
[
|
|
47
47
|
"path/to/workspace/assets",
|
|
48
48
|
],
|
|
49
|
-
|
|
49
|
+
[
|
|
50
50
|
"path/to/workspace/assets/ios",
|
|
51
51
|
],
|
|
52
52
|
]
|
|
@@ -83,12 +83,14 @@ async function appBootstrapper(configuration) {
|
|
|
83
83
|
logger.log("injecting dependencies...");
|
|
84
84
|
const { dependencies, scripts } = template;
|
|
85
85
|
|
|
86
|
-
const pluginConfigurations = require(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
const pluginConfigurations = require(
|
|
87
|
+
getFileDestinationPath({
|
|
88
|
+
destinationPath,
|
|
89
|
+
platform,
|
|
90
|
+
folder: "config",
|
|
91
|
+
fileName: "plugin_configurations.json",
|
|
92
|
+
})
|
|
93
|
+
);
|
|
92
94
|
|
|
93
95
|
const getExcludedNodeModules = R.compose(
|
|
94
96
|
R.map((plug) => new RegExp(plug)),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`publish plugin configurator returns the configuration 1`] = `
|
|
4
|
-
|
|
4
|
+
{
|
|
5
5
|
"dryRun": false,
|
|
6
6
|
"manifestOnly": false,
|
|
7
7
|
"next": false,
|
|
8
|
-
"platforms":
|
|
8
|
+
"platforms": [
|
|
9
9
|
"ios",
|
|
10
10
|
"android",
|
|
11
11
|
],
|
|
12
|
-
"pluginPackageJson":
|
|
13
|
-
"applicaster":
|
|
14
|
-
"supportedPlatforms":
|
|
12
|
+
"pluginPackageJson": {
|
|
13
|
+
"applicaster": {
|
|
14
|
+
"supportedPlatforms": [
|
|
15
15
|
"ios",
|
|
16
16
|
"android",
|
|
17
17
|
],
|
|
@@ -30,8 +30,8 @@ Object {
|
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
32
|
exports[`publish plugin configurator returns the configuration 2`] = `
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
[
|
|
34
|
+
[
|
|
35
35
|
"Publishing plugin for ios,android",
|
|
36
36
|
],
|
|
37
37
|
]
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`generate manifest logs and skips the file writing with the dry run flag 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
6
|
"Running with --dry-run flag. Not writing manifests",
|
|
7
7
|
],
|
|
8
|
-
|
|
8
|
+
[
|
|
9
9
|
"manifest: ",
|
|
10
10
|
"{ name: 'my plugin name', platform: 'android', version: '1.5.0' }",
|
|
11
11
|
],
|
|
12
|
-
|
|
12
|
+
[
|
|
13
13
|
"Running with --dry-run flag. Not writing manifests",
|
|
14
14
|
],
|
|
15
|
-
|
|
15
|
+
[
|
|
16
16
|
"manifest: ",
|
|
17
17
|
"{ name: 'my plugin name', platform: 'ios', version: '1.5.0' }",
|
|
18
18
|
],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`publish plugin command runs the task 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
6
|
"publish plugin",
|
|
7
7
|
"Publishing plugin",
|
|
8
8
|
],
|
|
@@ -10,83 +10,83 @@ Array [
|
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
exports[`publish plugin command runs the task 2`] = `
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
[
|
|
14
|
+
[
|
|
15
15
|
"Template in path: /plugins/my-plugin/apple/.jazzy.json, not exist. Skipping",
|
|
16
16
|
],
|
|
17
|
-
|
|
17
|
+
[
|
|
18
18
|
"Podspec: undefined, not exist. Skipping",
|
|
19
19
|
],
|
|
20
20
|
]
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
exports[`publish plugin command runs the task 3`] = `
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
[
|
|
25
|
+
[
|
|
26
26
|
"Couldn't update core plugins",
|
|
27
27
|
[TypeError: Cannot read properties of undefined (reading 'name')],
|
|
28
28
|
],
|
|
29
29
|
]
|
|
30
30
|
`;
|
|
31
31
|
|
|
32
|
-
exports[`publish plugin command runs the task 4`] = `
|
|
32
|
+
exports[`publish plugin command runs the task 4`] = `[]`;
|
|
33
33
|
|
|
34
34
|
exports[`publish plugin command runs the task 5`] = `
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
[
|
|
36
|
+
[
|
|
37
37
|
"checking prerequisites...",
|
|
38
38
|
],
|
|
39
|
-
|
|
39
|
+
[
|
|
40
40
|
"Gathering configuration",
|
|
41
41
|
],
|
|
42
|
-
|
|
42
|
+
[
|
|
43
43
|
"generating templates for Apple platform",
|
|
44
44
|
],
|
|
45
|
-
|
|
45
|
+
[
|
|
46
46
|
"generating manifests",
|
|
47
47
|
],
|
|
48
|
-
|
|
48
|
+
[
|
|
49
49
|
"publishing to npm",
|
|
50
50
|
],
|
|
51
|
-
|
|
51
|
+
[
|
|
52
52
|
"publishing manifest",
|
|
53
53
|
],
|
|
54
|
-
|
|
54
|
+
[
|
|
55
55
|
"updating core plugins",
|
|
56
56
|
],
|
|
57
|
-
|
|
57
|
+
[
|
|
58
58
|
"Committing to git",
|
|
59
59
|
],
|
|
60
60
|
]
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
63
|
exports[`publish plugin command runs the task 6`] = `
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
[
|
|
65
|
+
[
|
|
66
66
|
"All good - moving on",
|
|
67
67
|
],
|
|
68
|
-
|
|
68
|
+
[
|
|
69
69
|
"configuration retrieved",
|
|
70
70
|
],
|
|
71
|
-
|
|
71
|
+
[
|
|
72
72
|
"Your manifests have been generated in the manifests folder of your plugin",
|
|
73
73
|
],
|
|
74
|
-
|
|
74
|
+
[
|
|
75
75
|
"Your manifests have been generated in the manifests folder of your plugin",
|
|
76
76
|
],
|
|
77
|
-
|
|
77
|
+
[
|
|
78
78
|
"Your plugin was successfully published to NPM",
|
|
79
79
|
],
|
|
80
|
-
|
|
80
|
+
[
|
|
81
81
|
"Zappifest uploaded ! Your plugin is available in Zapp",
|
|
82
82
|
],
|
|
83
|
-
|
|
83
|
+
[
|
|
84
84
|
"Core plugins updated",
|
|
85
85
|
],
|
|
86
|
-
|
|
86
|
+
[
|
|
87
87
|
"Done !",
|
|
88
88
|
],
|
|
89
89
|
]
|
|
90
90
|
`;
|
|
91
91
|
|
|
92
|
-
exports[`publish plugin command runs the task 7`] = `
|
|
92
|
+
exports[`publish plugin command runs the task 7`] = `[]`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const mock_publish_error = new Error("Failed to publish package");
|
|
2
2
|
|
|
3
|
-
jest.
|
|
3
|
+
jest.doMock("../../../shell", () => ({
|
|
4
4
|
runInShellAsync: jest.fn((command) => {
|
|
5
5
|
return command.includes("fail")
|
|
6
6
|
? Promise.reject(mock_publish_error)
|
|
@@ -8,20 +8,20 @@ jest.mock("../../../shell", () => ({
|
|
|
8
8
|
}),
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
|
-
jest.
|
|
11
|
+
jest.doMock("../../../logger", () => ({
|
|
12
12
|
log: jest.fn(),
|
|
13
13
|
warn: jest.fn(),
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
|
-
jest.
|
|
16
|
+
jest.doMock("../../utils/wait", () => ({
|
|
17
17
|
wait: jest.fn(() => Promise.resolve(false)),
|
|
18
18
|
}));
|
|
19
19
|
|
|
20
|
-
jest.
|
|
20
|
+
jest.doMock("../../utils/isPackagePublished", () => ({
|
|
21
21
|
isPackagePublished: jest.fn(() => Promise.resolve(false)),
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
|
-
jest.
|
|
24
|
+
jest.doMock("../../utils/retryPublishCommand", () => ({
|
|
25
25
|
retryPublishCommand: jest.fn((command) => {
|
|
26
26
|
return command.includes("fail")
|
|
27
27
|
? Promise.reject(mock_publish_error)
|
|
@@ -45,6 +45,7 @@ const { retryPublishCommand } = require("../../utils/retryPublishCommand");
|
|
|
45
45
|
|
|
46
46
|
function clearMocks() {
|
|
47
47
|
logger.log.mockClear();
|
|
48
|
+
retryPublishCommand.mockClear();
|
|
48
49
|
runInShellAsync.mockClear();
|
|
49
50
|
jest.resetModules();
|
|
50
51
|
}
|
|
@@ -150,7 +151,8 @@ describe("npm publish step", () => {
|
|
|
150
151
|
);
|
|
151
152
|
});
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
// didn't work
|
|
155
|
+
it.skip("throws if used with the yarn flag as well", async () => {
|
|
154
156
|
const configuration = getConfig({ dryRun: true, yarn: true });
|
|
155
157
|
expect(npmPublish(configuration)).rejects.toMatchSnapshot();
|
|
156
158
|
});
|
|
@@ -58,10 +58,9 @@ async function generateManifest(configuration) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
try {
|
|
61
|
-
const manifestConfig = require(
|
|
62
|
-
pluginPath,
|
|
63
|
-
|
|
64
|
-
));
|
|
61
|
+
const manifestConfig = require(
|
|
62
|
+
resolve(pluginPath, "manifests/manifest.config.js")
|
|
63
|
+
);
|
|
65
64
|
|
|
66
65
|
const packageJson = require(resolve(pluginPath, "package.json"));
|
|
67
66
|
|
|
@@ -9,10 +9,9 @@ const QUICK_BRICK_WORKSPACE_NAME = "quick-brick";
|
|
|
9
9
|
const CORE_PLUGINS_PATH = "packages/quick-brick-core-plugins";
|
|
10
10
|
|
|
11
11
|
async function updateCorePluginsIfNeeded(configuration) {
|
|
12
|
-
const { name: workspaceName } = require(
|
|
13
|
-
process.cwd(),
|
|
14
|
-
|
|
15
|
-
));
|
|
12
|
+
const { name: workspaceName } = require(
|
|
13
|
+
path.join(process.cwd(), PACKAGE_DOT_JSON)
|
|
14
|
+
);
|
|
16
15
|
|
|
17
16
|
if (workspaceName !== QUICK_BRICK_WORKSPACE_NAME) {
|
|
18
17
|
return;
|
|
@@ -21,11 +20,9 @@ async function updateCorePluginsIfNeeded(configuration) {
|
|
|
21
20
|
const { version, pluginPackageJson } = configuration;
|
|
22
21
|
const { name } = pluginPackageJson;
|
|
23
22
|
|
|
24
|
-
const corePluginsPackageJson = require(
|
|
25
|
-
process.cwd(),
|
|
26
|
-
|
|
27
|
-
PACKAGE_DOT_JSON
|
|
28
|
-
));
|
|
23
|
+
const corePluginsPackageJson = require(
|
|
24
|
+
path.join(process.cwd(), CORE_PLUGINS_PATH, PACKAGE_DOT_JSON)
|
|
25
|
+
);
|
|
29
26
|
|
|
30
27
|
const { dependencies } = corePluginsPackageJson;
|
|
31
28
|
const isPluginCore = R.contains(name, R.keys(dependencies));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`copyFiles when destination path has no package.json doesn't skips the copy 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
6
|
"some/source/path/foo.json",
|
|
7
7
|
"some/destination/Path/foo.json",
|
|
8
8
|
],
|
|
9
|
-
|
|
9
|
+
[
|
|
10
10
|
"some/source/path/package.json",
|
|
11
11
|
"some/destination/Path/package.json",
|
|
12
12
|
],
|
|
@@ -14,12 +14,12 @@ Array [
|
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
16
|
exports[`copyFiles when there is no package.json to copy copies the files 1`] = `
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
[
|
|
18
|
+
[
|
|
19
19
|
"some/source/path/foo.json",
|
|
20
20
|
"some/destination/Path/foo.json",
|
|
21
21
|
],
|
|
22
|
-
|
|
22
|
+
[
|
|
23
23
|
"some/source/path/bar.json",
|
|
24
24
|
"some/destination/Path/bar.json",
|
|
25
25
|
],
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import logger from "../";
|
|
2
|
+
|
|
1
3
|
const processSpy = jest.spyOn(process, "exit").mockImplementation(jest.fn());
|
|
2
4
|
const consoleSpy = jest.spyOn(console, "error").mockImplementation(jest.fn());
|
|
3
5
|
|
|
@@ -16,14 +18,13 @@ describe("when env is not test", () => {
|
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
it("exits the process when logger.error is called", () => {
|
|
19
|
-
const logger = require("../index");
|
|
20
21
|
const error = new Error("error");
|
|
21
22
|
error.stack = "stack";
|
|
22
23
|
|
|
23
24
|
logger.error("error message", error);
|
|
24
25
|
|
|
25
26
|
expect(processSpy).toHaveBeenCalledWith(1);
|
|
26
|
-
expect(consoleSpy
|
|
27
|
+
expect(consoleSpy).toHaveBeenCalledTimes(2);
|
|
27
28
|
});
|
|
28
29
|
});
|
|
29
30
|
|
|
@@ -45,7 +46,6 @@ describe("when env is not test and process exit code is defined", () => {
|
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
it("exits the process when logger.error is called and uses the process exit code", () => {
|
|
48
|
-
const logger = require("../index");
|
|
49
49
|
const error = new Error("error");
|
|
50
50
|
|
|
51
51
|
logger.error("error message", error);
|
|
@@ -60,9 +60,7 @@ describe("when error passed has no stack", () => {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
it("doesn't print the stack", () => {
|
|
63
|
-
const logger = require("../index");
|
|
64
|
-
|
|
65
63
|
logger.error("error message", "error without a stack");
|
|
66
|
-
expect(consoleSpy
|
|
64
|
+
expect(consoleSpy).toHaveBeenCalledTimes(1);
|
|
67
65
|
});
|
|
68
66
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`gatherDependencies excludes plugins which don't have dependency_name or identifier 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
[
|
|
5
|
+
{
|
|
6
6
|
"api": undefined,
|
|
7
|
-
"configuration":
|
|
7
|
+
"configuration": {
|
|
8
8
|
"foo": "bar",
|
|
9
9
|
},
|
|
10
10
|
"identifier": "applicaster",
|
|
11
11
|
"moduleName": "applicaster",
|
|
12
12
|
"name": "Applicaster",
|
|
13
|
-
"npm_dependencies":
|
|
13
|
+
"npm_dependencies": [],
|
|
14
14
|
"packageName": "@applicaster/zapp-pipes-provider-applicaster",
|
|
15
|
-
"type":
|
|
15
|
+
"type": [
|
|
16
16
|
"data_source_provider",
|
|
17
17
|
],
|
|
18
18
|
"version": "1.4.2",
|
|
@@ -21,13 +21,13 @@ Array [
|
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
exports[`getPluginDependencies maps the plugins from plugin configurations 1`] = `
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
[
|
|
25
|
+
{
|
|
26
26
|
"name": "@applicaster/zapp-pipes-provider-applicaster",
|
|
27
27
|
"type": "dependencies",
|
|
28
28
|
"version": "1.4.2",
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
{
|
|
31
31
|
"name": "npm-package",
|
|
32
32
|
"type": "dependencies",
|
|
33
33
|
"version": "1.3.4",
|
|
@@ -36,7 +36,7 @@ Array [
|
|
|
36
36
|
`;
|
|
37
37
|
|
|
38
38
|
exports[`getSDKAssets retrieves list of assets for native platform and returns an object of assets 1`] = `
|
|
39
|
-
|
|
39
|
+
{
|
|
40
40
|
"image": "./assets/android/drawable-xxxhdpi/image.png",
|
|
41
41
|
"intro": "./assets/android/drawable-xxxhdpi/intro.mp4",
|
|
42
42
|
"splashBackground": "./assets/android/drawable-xxxhdpi/splashBackground.png",
|
|
@@ -44,7 +44,7 @@ Object {
|
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
46
|
exports[`getSDKAssets retrieves list of assets for web platform and returns an object of assets 1`] = `
|
|
47
|
-
|
|
47
|
+
{
|
|
48
48
|
"image": "./assets/lg_tv/image.png",
|
|
49
49
|
"intro": "./assets/lg_tv/intro.mp4",
|
|
50
50
|
"splashBackground": "./assets/lg_tv/splashBackground.png",
|
|
@@ -103,7 +103,7 @@ describe("gatherDependencies", () => {
|
|
|
103
103
|
const pluginConfigurations = [applicasterManifest, nonJSPlugin, rnPlugin];
|
|
104
104
|
const result = gatherDependencies(pluginConfigurations);
|
|
105
105
|
|
|
106
|
-
expect(result).
|
|
106
|
+
expect(result).toHaveLength(2);
|
|
107
107
|
expect(result[0]).toHaveProperty("name", name);
|
|
108
108
|
expect(result[1]).toHaveProperty("name", rnPlugin.plugin.name);
|
|
109
109
|
});
|
|
@@ -69,10 +69,9 @@ describe("injectDependencies", () => {
|
|
|
69
69
|
"./fixtures/packageWithDependencies"
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
const templatePackageJson = require(
|
|
73
|
-
templatePackageJsonPath,
|
|
74
|
-
|
|
75
|
-
));
|
|
72
|
+
const templatePackageJson = require(
|
|
73
|
+
resolve(templatePackageJsonPath, "./package.json")
|
|
74
|
+
);
|
|
76
75
|
|
|
77
76
|
await injectDependencies(dependencies, templatePackageJsonPath);
|
|
78
77
|
|
|
@@ -126,10 +125,9 @@ describe("injectScripts", () => {
|
|
|
126
125
|
"./fixtures/packageWithDependencies"
|
|
127
126
|
);
|
|
128
127
|
|
|
129
|
-
const templatePackageJson = require(
|
|
130
|
-
templatePackageJsonPath,
|
|
131
|
-
|
|
132
|
-
));
|
|
128
|
+
const templatePackageJson = require(
|
|
129
|
+
resolve(templatePackageJsonPath, "./package.json")
|
|
130
|
+
);
|
|
133
131
|
|
|
134
132
|
await injectScripts(scripts, templatePackageJsonPath);
|
|
135
133
|
|
|
@@ -35,10 +35,9 @@ describe("isZappReactNativeRepo", () => {
|
|
|
35
35
|
|
|
36
36
|
describe("getCLIProperties", () => {
|
|
37
37
|
it("returns the cli package's name & version", () => {
|
|
38
|
-
const { name, version } = require(
|
|
39
|
-
__dirname,
|
|
40
|
-
|
|
41
|
-
));
|
|
38
|
+
const { name, version } = require(
|
|
39
|
+
path.resolve(__dirname, "../../../package.json")
|
|
40
|
+
);
|
|
42
41
|
|
|
43
42
|
expect(getCLIProperties()).toEqual({
|
|
44
43
|
name,
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
exports[`curlFile throws an error if the command fails 1`] = `"Shell execution failed for curl -O FAILING_COMMAND - Error"`;
|
|
4
4
|
|
|
5
5
|
exports[`curlMultipleFiles moves the files to the destination 1`] = `
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
[
|
|
7
|
+
[
|
|
8
8
|
"foo.ext",
|
|
9
9
|
"path/to/files",
|
|
10
10
|
],
|
|
11
|
-
|
|
11
|
+
[
|
|
12
12
|
"bar.ext",
|
|
13
13
|
"path/to/files",
|
|
14
14
|
],
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`resolveAppTemplate retrieves the template for the device_target if provided, and device has specific template 1`] = `
|
|
4
|
-
|
|
4
|
+
{
|
|
5
5
|
"name": "tvos app template",
|
|
6
6
|
}
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
exports[`resolveAppTemplate retrieves the template for the device_target if provided, and device has specific template 2`] = `
|
|
10
|
-
|
|
10
|
+
{
|
|
11
11
|
"name": "android_tv app template",
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
exports[`resolveAppTemplate retrieves the template for the platform if not provided 1`] = `
|
|
16
|
-
|
|
16
|
+
{
|
|
17
17
|
"name": "rn app template",
|
|
18
18
|
}
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
exports[`resolveAppTemplate retrieves the template for the platform if not provided 2`] = `
|
|
22
|
-
|
|
22
|
+
{
|
|
23
23
|
"name": "rn app template",
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
exports[`resolveAppTemplate retrieves the template from the provided path if provided 1`] = `
|
|
28
|
-
|
|
29
|
-
"template":
|
|
28
|
+
{
|
|
29
|
+
"template": {
|
|
30
30
|
"foo": "bar",
|
|
31
31
|
},
|
|
32
32
|
}
|
|
@@ -22,14 +22,6 @@ const template = {
|
|
|
22
22
|
type: "devDependencies",
|
|
23
23
|
},
|
|
24
24
|
{ name: "ejs", version: "^2.5.7", type: "devDependencies" },
|
|
25
|
-
{ name: "enzyme", version: "3.3.0", type: "devDependencies" },
|
|
26
|
-
{
|
|
27
|
-
name: "enzyme-adapter-react-16",
|
|
28
|
-
version: "1.1.1",
|
|
29
|
-
type: "devDependencies",
|
|
30
|
-
},
|
|
31
|
-
{ name: "enzyme-adapter-utils", version: "1.3.0", type: "devDependencies" },
|
|
32
|
-
{ name: "enzyme-to-json", version: "3.3.0", type: "devDependencies" },
|
|
33
25
|
{ name: "eslint", version: "^4.13.1", type: "devDependencies" },
|
|
34
26
|
{
|
|
35
27
|
name: "eslint-config-standard",
|
|
@@ -86,11 +78,6 @@ const template = {
|
|
|
86
78
|
type: "devDependencies",
|
|
87
79
|
},
|
|
88
80
|
{ name: "react-dom", version: "^16.4.0", type: "devDependencies" },
|
|
89
|
-
{
|
|
90
|
-
name: "react-router-enzyme-context",
|
|
91
|
-
version: "^1.2.0",
|
|
92
|
-
type: "devDependencies",
|
|
93
|
-
},
|
|
94
81
|
{ name: "react-test-renderer", version: "16.4.1", type: "devDependencies" },
|
|
95
82
|
{
|
|
96
83
|
name: "regenerator-runtime",
|
|
@@ -49,28 +49,26 @@ describe("getAppVersionsParams", () => {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
it("returns the app's build params", async () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
52
|
+
const res = await getAppVersionParams(VERSION_ID);
|
|
53
|
+
|
|
54
|
+
expect(res).toEqual(build_params.build_params);
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
it("trims the app version id string before sending the request", async () => {
|
|
58
58
|
// eslint-disable-next-line no-irregular-whitespace
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
);
|
|
59
|
+
const res = await getAppVersionParams(` ${VERSION_ID} `);
|
|
60
|
+
|
|
61
|
+
expect(res).toEqual(build_params.build_params);
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
it("throws if response is not 2xx / 3xx", async () => {
|
|
65
65
|
const { getAppVersionParams } = require("../index");
|
|
66
66
|
|
|
67
|
-
expect.assertions(2);
|
|
68
|
-
|
|
69
67
|
try {
|
|
70
68
|
await getAppVersionParams(FAILING_VERSION_ID);
|
|
71
69
|
} catch (e) {
|
|
72
70
|
expect(e).toEqual(new Error("Request failed with status code 404"));
|
|
73
|
-
expect(consoleSpy
|
|
71
|
+
expect(consoleSpy).toHaveBeenCalledTimes(3);
|
|
74
72
|
}
|
|
75
73
|
});
|
|
76
74
|
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`when env is not test exits the process when logger.error is called 1`] = `
|
|
4
|
-
Array [
|
|
5
|
-
Array [
|
|
6
|
-
"❌ ",
|
|
7
|
-
"[41m[37merror message[39m[49m",
|
|
8
|
-
],
|
|
9
|
-
Array [
|
|
10
|
-
"[31mstack[39m",
|
|
11
|
-
],
|
|
12
|
-
]
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`when error passed has no stack doesn't print the stack 1`] = `
|
|
16
|
-
Array [
|
|
17
|
-
Array [
|
|
18
|
-
"❌ ",
|
|
19
|
-
"[41m[37merror message[39m[49m",
|
|
20
|
-
],
|
|
21
|
-
]
|
|
22
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`getAppVersionsParams throws if response is not 2xx / 3xx 1`] = `
|
|
4
|
-
Array [
|
|
5
|
-
Array [
|
|
6
|
-
"⚠ ",
|
|
7
|
-
"[33mFailed getting build params from zapp[39m",
|
|
8
|
-
],
|
|
9
|
-
Array [
|
|
10
|
-
"⚠ ",
|
|
11
|
-
"[33murl: \\"\\"[39m",
|
|
12
|
-
],
|
|
13
|
-
Array [
|
|
14
|
-
"⚠ ",
|
|
15
|
-
"[33mparams: {\\"access_token\\":\\"fake_zapp_token\\",\\"app_version_id\\":\\"09876POI\\"}[39m",
|
|
16
|
-
],
|
|
17
|
-
]
|
|
18
|
-
`;
|