@aws-amplify/amplify-util-uibuilder 1.11.2 → 1.12.0-rc.86c48b34a884a89.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 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.12.0-rc.86c48b34a884a89.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-util-uibuilder@1.11.2...@aws-amplify/amplify-util-uibuilder@1.12.0-rc.86c48b34a884a89.0) (2023-10-04)
7
+
8
+
9
+ ### Features
10
+
11
+ * **amplify-util-uibuilder:** amplify js backwards compatibility ([#13288](https://github.com/aws-amplify/amplify-cli/issues/13288)) ([2db3e18](https://github.com/aws-amplify/amplify-cli/commit/2db3e181cf06954085eb8fade0b26162672327db))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.11.2](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/amplify-util-uibuilder@1.11.1...@aws-amplify/amplify-util-uibuilder@1.11.2) (2023-10-03)
7
18
 
8
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"generateComponents.d.ts","sourceRoot":"","sources":["../../src/commands/generateComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAoB3D,eAAO,MAAM,GAAG,YAAmB,UAAU,aAAa,UAAU,GAAG,UAAU,KAAG,QAAQ,IAAI,CAqG/F,CAAC"}
1
+ {"version":3,"file":"generateComponents.d.ts","sourceRoot":"","sources":["../../src/commands/generateComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAsB3D,eAAO,MAAM,GAAG,YAAmB,UAAU,aAAa,UAAU,GAAG,UAAU,KAAG,QAAQ,IAAI,CA2G/F,CAAC"}
@@ -36,6 +36,11 @@ const run = async (context, eventType) => {
36
36
  }
37
37
  spinner.start('Generating UI components...');
38
38
  const genericDataSchema = dataSchema ? (0, utils_1.mapGenericDataSchemaToCodegen)(dataSchema) : undefined;
39
+ const packageJsonFile = (0, utils_1.parsePackageJsonFile)(context);
40
+ let startCodegenJobDependencies = {};
41
+ if (packageJsonFile) {
42
+ startCodegenJobDependencies = (0, utils_1.getStartCodegenJobDependencies)(packageJsonFile);
43
+ }
39
44
  const job = {
40
45
  renderConfig: {
41
46
  react: {
@@ -44,6 +49,7 @@ const run = async (context, eventType) => {
44
49
  script: 'jsx',
45
50
  renderTypeDeclarations: true,
46
51
  apiConfiguration,
52
+ dependencies: startCodegenJobDependencies,
47
53
  },
48
54
  },
49
55
  autoGenerateForms: studioClient.metadata.autoGenerateForms && studioClient.isGraphQLSupported && hasDataAPI,
@@ -85,7 +91,7 @@ const run = async (context, eventType) => {
85
91
  if (invalidComponentNames.length) {
86
92
  amplify_prompts_1.printer.warn(`The components ${invalidComponentNames.join(', ')} were synced with an older version of Amplify Studio. Please re-sync your components with Figma to get latest features and changes.`);
87
93
  }
88
- (0, utils_1.notifyMissingPackages)(context, hasStorageManagerField);
94
+ (0, utils_1.notifyMissingPackages)(context, hasStorageManagerField, finishedJob.dependencies);
89
95
  await (0, utils_1.deleteDetachedForms)(detachedForms, studioClient);
90
96
  }
91
97
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"generateComponents.js","sourceRoot":"","sources":["../../src/commands/generateComponents.ts"],"names":[],"mappings":";;;;;;AACA,8CAAsB;AACtB,kEAAuD;AAEvD,wCAAiD;AACjD,mCAUiB;AACjB,mFAAgF;AAEhF,qEAAsH;AAK/G,MAAM,GAAG,GAAG,KAAK,EAAE,OAAmB,EAAE,SAAkC,EAAiB,EAAE;;IAClG,IAAI,CAAC,CAAC,MAAM,IAAA,8BAAsB,EAAC,OAAO,CAAC,CAAC,EAAE;QAC5C,OAAO;KACR;IACD,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,EAA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C,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACvF,CAAC;QAEF,IAAI,qBAAqB,CAAC,MAAM,EAAE;YAChC,yBAAO,CAAC,IAAI,CACV,kBAAkB,qBAAqB,CAAC,IAAI,CAC1C,IAAI,CACL,qIAAqI,CACvI,CAAC;SACH;QAED,IAAA,6BAAqB,EAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;QAEvD,MAAM,IAAA,2BAAmB,EAAC,aAAa,EAAE,YAAY,CAAC,CAAC;KACxD;IAAC,OAAO,CAAC,EAAE;QACV,yBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;KAC9C;AACH,CAAC,CAAC;AArGW,QAAA,GAAG,OAqGd"}
1
+ {"version":3,"file":"generateComponents.js","sourceRoot":"","sources":["../../src/commands/generateComponents.ts"],"names":[],"mappings":";;;;;;AACA,8CAAsB;AACtB,kEAAuD;AAEvD,wCAAiD;AACjD,mCAYiB;AACjB,mFAAgF;AAEhF,qEAAsH;AAK/G,MAAM,GAAG,GAAG,KAAK,EAAE,OAAmB,EAAE,SAAkC,EAAiB,EAAE;;IAClG,IAAI,CAAC,CAAC,MAAM,IAAA,8BAAsB,EAAC,OAAO,CAAC,CAAC,EAAE;QAC5C,OAAO;KACR;IACD,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,EAAE,CAAC,CAAC;IACxB,IAAI;QACF,MAAM,YAAY,GAAG,MAAM,6BAAmB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAClF,YAAY,CAAC,cAAc,EAAE;YAC7B,YAAY,CAAC,UAAU,EAA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AC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACvF,CAAC;QAEF,IAAI,qBAAqB,CAAC,MAAM,EAAE;YAChC,yBAAO,CAAC,IAAI,CACV,kBAAkB,qBAAqB,CAAC,IAAI,CAC1C,IAAI,CACL,qIAAqI,CACvI,CAAC;SACH;QAED,IAAA,6BAAqB,EAAC,OAAO,EAAE,sBAAsB,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;QAEjF,MAAM,IAAA,2BAAmB,EAAC,aAAa,EAAE,YAAY,CAAC,CAAC;KACxD;IAAC,OAAO,CAAC,EAAE;QACV,yBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;KAC9C;AACH,CAAC,CAAC;AA3GW,QAAA,GAAG,OA2Gd"}
@@ -1,3 +1,14 @@
1
1
  import { $TSContext } from '@aws-amplify/amplify-cli-core';
2
- export declare const notifyMissingPackages: (context: $TSContext, hasStorageManagerField?: boolean) => void;
2
+ import { CodegenDependencies } from 'aws-sdk/clients/amplifyuibuilder';
3
+ type PackageJson = {
4
+ dependencies: {
5
+ [key: string]: string;
6
+ };
7
+ };
8
+ export declare const parsePackageJsonFile: (context: $TSContext) => PackageJson | undefined;
9
+ export declare const getStartCodegenJobDependencies: (packageJsonFile: PackageJson) => {
10
+ [key: string]: string;
11
+ };
12
+ export declare const notifyMissingPackages: (context: $TSContext, hasStorageManagerField?: boolean, dependencies?: CodegenDependencies | undefined) => void;
13
+ export {};
3
14
  //# sourceMappingURL=notifyMissingPackages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyMissingPackages.d.ts","sourceRoot":"","sources":["../../../src/commands/utils/notifyMissingPackages.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,UAAU,EAAU,MAAM,+BAA+B,CAAC;AAgB/F,eAAO,MAAM,qBAAqB,YAAa,UAAU,2BAA2B,OAAO,KAAG,IA8B7F,CAAC"}
1
+ {"version":3,"file":"notifyMissingPackages.d.ts","sourceRoot":"","sources":["../../../src/commands/utils/notifyMissingPackages.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,UAAU,EAAU,MAAM,+BAA+B,CAAC;AAM/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,KAAK,WAAW,GAAG;IAAE,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAO/D,eAAO,MAAM,oBAAoB,YAAa,UAAU,KAAG,WAAW,GAAG,SAexE,CAAC;AAOF,eAAO,MAAM,8BAA8B,oBAAqB,WAAW;;CAW1E,CAAC;AAMF,eAAO,MAAM,qBAAqB,YACvB,UAAU,2BACM,OAAO,iBACjB,mBAAmB,GAAG,SAAS,KAC7C,IA0BF,CAAC"}
@@ -3,37 +3,61 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.notifyMissingPackages = void 0;
6
+ exports.notifyMissingPackages = exports.getStartCodegenJobDependencies = exports.parsePackageJsonFile = void 0;
7
7
  const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
8
8
  const amplify_prompts_1 = require("@aws-amplify/amplify-prompts");
9
9
  const fs_extra_1 = __importDefault(require("fs-extra"));
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const subset_1 = __importDefault(require("semver/ranges/subset"));
12
- const codegen_ui_react_1 = require("@aws-amplify/codegen-ui-react");
13
12
  const extractArgs_1 = require("./extractArgs");
14
- const getRequiredDependencies = (hasStorageManagerField) => new codegen_ui_react_1.ReactRequiredDependencyProvider().getRequiredDependencies(hasStorageManagerField);
15
- const notifyMissingPackages = (context, hasStorageManagerField) => {
13
+ const parsePackageJsonFile = (context) => {
16
14
  var _a;
17
15
  const args = (0, extractArgs_1.extractArgs)(context);
18
16
  const localEnvFilePath = (_a = args.localEnvFilePath) !== null && _a !== void 0 ? _a : amplify_cli_core_1.pathManager.getLocalEnvFilePath();
19
17
  if (!fs_extra_1.default.existsSync(localEnvFilePath)) {
20
- amplify_prompts_1.printer.debug('localEnvFilePath could not be determined - skipping dependency notification.');
21
- return;
18
+ amplify_prompts_1.printer.debug('localEnvFilePath could not be determined - skipping parsing file.');
19
+ return undefined;
22
20
  }
23
21
  const localEnvJson = amplify_cli_core_1.JSONUtilities.readJson(localEnvFilePath);
24
22
  const packageJsonPath = path_1.default.join(localEnvJson.projectPath, 'package.json');
25
23
  if (!fs_extra_1.default.existsSync(packageJsonPath)) {
26
- amplify_prompts_1.printer.debug('package.json file not found - skipping dependency notification.');
27
- return;
24
+ amplify_prompts_1.printer.debug('package.json file not found');
25
+ return undefined;
28
26
  }
29
27
  const packageJson = amplify_cli_core_1.JSONUtilities.readJson(packageJsonPath);
30
- getRequiredDependencies(hasStorageManagerField).forEach((dependency) => {
31
- const packageIsInstalled = Object.keys(packageJson.dependencies).includes(dependency.dependencyName);
28
+ return packageJson;
29
+ };
30
+ exports.parsePackageJsonFile = parsePackageJsonFile;
31
+ const getStartCodegenJobDependencies = (packageJsonFile) => {
32
+ const codegenDependencies = {};
33
+ ['aws-amplify', '@aws-amplify/ui-react-storage', '@aws-amplify/ui-react'].forEach((dep) => {
34
+ if (packageJsonFile.dependencies[dep]) {
35
+ codegenDependencies[dep] = packageJsonFile.dependencies[dep];
36
+ }
37
+ else {
38
+ codegenDependencies[dep] = 'latest';
39
+ }
40
+ });
41
+ return codegenDependencies;
42
+ };
43
+ exports.getStartCodegenJobDependencies = getStartCodegenJobDependencies;
44
+ const notifyMissingPackages = (context, hasStorageManagerField, dependencies) => {
45
+ const packageJson = (0, exports.parsePackageJsonFile)(context);
46
+ if (!packageJson) {
47
+ amplify_prompts_1.printer.debug('skipping dependency notification.');
48
+ return;
49
+ }
50
+ const dependenciesToCheck = hasStorageManagerField
51
+ ? dependencies
52
+ : dependencies === null || dependencies === void 0 ? void 0 : dependencies.filter((dependency) => dependency.name !== '@aws-amplify/ui-react-storage');
53
+ dependenciesToCheck === null || dependenciesToCheck === void 0 ? void 0 : dependenciesToCheck.forEach((dependency) => {
54
+ var _a;
55
+ const packageIsInstalled = Object.keys(packageJson.dependencies).includes(`${dependency.name}`);
32
56
  if (!packageIsInstalled) {
33
- amplify_prompts_1.printer.warn(`UIBuilder components require "${dependency.dependencyName}" that is not in your package.json. Run \`npm install "${dependency.dependencyName}@${dependency.supportedSemVerPattern}"\`. ${dependency.reason}`);
57
+ amplify_prompts_1.printer.warn(`UIBuilder components require "${dependency.name}" that is not in your package.json. Run \`npm install "${dependency.name}@${dependency.supportedVersion}"\`. ${dependency.reason}`);
34
58
  }
35
- else if (!(0, subset_1.default)(packageJson.dependencies[dependency.dependencyName], dependency.supportedSemVerPattern)) {
36
- amplify_prompts_1.printer.warn(`UIBuilder components require version "${dependency.supportedSemVerPattern}" of "${dependency.dependencyName}". You currently are on version "${packageJson.dependencies[dependency.dependencyName]}". Run \`npm install "${dependency.dependencyName}@${dependency.supportedSemVerPattern}"\`. ${dependency.reason}`);
59
+ else if (!(0, subset_1.default)(packageJson.dependencies[`${dependency.name}`], (_a = dependency.supportedVersion) !== null && _a !== void 0 ? _a : '')) {
60
+ amplify_prompts_1.printer.warn(`UIBuilder components require version "${dependency.supportedVersion}" of "${dependency.name}". You currently are on version "${packageJson.dependencies[`${dependency.name}`]}". Run \`npm install "${dependency.name}@${dependency.supportedVersion}"\`. ${dependency.reason}`);
37
61
  }
38
62
  });
39
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"notifyMissingPackages.js","sourceRoot":"","sources":["../../../src/commands/utils/notifyMissingPackages.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA+F;AAC/F,kEAAuD;AACvD,wDAA0B;AAC1B,gDAAwB;AACxB,kEAA+C;AAE/C,oEAAgF;AAChF,+CAA4C;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AAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QAChG,IAAI,CAAC,kBAAkB,EAAE;YACvB,yBAAO,CAAC,IAAI,CACV,iCAAiC,UAAU,CAAC,IAAI,0DAA0D,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,gBAAgB,QAAQ,UAAU,CAAC,MAAM,EAAE,CACpL,CAAC;SACH;aAAM,IAAI,CAAC,IAAA,gBAAW,EAAC,WAAW,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,MAAA,UAAU,CAAC,gBAAgB,mCAAI,EAAE,CAAC,EAAE;YAC1G,yBAAO,CAAC,IAAI,CACV,yCAAyC,UAAU,CAAC,gBAAgB,SAAS,UAAU,CAAC,IAAI,oCAC1F,WAAW,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAC/C,yBAAyB,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,gBAAgB,QAAQ,UAAU,CAAC,MAAM,EAAE,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA9BW,QAAA,qBAAqB,yBA8BhC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/amplify-util-uibuilder",
3
- "version": "1.11.2",
3
+ "version": "1.12.0-rc.86c48b34a884a89.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -15,12 +15,12 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@aws-amplify/amplify-category-api": "^5.7.2",
18
- "@aws-amplify/amplify-cli-core": "4.2.8",
18
+ "@aws-amplify/amplify-cli-core": "4.2.9-rc.86c48b34a884a89.0",
19
19
  "@aws-amplify/amplify-prompts": "2.8.4",
20
20
  "@aws-amplify/codegen-ui": "2.14.2",
21
21
  "@aws-amplify/codegen-ui-react": "2.14.2",
22
22
  "amplify-codegen": "^4.6.5",
23
- "aws-sdk": "^2.1426.0",
23
+ "aws-sdk": "^2.1464.0",
24
24
  "fs-extra": "^8.1.0",
25
25
  "node-fetch": "^2.6.7",
26
26
  "ora": "^4.0.3",
@@ -82,5 +82,5 @@
82
82
  "@yarn/plugin-typescript"
83
83
  ]
84
84
  },
85
- "gitHead": "45905641d25424137c4ea2fb4aaf2053766ddc49"
85
+ "gitHead": "ea9478726bbeba3f0cb454f41b4e874941550460"
86
86
  }