@applicaster/zapplicaster-cli 13.0.0-alpha.3334148221 → 13.0.0-alpha.3390783725
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/README.md +0 -1
- 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 +26 -26
- package/src/commands/prepareWorkspace/__tests__/__snapshots__/workspaceCreator.test.js.snap +16 -16
- package/src/commands/prepareWorkspace/__tests__/appBootstrapper.test.js +6 -1
- package/src/commands/prepareWorkspace/__tests__/configFilesRetriever.test.js +12 -14
- package/src/commands/prepareWorkspace/appBootstrapper.js +44 -6
- package/src/commands/prepareWorkspace/configFilesRetriever.js +9 -22
- package/src/commands/prepareWorkspace/index.js +6 -6
- package/src/commands/prepareWorkspace/runtimeConfigurationUrlsCreator.js +3 -0
- 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/download/__tests__/__snapshots__/download.test.js.snap +1 -1
- package/src/download/__tests__/download.test.js +14 -9
- package/src/download/index.js +2 -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/README.md
CHANGED
|
@@ -98,7 +98,6 @@ const template = {
|
|
|
98
98
|
getJsonContent: config => ({ ... }) // function to get the config file's content from the CLI's configuration object. optional
|
|
99
99
|
}
|
|
100
100
|
],
|
|
101
|
-
remoteFiles: config => [] // function which returns an array of remote urls to save as config files. optional
|
|
102
101
|
}
|
|
103
102
|
```
|
|
104
103
|
|
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.3390783725",
|
|
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.3390783725",
|
|
32
|
+
"@applicaster/zapp-react-native-android-tv-cli-template": "13.0.0-alpha.3390783725",
|
|
33
|
+
"@applicaster/zapp-react-native-cli-template": "13.0.0-alpha.3390783725",
|
|
34
|
+
"@applicaster/zapp-react-native-tvos-cli-template": "13.0.0-alpha.3390783725",
|
|
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
|
-
|
|
30
|
-
"Retrieving configuration files",
|
|
31
|
-
],
|
|
32
|
-
Array [
|
|
29
|
+
[
|
|
33
30
|
"Creating runtime URLs configuration file",
|
|
34
31
|
],
|
|
35
|
-
|
|
32
|
+
[
|
|
33
|
+
"Retrieving configuration files",
|
|
34
|
+
],
|
|
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
|
-
|
|
56
|
-
"Configuration files retrieved !",
|
|
57
|
-
],
|
|
58
|
-
Array [
|
|
55
|
+
[
|
|
59
56
|
"Runtime configuration URLs file created",
|
|
60
57
|
],
|
|
61
|
-
|
|
58
|
+
[
|
|
59
|
+
"Configuration files retrieved !",
|
|
60
|
+
],
|
|
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
|
]
|
|
@@ -103,7 +103,12 @@ const destinationPath = "path/to/workspace";
|
|
|
103
103
|
const platform = "ios";
|
|
104
104
|
const yarn = false;
|
|
105
105
|
const zappReactNative = false;
|
|
106
|
-
|
|
106
|
+
|
|
107
|
+
const buildParams = {
|
|
108
|
+
languages: ["en", "en-US", "es", "es-LA"],
|
|
109
|
+
appVersionId: "A1234",
|
|
110
|
+
quick_brick_version: "6.1.6",
|
|
111
|
+
};
|
|
107
112
|
|
|
108
113
|
const template = {
|
|
109
114
|
files: {
|
|
@@ -11,6 +11,7 @@ jest.mock("../../../download", () => ({
|
|
|
11
11
|
|
|
12
12
|
jest.mock("../../../render", () => ({
|
|
13
13
|
renderConfigFile: jest.fn(() => mock_curriedRenderConfigFile),
|
|
14
|
+
saveConfigFile: jest.fn(),
|
|
14
15
|
}));
|
|
15
16
|
|
|
16
17
|
const {
|
|
@@ -22,6 +23,11 @@ const {
|
|
|
22
23
|
const { renderConfigFile } = require("../../../render");
|
|
23
24
|
|
|
24
25
|
const { build_params: buildParams } = require("./fixtures/buildParams.json");
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
runtimeConfigurationUrlsCreator,
|
|
29
|
+
} = require("../runtimeConfigurationUrlsCreator");
|
|
30
|
+
|
|
25
31
|
const destinationPath = "path/to/workspace";
|
|
26
32
|
const platform = "ios";
|
|
27
33
|
const template = {};
|
|
@@ -34,7 +40,11 @@ const configuration = {
|
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
describe("configFilesRetriever", () => {
|
|
37
|
-
|
|
43
|
+
beforeAll((done) => {
|
|
44
|
+
runtimeConfigurationUrlsCreator(configuration).then(() => {
|
|
45
|
+
done();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
38
48
|
|
|
39
49
|
afterEach(() => {
|
|
40
50
|
mock_curriedSaveRemoteJsonToFile.mockClear();
|
|
@@ -47,19 +57,7 @@ describe("configFilesRetriever", () => {
|
|
|
47
57
|
await configFilesRetriever(configuration);
|
|
48
58
|
|
|
49
59
|
expect(saveRemoteJsonToFile).toHaveBeenCalledWith(configuration);
|
|
50
|
-
expect(mock_curriedSaveRemoteJsonToFile).toHaveBeenCalledTimes(
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("also downloads remote files from the template", async () => {
|
|
54
|
-
const config = {
|
|
55
|
-
...configuration,
|
|
56
|
-
template: { remoteFiles: () => ["additional_file"] },
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
await configFilesRetriever(config);
|
|
60
|
-
|
|
61
|
-
expect(saveRemoteJsonToFile).toHaveBeenCalledWith(config);
|
|
62
|
-
expect(mock_curriedSaveRemoteJsonToFile).toHaveBeenCalledTimes(6);
|
|
60
|
+
expect(mock_curriedSaveRemoteJsonToFile).toHaveBeenCalledTimes(4);
|
|
63
61
|
});
|
|
64
62
|
|
|
65
63
|
it("saves custom config files form the template", async () => {
|
|
@@ -43,6 +43,38 @@ async function patchPackages() {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* fallback to en for missing dayjslocalization
|
|
48
|
+
* converts the locale code to a dayjs compatible locale code
|
|
49
|
+
* lowercase input code is expected, e.g. "en-GB" => "en-gb"
|
|
50
|
+
* @param {string} code - locale code, e.g. "en", "fr", "es-LA"
|
|
51
|
+
* from @applicaster/zapp-react-native-utils/appUtils/localizationsHelper
|
|
52
|
+
* */
|
|
53
|
+
const toDayJSLocaleMap = (code) => {
|
|
54
|
+
const map = {
|
|
55
|
+
hy: "hy-am",
|
|
56
|
+
fj: null,
|
|
57
|
+
la: null,
|
|
58
|
+
no: null,
|
|
59
|
+
pa: "pa-in",
|
|
60
|
+
qu: null,
|
|
61
|
+
sm: null,
|
|
62
|
+
to: null,
|
|
63
|
+
xh: null,
|
|
64
|
+
tt: null,
|
|
65
|
+
"es-LA": "es",
|
|
66
|
+
"en-UK": "en-gb",
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (map[code] === null) {
|
|
70
|
+
return "en";
|
|
71
|
+
} else if (map[code]) {
|
|
72
|
+
return map[code];
|
|
73
|
+
} else {
|
|
74
|
+
return code.toLowerCase();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
46
78
|
/**
|
|
47
79
|
* {@typedef configuration
|
|
48
80
|
* @type {Object}
|
|
@@ -83,12 +115,14 @@ async function appBootstrapper(configuration) {
|
|
|
83
115
|
logger.log("injecting dependencies...");
|
|
84
116
|
const { dependencies, scripts } = template;
|
|
85
117
|
|
|
86
|
-
const pluginConfigurations = require(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
118
|
+
const pluginConfigurations = require(
|
|
119
|
+
getFileDestinationPath({
|
|
120
|
+
destinationPath,
|
|
121
|
+
platform,
|
|
122
|
+
folder: "config",
|
|
123
|
+
fileName: "plugin_configurations.json",
|
|
124
|
+
})
|
|
125
|
+
);
|
|
92
126
|
|
|
93
127
|
const getExcludedNodeModules = R.compose(
|
|
94
128
|
R.map((plug) => new RegExp(plug)),
|
|
@@ -133,6 +167,10 @@ async function appBootstrapper(configuration) {
|
|
|
133
167
|
|
|
134
168
|
configuration.sdkAssets = sdkAssets;
|
|
135
169
|
|
|
170
|
+
configuration.buildParams.dayJsLocales = configuration.buildParams.languages
|
|
171
|
+
.map(toDayJSLocaleMap)
|
|
172
|
+
.filter((v) => v !== "en");
|
|
173
|
+
|
|
136
174
|
configuration.excludedNodeModules = getExcludedNodeModules(plugins);
|
|
137
175
|
const { filesToRender } = template.files;
|
|
138
176
|
|
|
@@ -24,34 +24,21 @@ const { renderConfigFile } = require("../../render");
|
|
|
24
24
|
* @param {configuration} configuration
|
|
25
25
|
*/
|
|
26
26
|
async function configFilesRetriever(configuration) {
|
|
27
|
-
const { buildParams, template } = configuration;
|
|
27
|
+
const { buildParams, template, runtimeConfigurationUrls } = configuration;
|
|
28
28
|
|
|
29
|
-
const { configFiles = []
|
|
29
|
+
const { configFiles = [] } = template;
|
|
30
30
|
|
|
31
31
|
if (Array.isArray(configFiles) && !R.propEq("length", 0, configFiles)) {
|
|
32
32
|
await Promise.all(R.map(renderConfigFile(configuration), configFiles));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const configFilesUrls =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
R.prop(R.__, buildParams),
|
|
43
|
-
])
|
|
44
|
-
)
|
|
45
|
-
),
|
|
46
|
-
R.reject(
|
|
47
|
-
R.compose(
|
|
48
|
-
R.either(R.isNil, R.compose(R.not, R.test(/(.json)$/i))),
|
|
49
|
-
R.prop(R.__, buildParams)
|
|
50
|
-
)
|
|
51
|
-
),
|
|
52
|
-
R.filter(R.test(/(_url)$/i)),
|
|
53
|
-
R.keys
|
|
54
|
-
)(buildParams);
|
|
35
|
+
const configFilesUrls = Object.entries(runtimeConfigurationUrls).map(
|
|
36
|
+
([key, value]) => {
|
|
37
|
+
const newKey = key.replace("_url", ".json");
|
|
38
|
+
|
|
39
|
+
return [newKey, value];
|
|
40
|
+
}
|
|
41
|
+
);
|
|
55
42
|
|
|
56
43
|
// download files & save json files
|
|
57
44
|
await Promise.all(
|
|
@@ -32,18 +32,18 @@ const prepareWorkspaceTask = {
|
|
|
32
32
|
error: "Could not create workspace",
|
|
33
33
|
completion: "Workspace created !",
|
|
34
34
|
},
|
|
35
|
-
{
|
|
36
|
-
start: "Retrieving configuration files",
|
|
37
|
-
run: configFilesRetriever,
|
|
38
|
-
error: "Could not retrieve configuration files",
|
|
39
|
-
completion: "Configuration files retrieved !",
|
|
40
|
-
},
|
|
41
35
|
{
|
|
42
36
|
start: "Creating runtime URLs configuration file",
|
|
43
37
|
run: runtimeConfigurationUrlsCreator,
|
|
44
38
|
error: "Could not create runtime_configuration_urls.json",
|
|
45
39
|
completion: "Runtime configuration URLs file created",
|
|
46
40
|
},
|
|
41
|
+
{
|
|
42
|
+
start: "Retrieving configuration files",
|
|
43
|
+
run: configFilesRetriever,
|
|
44
|
+
error: "Could not retrieve configuration files",
|
|
45
|
+
completion: "Configuration files retrieved !",
|
|
46
|
+
},
|
|
47
47
|
{
|
|
48
48
|
start: "Bootstraping app project",
|
|
49
49
|
run: appBootstrapper,
|
|
@@ -31,6 +31,9 @@ async function runtimeConfigurationUrlsCreator(configuration) {
|
|
|
31
31
|
runtimeConfigurationUrls
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
+
// Intentionally mutating parameter to pass runtimeConfigurationUrls to the next step
|
|
35
|
+
configuration.runtimeConfigurationUrls = runtimeConfigurationUrls;
|
|
36
|
+
|
|
34
37
|
return true;
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -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
|
],
|