@aws-amplify/amplify-util-uibuilder 1.1.3-beta.6 → 1.2.3-beta.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +10 -3
  2. package/lib/commands/cloneComponentsFromEnv.d.ts +3 -0
  3. package/lib/commands/cloneComponentsFromEnv.d.ts.map +1 -0
  4. package/lib/commands/cloneComponentsFromEnv.js +68 -0
  5. package/lib/commands/cloneComponentsFromEnv.js.map +1 -0
  6. package/lib/commands/generateComponents.d.ts +3 -0
  7. package/lib/commands/generateComponents.d.ts.map +1 -0
  8. package/lib/commands/generateComponents.js +50 -0
  9. package/lib/commands/generateComponents.js.map +1 -0
  10. package/lib/commands/help.d.ts +2 -0
  11. package/lib/commands/help.d.ts.map +1 -0
  12. package/lib/commands/help.js +9 -0
  13. package/lib/commands/help.js.map +1 -0
  14. package/lib/commands/utils/createUiBuilderComponent.d.ts +5 -0
  15. package/lib/commands/utils/createUiBuilderComponent.d.ts.map +1 -0
  16. package/lib/commands/utils/createUiBuilderComponent.js +64 -0
  17. package/lib/commands/utils/createUiBuilderComponent.js.map +1 -0
  18. package/lib/commands/utils/extractArgs.d.ts +11 -0
  19. package/lib/commands/utils/extractArgs.d.ts.map +1 -0
  20. package/lib/commands/utils/extractArgs.js +26 -0
  21. package/lib/commands/utils/extractArgs.js.map +1 -0
  22. package/lib/commands/utils/getUiBuilderComponentsPath.d.ts +3 -0
  23. package/lib/commands/utils/getUiBuilderComponentsPath.d.ts.map +1 -0
  24. package/lib/commands/utils/getUiBuilderComponentsPath.js +20 -0
  25. package/lib/commands/utils/getUiBuilderComponentsPath.js.map +1 -0
  26. package/lib/commands/utils/notifyMissingPackages.d.ts +3 -0
  27. package/lib/commands/utils/notifyMissingPackages.d.ts.map +1 -0
  28. package/lib/commands/utils/notifyMissingPackages.js +45 -0
  29. package/lib/commands/utils/notifyMissingPackages.js.map +1 -0
  30. package/lib/commands/utils/shouldRenderComponents.d.ts +3 -0
  31. package/lib/commands/utils/shouldRenderComponents.d.ts.map +1 -0
  32. package/lib/commands/utils/shouldRenderComponents.js +34 -0
  33. package/lib/commands/utils/shouldRenderComponents.js.map +1 -0
  34. package/lib/commands/utils/syncAmplifyUiBuilderComponents.d.ts +31 -0
  35. package/lib/commands/utils/syncAmplifyUiBuilderComponents.d.ts.map +1 -0
  36. package/lib/commands/utils/syncAmplifyUiBuilderComponents.js +116 -0
  37. package/lib/commands/utils/syncAmplifyUiBuilderComponents.js.map +1 -0
  38. package/lib/commands/version.d.ts +2 -0
  39. package/lib/commands/version.d.ts.map +1 -0
  40. package/lib/commands/version.js +32 -0
  41. package/lib/commands/version.js.map +1 -0
  42. package/lib/event-handlers/handle-PostEnvAdd.d.ts +3 -0
  43. package/lib/event-handlers/handle-PostEnvAdd.d.ts.map +1 -0
  44. package/lib/event-handlers/handle-PostEnvAdd.js +17 -0
  45. package/lib/event-handlers/handle-PostEnvAdd.js.map +1 -0
  46. package/lib/event-handlers/handle-PostPull.d.ts +3 -0
  47. package/lib/event-handlers/handle-PostPull.d.ts.map +1 -0
  48. package/lib/event-handlers/handle-PostPull.js +14 -0
  49. package/lib/event-handlers/handle-PostPull.js.map +1 -0
  50. package/lib/index.d.ts +6 -0
  51. package/lib/index.d.ts.map +1 -0
  52. package/lib/index.js +22 -0
  53. package/lib/index.js.map +1 -0
  54. package/package.json +37 -7
  55. package/src/__tests__/cloneComponentsFromEnv.test.ts +49 -0
  56. package/src/__tests__/createUiBuilderComponent.test.ts +60 -0
  57. package/src/__tests__/generateComponents.test.ts +50 -0
  58. package/src/__tests__/handleEvents.test.ts +21 -0
  59. package/src/__tests__/help.test.ts +10 -0
  60. package/src/__tests__/mock.json +1 -0
  61. package/src/__tests__/notifyMissingPackages.test.ts +89 -0
  62. package/src/__tests__/package.json +3 -0
  63. package/{commands/utils/__tests__/shouldRenderComponents.test.js → src/__tests__/shouldRenderComponents.test.ts} +3 -2
  64. package/src/__tests__/syncAmplifyUiComponents.test.ts +150 -0
  65. package/src/__tests__/version.test.ts +10 -0
  66. package/src/commands/cloneComponentsFromEnv.ts +72 -0
  67. package/{commands/generateComponents.js → src/commands/generateComponents.ts} +13 -15
  68. package/src/commands/help.ts +5 -0
  69. package/src/commands/utils/createUiBuilderComponent.ts +75 -0
  70. package/{commands/utils/extractArgs.js → src/commands/utils/extractArgs.ts} +3 -5
  71. package/{commands/utils/getUiBuilderComponentsPath.js → src/commands/utils/getUiBuilderComponentsPath.ts} +5 -8
  72. package/src/commands/utils/notifyMissingPackages.ts +40 -0
  73. package/src/commands/utils/shouldRenderComponents.ts +34 -0
  74. package/{commands/utils/syncAmplifyUiBuilderComponents.js → src/commands/utils/syncAmplifyUiBuilderComponents.ts} +37 -43
  75. package/src/commands/version.ts +6 -0
  76. package/{event-handlers/handle-PostEnvAdd.js → src/event-handlers/handle-PostEnvAdd.ts} +4 -7
  77. package/{event-handlers/handle-PostPull.js → src/event-handlers/handle-PostPull.ts} +4 -7
  78. package/{index.js → src/index.ts} +6 -10
  79. package/tsconfig.json +9 -0
  80. package/tsconfig.tsbuildinfo +1 -0
  81. package/commands/cloneComponentsFromEnv.js +0 -79
  82. package/commands/help.js +0 -7
  83. package/commands/utils/__tests__/createUiComponents.test.js +0 -46
  84. package/commands/utils/__tests__/syncAmplifyUiComponents.test.js +0 -67
  85. package/commands/utils/createUiBuilderComponent.js +0 -85
  86. package/commands/utils/logger.js +0 -24
  87. package/commands/utils/mockUiBuilderData.js +0 -149
  88. package/commands/utils/notifyMissingPackages.js +0 -27
  89. package/commands/utils/shouldRenderComponents.js +0 -38
  90. package/commands/version.js +0 -10
@@ -1,14 +1,11 @@
1
- const logger = require('../commands/utils/logger');
1
+ import { $TSContext } from 'amplify-cli-core';
2
+ import { printer } from 'amplify-prompts';
2
3
 
3
- async function run(context) {
4
+ export async function run(context: $TSContext) {
4
5
  try {
5
6
  await context.amplify.invokePluginMethod(context, 'ui-builder', undefined, 'executeAmplifyCommand', [context, 'generateComponents']);
6
7
  } catch (e) {
7
8
  // Swallow all errors from the uibuilder plugin
8
- logger.error(e);
9
+ printer.debug(e);
9
10
  }
10
11
  }
11
-
12
- module.exports = {
13
- run,
14
- };
@@ -1,20 +1,16 @@
1
- const path = require('path');
1
+ import { $TSContext } from 'amplify-cli-core';
2
+ import path from 'path';
2
3
 
3
- async function executeAmplifyCommand(context, cmd) {
4
+ export async function executeAmplifyCommand(context: $TSContext, cmd: string) {
4
5
  const commandsDirPath = path.normalize(path.join(__dirname, 'commands'));
5
6
  const commandPath = path.join(commandsDirPath, cmd ? cmd : context.input.command);
6
7
  const commandModule = require(commandPath);
7
8
  await commandModule.run(context);
8
9
  }
9
10
 
10
- async function handleAmplifyEvent(context, args) {
11
+ export async function handleAmplifyEvent(context: $TSContext, { event }: { event: string }) {
11
12
  const eventHandlersDirPath = path.normalize(path.join(__dirname, 'event-handlers'));
12
- const eventHandlerPath = path.join(eventHandlersDirPath, `handle-${args.event}`);
13
+ const eventHandlerPath = path.join(eventHandlersDirPath, `handle-${event}`);
13
14
  const eventHandlerModule = require(eventHandlerPath);
14
- await eventHandlerModule.run(context, args);
15
+ await eventHandlerModule.run(context);
15
16
  }
16
-
17
- module.exports = {
18
- executeAmplifyCommand,
19
- handleAmplifyEvent,
20
- };
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./lib",
5
+ "rootDir": "./src",
6
+ "strict": true,
7
+ "skipLibCheck": true
8
+ }
9
+ }