@aws-amplify/amplify-util-uibuilder 1.1.2 → 1.2.0-uibuilder-ts.0
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/CHANGELOG.md +11 -0
- package/commands/cloneComponentsFromEnv.js +46 -49
- package/commands/generateComponents.js +4 -4
- package/commands/utils/createUiBuilderComponent.js +13 -19
- package/commands/utils/notifyMissingPackages.js +3 -2
- package/commands/utils/shouldRenderComponents.js +7 -8
- package/commands/utils/syncAmplifyUiBuilderComponents.js +19 -22
- package/event-handlers/handle-PostEnvAdd.js +2 -2
- package/event-handlers/handle-PostPull.js +2 -2
- package/package.json +7 -7
- package/commands/utils/logger.js +0 -24
- package/commands/utils/mockUiBuilderData.js +0 -149
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.2.0-uibuilder-ts.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-util-uibuilder@1.1.2...@aws-amplify/amplify-util-uibuilder@1.2.0-uibuilder-ts.0) (2021-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add types to uibuilder generated files ([cfff256](https://github.com/aws-amplify/amplify-cli/commit/cfff256e73e9ce0b6001a825f29e152213a355e6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.1.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-util-uibuilder@1.1.1...@aws-amplify/amplify-util-uibuilder@1.1.2) (2021-12-03)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @aws-amplify/amplify-util-uibuilder
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const aws = require('aws-sdk');
|
|
2
|
-
const logger = require('./utils/logger');
|
|
3
2
|
const { extractArgs } = require('./utils/extractArgs');
|
|
4
3
|
const { listUiBuilderComponents } = require('./utils/syncAmplifyUiBuilderComponents');
|
|
4
|
+
const { printer } = require('amplify-prompts');
|
|
5
5
|
|
|
6
6
|
async function run(context) {
|
|
7
|
-
|
|
7
|
+
printer.debug('Running create components command in amplify-util-uibuilder');
|
|
8
8
|
const args = extractArgs(context);
|
|
9
9
|
const sourceEnvName = args.sourceEnvName ? args.sourceEnvName : context.exeInfo.sourceEnvName;
|
|
10
10
|
const newEnvName = args.newEnvName ? args.newEnvName : context.exeInfo.localEnvInfo.envName;
|
|
@@ -15,63 +15,60 @@ async function run(context) {
|
|
|
15
15
|
}
|
|
16
16
|
const existingComponentsNewEnv = await listUiBuilderComponents(context, newEnvName);
|
|
17
17
|
if (existingComponentsNewEnv.entities.length > 0) {
|
|
18
|
-
|
|
18
|
+
printer.debug(
|
|
19
|
+
`${existingComponentsNewEnv.entities.length} components already exist in new env. Skipping creation of local components.`,
|
|
20
|
+
);
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
const environmentName = args.environmentName ? args.environmentName : context.exeInfo.localEnvInfo.envName;
|
|
24
|
-
|
|
25
|
-
const appId = args.appId ? args.appId : context.exeInfo.teamProviderInfo[environmentName].awscloudformation.AmplifyAppId;
|
|
24
|
+
const environmentName = args.environmentName ? args.environmentName : context.exeInfo.localEnvInfo.envName;
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
context,
|
|
29
|
-
newEnvName,
|
|
30
|
-
appId,
|
|
31
|
-
]);
|
|
26
|
+
const appId = args.appId ? args.appId : context.exeInfo.teamProviderInfo[environmentName].awscloudformation.AmplifyAppId;
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
const awsConfigInfo = await context.amplify.invokePluginMethod(context, 'awscloudformation', undefined, 'loadConfigurationForEnv', [
|
|
29
|
+
context,
|
|
30
|
+
newEnvName,
|
|
31
|
+
appId,
|
|
32
|
+
]);
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
if (process.env.UI_BUILDER_ENDPOINT) {
|
|
35
|
+
awsConfigInfo.endpoint = process.env.UI_BUILDER_ENDPOINT;
|
|
36
|
+
}
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
if (process.env.UI_BUILDER_REGION) {
|
|
39
|
+
awsConfigInfo.region = process.env.UI_BUILDER_REGION;
|
|
40
|
+
}
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
if (!components.length) {
|
|
45
|
-
logger.info(`No UIBuilder components found in app ${appId} from env ${sourceEnvName}. Skipping component clone process.`);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const promises = components.map(async component => {
|
|
49
|
-
return await amplifyUIBuilder
|
|
50
|
-
.createComponent({
|
|
51
|
-
appId,
|
|
52
|
-
environmentName,
|
|
53
|
-
componentToCreate: {
|
|
54
|
-
bindingProperties: component.bindingProperties,
|
|
55
|
-
children: component.children,
|
|
56
|
-
componentType: component.componentType,
|
|
57
|
-
name: component.name,
|
|
58
|
-
overrides: component.overrides,
|
|
59
|
-
properties: component.properties,
|
|
60
|
-
sourceId: component.sourceId,
|
|
61
|
-
variants: component.variants,
|
|
62
|
-
},
|
|
63
|
-
})
|
|
64
|
-
.promise();
|
|
65
|
-
});
|
|
66
|
-
await Promise.all(promises);
|
|
42
|
+
const amplifyUIBuilder = new aws.AmplifyUIBuilder(awsConfigInfo);
|
|
67
43
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
logger.warn('This endpoint is broken for now:');
|
|
73
|
-
logger.error(e);
|
|
44
|
+
const components = existingComponents.entities;
|
|
45
|
+
if (!components.length) {
|
|
46
|
+
printer.debug(`No UIBuilder components found in app ${appId} from env ${sourceEnvName}. Skipping component clone process.`);
|
|
47
|
+
return;
|
|
74
48
|
}
|
|
49
|
+
const promises = components.map(async component => {
|
|
50
|
+
return await amplifyUIBuilder
|
|
51
|
+
.createComponent({
|
|
52
|
+
appId,
|
|
53
|
+
environmentName,
|
|
54
|
+
componentToCreate: {
|
|
55
|
+
bindingProperties: component.bindingProperties,
|
|
56
|
+
children: component.children,
|
|
57
|
+
componentType: component.componentType,
|
|
58
|
+
name: component.name,
|
|
59
|
+
overrides: component.overrides,
|
|
60
|
+
properties: component.properties,
|
|
61
|
+
sourceId: component.sourceId,
|
|
62
|
+
variants: component.variants,
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
.promise();
|
|
66
|
+
});
|
|
67
|
+
await Promise.all(promises);
|
|
68
|
+
|
|
69
|
+
console.log(
|
|
70
|
+
`Successfully cloned ${components.length} UIBuilder components in app ${appId} from env ${sourceEnvName} to env ${newEnvName}.`,
|
|
71
|
+
);
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
module.exports = {
|
|
@@ -7,10 +7,10 @@ const {
|
|
|
7
7
|
generateUiBuilderThemes,
|
|
8
8
|
} = require('./utils/syncAmplifyUiBuilderComponents');
|
|
9
9
|
const { generateAmplifyUiBuilderIndexFile } = require('./utils/createUiBuilderComponent');
|
|
10
|
-
const
|
|
10
|
+
const { printer } = require('amplify-prompts');
|
|
11
11
|
const ora = require('ora');
|
|
12
12
|
async function run(context) {
|
|
13
|
-
|
|
13
|
+
printer.debug('Running generate components command in amplify-util-uibuilder');
|
|
14
14
|
if (!(await shouldRenderComponents(context))) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -18,7 +18,7 @@ async function run(context) {
|
|
|
18
18
|
try {
|
|
19
19
|
const [componentSchemas, themeSchemas] = await Promise.all([listUiBuilderComponents(context), listUiBuilderThemes(context)]);
|
|
20
20
|
if (componentSchemas.entities.length === 0 && themeSchemas.entities.length === 0) {
|
|
21
|
-
|
|
21
|
+
printer.debug('Skipping UI component generation since none are found.');
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -42,7 +42,7 @@ async function run(context) {
|
|
|
42
42
|
spinner.succeed('Synced UI components.');
|
|
43
43
|
}
|
|
44
44
|
} catch (e) {
|
|
45
|
-
|
|
45
|
+
printer.debug(e);
|
|
46
46
|
spinner.fail('Failed to sync UI components');
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -8,15 +8,13 @@ const {
|
|
|
8
8
|
ScriptKind,
|
|
9
9
|
} = require('@aws-amplify/codegen-ui-react');
|
|
10
10
|
const { getUiBuilderComponentsPath } = require('./getUiBuilderComponentsPath');
|
|
11
|
-
const
|
|
12
|
-
const config =
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
renderTypeDeclarations: process.env.RENDER_TYPE_DECLARATIONS ? true : false,
|
|
19
|
-
};
|
|
11
|
+
const { printer } = require('amplify-prompts');
|
|
12
|
+
const config = {
|
|
13
|
+
module: ModuleKind.ES2020,
|
|
14
|
+
target: ScriptTarget.ES2020,
|
|
15
|
+
script: ScriptKind.JSX,
|
|
16
|
+
renderTypeDeclarations: true,
|
|
17
|
+
};
|
|
20
18
|
|
|
21
19
|
const createUiBuilderComponent = (context, schema) => {
|
|
22
20
|
const uiBuilderComponentsPath = getUiBuilderComponentsPath(context);
|
|
@@ -35,9 +33,7 @@ const createUiBuilderComponent = (context, schema) => {
|
|
|
35
33
|
|
|
36
34
|
const createUiBuilderTheme = (context, schema) => {
|
|
37
35
|
const uiBuilderComponentsPath = getUiBuilderComponentsPath(context);
|
|
38
|
-
const rendererFactory = new StudioTemplateRendererFactory(
|
|
39
|
-
component => new ReactThemeStudioTemplateRenderer(component, config),
|
|
40
|
-
);
|
|
36
|
+
const rendererFactory = new StudioTemplateRendererFactory(component => new ReactThemeStudioTemplateRenderer(component, config));
|
|
41
37
|
|
|
42
38
|
const outputPathDir = uiBuilderComponentsPath;
|
|
43
39
|
const outputConfig = {
|
|
@@ -50,17 +46,15 @@ const createUiBuilderTheme = (context, schema) => {
|
|
|
50
46
|
rendererManager.renderSchemaToTemplate(schema);
|
|
51
47
|
return schema;
|
|
52
48
|
} catch (e) {
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
printer.debug(e);
|
|
50
|
+
printer.debug({ msg: 'Skipping invalid theme with schema', schema: JSON.stringify(schema, null, 2) });
|
|
55
51
|
throw e;
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
54
|
|
|
59
55
|
const generateAmplifyUiBuilderIndexFile = (context, schemas) => {
|
|
60
56
|
const uiBuilderComponentsPath = getUiBuilderComponentsPath(context);
|
|
61
|
-
const rendererFactory = new StudioTemplateRendererFactory(
|
|
62
|
-
component => new ReactIndexStudioTemplateRenderer(component, config),
|
|
63
|
-
);
|
|
57
|
+
const rendererFactory = new StudioTemplateRendererFactory(component => new ReactIndexStudioTemplateRenderer(component, config));
|
|
64
58
|
|
|
65
59
|
const outputPathDir = uiBuilderComponentsPath;
|
|
66
60
|
const outputConfig = {
|
|
@@ -72,8 +66,8 @@ const generateAmplifyUiBuilderIndexFile = (context, schemas) => {
|
|
|
72
66
|
try {
|
|
73
67
|
rendererManager.renderSchemaToTemplate(schemas);
|
|
74
68
|
} catch (e) {
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
printer.debug(e);
|
|
70
|
+
printer.debug({ msg: 'Failed to generate component index file' });
|
|
77
71
|
throw e;
|
|
78
72
|
}
|
|
79
73
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { pathManager, JSONUtilities } = require('amplify-cli-core');
|
|
1
2
|
const fs = require('fs-extra');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
const { extractArgs } = require('./extractArgs');
|
|
@@ -5,8 +6,8 @@ const REQUIRED_PACKAGES = ['@aws-amplify/ui-react', 'aws-amplify'];
|
|
|
5
6
|
|
|
6
7
|
const notifyMissingPackages = context => {
|
|
7
8
|
const args = extractArgs(context);
|
|
8
|
-
const localEnvFilePath = args.localEnvFilePath ? args.localEnvFilePath :
|
|
9
|
-
const localEnvJson =
|
|
9
|
+
const localEnvFilePath = args.localEnvFilePath ? args.localEnvFilePath : pathManager.getLocalEnvFilePath();
|
|
10
|
+
const localEnvJson = JSONUtilities.readJson(localEnvFilePath);
|
|
10
11
|
const packageJsonPath = path.join(localEnvJson.projectPath, 'package.json');
|
|
11
12
|
if (!fs.existsSync(packageJsonPath)) {
|
|
12
13
|
return;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const { printer } = require('amplify-prompts');
|
|
3
2
|
async function shouldRenderComponents(context) {
|
|
4
3
|
if (process.env.FORCE_RENDER) {
|
|
5
|
-
|
|
4
|
+
printer.debug('Forcing component render since environment variable flag is set.');
|
|
6
5
|
return true;
|
|
7
6
|
}
|
|
8
7
|
if (context.input.options && context.input.options['no-codegen']) {
|
|
9
|
-
|
|
8
|
+
printer.debug('Not pulling components because --no-codegen flag is set');
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
if (!context.exeInfo || !context.exeInfo.projectConfig) {
|
|
14
|
-
|
|
13
|
+
printer.debug('Not pulling components because there is no projectConfig set for this project');
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
if (!context.exeInfo.projectConfig.providers.includes('awscloudformation')) {
|
|
19
|
-
|
|
18
|
+
printer.debug('Not pulling components because there is no "awscloudformation" provider');
|
|
20
19
|
return false;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
if (context.exeInfo.projectConfig.frontend !== 'javascript') {
|
|
24
|
-
|
|
23
|
+
printer.debug('Not pulling components because this project is not configured as a javascript frontend');
|
|
25
24
|
return false;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
if (context.exeInfo.projectConfig['javascript'].framework !== 'react') {
|
|
29
|
-
|
|
28
|
+
printer.debug('Not pulling components because this project is not configured with the "react" framework');
|
|
30
29
|
return false;
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
const aws = require('aws-sdk');
|
|
2
|
+
const { printer } = require('amplify-prompts');
|
|
3
|
+
const { resolveAppId } = require('amplify-provider-awscloudformation');
|
|
2
4
|
const { createUiBuilderComponent, createUiBuilderTheme } = require('./createUiBuilderComponent');
|
|
3
5
|
const { getUiBuilderComponentsPath } = require('./getUiBuilderComponentsPath');
|
|
4
|
-
const logger = require('./logger');
|
|
5
6
|
const { extractArgs } = require('./extractArgs');
|
|
6
|
-
const { mockUiBuilderComponents, mockUiBuilderThemes } = require('./mockUiBuilderData');
|
|
7
|
-
|
|
8
7
|
const getEnvName = (context, envName) => {
|
|
9
8
|
const args = extractArgs(context);
|
|
10
9
|
return envName ? envName : args.environmentName ? args.environmentName : context.exeInfo.localEnvInfo.envName;
|
|
11
10
|
};
|
|
12
11
|
|
|
13
12
|
const getAppId = (context, environmentName) => {
|
|
14
|
-
|
|
13
|
+
const appId = extractArgs(context).appId || resolveAppId(context);
|
|
14
|
+
if (!appId) {
|
|
15
|
+
throw new Error(
|
|
16
|
+
'Unable to sync Studio components since appId could not be determined. This can happen when you hit the soft limit of number of apps that you can have in Amplify console.',
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return appId;
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
async function listUiBuilderComponents(context, envName) {
|
|
18
|
-
if (process.env.MOCK_UI_BUILDER_BACKEND) {
|
|
19
|
-
return mockUiBuilderComponents;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
23
|
const environmentName = getEnvName(context, envName);
|
|
23
24
|
const appId = getAppId(context, environmentName);
|
|
24
25
|
|
|
@@ -30,19 +31,15 @@ async function listUiBuilderComponents(context, envName) {
|
|
|
30
31
|
environmentName,
|
|
31
32
|
})
|
|
32
33
|
.promise();
|
|
33
|
-
|
|
34
|
+
printer.debug(JSON.stringify(uiBuilderComponents, null, 2));
|
|
34
35
|
return uiBuilderComponents;
|
|
35
36
|
} catch (e) {
|
|
36
|
-
|
|
37
|
+
printer.debug(e);
|
|
37
38
|
throw e;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
async function listUiBuilderThemes(context, envName) {
|
|
42
|
-
if (process.env.MOCK_UI_BUILDER_BACKEND) {
|
|
43
|
-
return mockUiBuilderThemes;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
43
|
const environmentName = getEnvName(context, envName);
|
|
47
44
|
const appId = getAppId(context, environmentName);
|
|
48
45
|
|
|
@@ -54,10 +51,10 @@ async function listUiBuilderThemes(context, envName) {
|
|
|
54
51
|
environmentName,
|
|
55
52
|
})
|
|
56
53
|
.promise();
|
|
57
|
-
|
|
54
|
+
printer.debug(JSON.stringify(uiBuilderThemes, null, 2));
|
|
58
55
|
return uiBuilderThemes;
|
|
59
56
|
} catch (e) {
|
|
60
|
-
|
|
57
|
+
printer.debug(e);
|
|
61
58
|
throw e;
|
|
62
59
|
}
|
|
63
60
|
}
|
|
@@ -68,13 +65,13 @@ function generateUiBuilderComponents(context, componentSchemas) {
|
|
|
68
65
|
const component = createUiBuilderComponent(context, schema);
|
|
69
66
|
return { resultType: 'SUCCESS', component };
|
|
70
67
|
} catch (e) {
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
printer.debug(`Failure caught processing ${schema.name}`);
|
|
69
|
+
printer.debug(e);
|
|
73
70
|
return { resultType: 'FAILURE', schemaName: schema.name, error: e };
|
|
74
71
|
}
|
|
75
72
|
});
|
|
76
73
|
|
|
77
|
-
|
|
74
|
+
printer.debug(
|
|
78
75
|
`Generated ${componentResults.filter(result => result.resultType === 'SUCCESS').length} components in ${getUiBuilderComponentsPath(
|
|
79
76
|
context,
|
|
80
77
|
)}`,
|
|
@@ -88,13 +85,13 @@ function generateUiBuilderThemes(context, themeSchemas) {
|
|
|
88
85
|
const theme = createUiBuilderTheme(context, schema);
|
|
89
86
|
return { resultType: 'SUCCESS', theme };
|
|
90
87
|
} catch (e) {
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
printer.debug(`Failure caught processing ${schema.name}`);
|
|
89
|
+
printer.debug(e);
|
|
93
90
|
return { resultType: 'FAILURE', schemaName: schema.name, error: e };
|
|
94
91
|
}
|
|
95
92
|
});
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
printer.debug(
|
|
98
95
|
`Generated ${themeResults.filter(result => result.resultType === 'SUCCESS').length} themes in ${getUiBuilderComponentsPath(context)}`,
|
|
99
96
|
);
|
|
100
97
|
return themeResults;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { printer } = require('amplify-prompts');
|
|
2
2
|
|
|
3
3
|
async function run(context) {
|
|
4
4
|
try {
|
|
@@ -8,7 +8,7 @@ async function run(context) {
|
|
|
8
8
|
]);
|
|
9
9
|
} catch (e) {
|
|
10
10
|
// Swallow all errors from the uibuilder plugin
|
|
11
|
-
|
|
11
|
+
printer.debug(e);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { printer } = require('amplify-prompts');
|
|
2
2
|
|
|
3
3
|
async function run(context) {
|
|
4
4
|
try {
|
|
5
5
|
await context.amplify.invokePluginMethod(context, 'ui-builder', undefined, 'executeAmplifyCommand', [context, 'generateComponents']);
|
|
6
6
|
} catch (e) {
|
|
7
7
|
// Swallow all errors from the uibuilder plugin
|
|
8
|
-
|
|
8
|
+
printer.debug(e);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/amplify-util-uibuilder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-uibuilder-ts.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@aws-amplify/codegen-ui": "^1.
|
|
16
|
-
"@aws-amplify/codegen-ui-react": "^1.
|
|
15
|
+
"@aws-amplify/codegen-ui": "^1.1.0",
|
|
16
|
+
"@aws-amplify/codegen-ui-react": "^1.1.0",
|
|
17
|
+
"amplify-cli-core": "2.4.3",
|
|
18
|
+
"amplify-prompts": "1.6.0",
|
|
19
|
+
"amplify-provider-awscloudformation": "5.8.1",
|
|
17
20
|
"aws-sdk": "^2.1042.0"
|
|
18
21
|
},
|
|
19
|
-
"
|
|
20
|
-
"amplify-cli-core": "2.4.1"
|
|
21
|
-
},
|
|
22
|
-
"gitHead": "07040c2b2197eeb4ad1fb3fb001ff6ad03b95f0e"
|
|
22
|
+
"gitHead": "4c441df394ea316130e2e0dff91d359d2c338ef7"
|
|
23
23
|
}
|
package/commands/utils/logger.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const log = (message, level = 'log') => {
|
|
2
|
-
if (process.env.VERBOSE_LOGGING) {
|
|
3
|
-
console[level](message);
|
|
4
|
-
}
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const error = message => {
|
|
8
|
-
log(message, 'error');
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const warn = message => {
|
|
12
|
-
log(message, 'warn');
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const info = message => {
|
|
16
|
-
log(message, 'info');
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
module.exports = {
|
|
20
|
-
log,
|
|
21
|
-
error,
|
|
22
|
-
warn,
|
|
23
|
-
info,
|
|
24
|
-
};
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// This file provides mocks for manual testing
|
|
2
|
-
const mockUiBuilderComponents = {
|
|
3
|
-
entities: [
|
|
4
|
-
{
|
|
5
|
-
appId: 'd2o18y21obnmoz',
|
|
6
|
-
bindingProperties: {},
|
|
7
|
-
children: [
|
|
8
|
-
{
|
|
9
|
-
children: [],
|
|
10
|
-
componentType: 'Box',
|
|
11
|
-
properties: {
|
|
12
|
-
width: {
|
|
13
|
-
value: '133px',
|
|
14
|
-
},
|
|
15
|
-
padding: {
|
|
16
|
-
value: '0px 0px 0px 0px',
|
|
17
|
-
},
|
|
18
|
-
backgroundColor: {
|
|
19
|
-
value: 'rgb(255,255,255)',
|
|
20
|
-
},
|
|
21
|
-
height: {
|
|
22
|
-
value: '55px',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
componentType: 'Box',
|
|
28
|
-
environmentName: 'staging',
|
|
29
|
-
id: 'c-65Dz5ryFZKFnfNj8Si',
|
|
30
|
-
name: 'Frame1',
|
|
31
|
-
overrides: {},
|
|
32
|
-
properties: {
|
|
33
|
-
width: {
|
|
34
|
-
value: '291px',
|
|
35
|
-
},
|
|
36
|
-
padding: {
|
|
37
|
-
value: '0px 0px 0px 0px',
|
|
38
|
-
},
|
|
39
|
-
backgroundColor: {
|
|
40
|
-
value: 'rgb(255,255,0)',
|
|
41
|
-
},
|
|
42
|
-
height: {
|
|
43
|
-
value: '158px',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
variants: [],
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
nextToken: '',
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const mockUiBuilderThemes = {
|
|
53
|
-
entities: [
|
|
54
|
-
{
|
|
55
|
-
id: '1234-5678-9010',
|
|
56
|
-
name: 'MyTheme',
|
|
57
|
-
values: [
|
|
58
|
-
{
|
|
59
|
-
key: 'tokens',
|
|
60
|
-
value: {
|
|
61
|
-
children: [
|
|
62
|
-
{
|
|
63
|
-
key: 'colors',
|
|
64
|
-
value: {
|
|
65
|
-
children: [
|
|
66
|
-
{
|
|
67
|
-
key: 'font',
|
|
68
|
-
value: {
|
|
69
|
-
children: [
|
|
70
|
-
{
|
|
71
|
-
key: 'primary',
|
|
72
|
-
value: {
|
|
73
|
-
children: [
|
|
74
|
-
{
|
|
75
|
-
key: 'value',
|
|
76
|
-
value: {
|
|
77
|
-
value: '#008080',
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
overrides: [
|
|
94
|
-
{
|
|
95
|
-
key: 'colorMode',
|
|
96
|
-
value: {
|
|
97
|
-
value: 'dark',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
key: 'tokens',
|
|
102
|
-
value: {
|
|
103
|
-
children: [
|
|
104
|
-
{
|
|
105
|
-
key: 'colors',
|
|
106
|
-
value: {
|
|
107
|
-
children: [
|
|
108
|
-
{
|
|
109
|
-
key: 'black',
|
|
110
|
-
value: {
|
|
111
|
-
children: [
|
|
112
|
-
{
|
|
113
|
-
key: 'value',
|
|
114
|
-
value: {
|
|
115
|
-
value: '#fff',
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
key: 'white',
|
|
123
|
-
value: {
|
|
124
|
-
children: [
|
|
125
|
-
{
|
|
126
|
-
key: 'value',
|
|
127
|
-
value: {
|
|
128
|
-
value: '#000',
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
nextToken: '',
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
module.exports = {
|
|
147
|
-
mockUiBuilderComponents,
|
|
148
|
-
mockUiBuilderThemes,
|
|
149
|
-
};
|