diff --git a/.projen/deps.json b/.projen/deps.json index f03fdd6..c90be25 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -19,14 +19,6 @@ "name": "@types/jest", "type": "build" }, - { - "name": "@types/lodash.get", - "type": "build" - }, - { - "name": "@types/lodash.set", - "type": "build" - }, { "name": "@types/node", "version": "^14.17.6", @@ -92,14 +84,6 @@ "version": "10.0.0", "type": "bundled" }, - { - "name": "lodash.get", - "type": "bundled" - }, - { - "name": "lodash.set", - "type": "bundled" - }, { "name": "uuid", "type": "bundled" @@ -129,14 +113,6 @@ "version": "10.0.0", "type": "runtime" }, - { - "name": "lodash.get", - "type": "runtime" - }, - { - "name": "lodash.set", - "type": "runtime" - }, { "name": "uuid", "type": "runtime" diff --git a/.projen/tasks.json b/.projen/tasks.json index cb26941..da44344 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -312,7 +312,7 @@ "exec": "npm install" }, { - "exec": "npm update aws-cdk-lib constructs @types/fs-extra @types/jest @types/lodash.get @types/lodash.set @types/node @types/uuid jest jest-junit jsii jsii-diff jsii-docgen jsii-pacmak npm-check-updates standard-version ts-jest typescript yaml fs-extra lodash.get lodash.set uuid fs-extra lodash.get lodash.set uuid" + "exec": "npm update aws-cdk-lib constructs @types/fs-extra @types/jest @types/node @types/uuid jest jest-junit jsii jsii-diff jsii-docgen jsii-pacmak npm-check-updates standard-version ts-jest typescript yaml fs-extra uuid" }, { "exec": "npx projen" diff --git a/.projenrc.js b/.projenrc.js index 38d9edb..179433c 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -1,8 +1,8 @@ - const fs = require('fs-extra'); +const fs = require('fs-extra'); const { awscdk , javascript } = require('projen'); const { stringify } = require('yaml'); -const dependencies = ['fs-extra@10.0.0', 'lodash.get', 'lodash.set', 'uuid']; +const dependencies = ['fs-extra@10.0.0', 'uuid']; const project = new awscdk.AwsCdkConstructLibrary({ author: 'Amazon Web Services', authorAddress: 'amplify-cli@amazon.com', @@ -16,8 +16,6 @@ const project = new awscdk.AwsCdkConstructLibrary({ devDeps: [ '@types/fs-extra@^8.1.1', '@types/jest', - '@types/lodash.get', - '@types/lodash.set', '@types/node', '@types/uuid', 'yaml', diff --git a/package-lock.json b/package-lock.json index fc008cf..a71c89d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,6 @@ "version": "0.0.0", "bundleDependencies": [ "fs-extra", - "lodash.get", - "lodash.set", "uuid" ], "license": "Apache-2.0", @@ -18,15 +16,11 @@ "aws-cdk-lib": "^2.77.0", "constructs": "^10.1.139", "fs-extra": "10.1.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", "uuid": "^8.3.2" }, "devDependencies": { "@types/fs-extra": "^8.1.2", "@types/jest": "^27.5.2", - "@types/lodash.get": "^4.4.7", - "@types/lodash.set": "^4.3.7", "@types/node": "^14.18.21", "@types/uuid": "^8.3.4", "aws-cdk-lib": "2.77.0", @@ -1752,30 +1746,6 @@ "pretty-format": "^27.0.0" } }, - "node_modules/@types/lodash": { - "version": "4.14.182", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", - "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", - "dev": true - }, - "node_modules/@types/lodash.get": { - "version": "4.4.7", - "resolved": "https://registry.npmjs.org/@types/lodash.get/-/lodash.get-4.4.7.tgz", - "integrity": "sha512-af34Mj+KdDeuzsJBxc/XeTtOx0SZHZNLd+hdrn+PcKGQs0EG2TJTzQAOTCZTgDJCArahlCzLWSy8c2w59JRz7Q==", - "dev": true, - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.set": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/@types/lodash.set/-/lodash.set-4.3.7.tgz", - "integrity": "sha512-bS5Wkg/nrT82YUfkNYPSccFrNZRL+irl7Yt4iM6OTSQ0VZJED2oUIVm15NkNtUAQ8SRhCe+axqERUV6MJgkeEg==", - "dev": true, - "dependencies": { - "@types/lodash": "*" - } - }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -6470,12 +6440,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "inBundle": true - }, "node_modules/lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -6488,12 +6452,6 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, - "node_modules/lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==", - "inBundle": true - }, "node_modules/log4js": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.7.0.tgz", @@ -12638,30 +12596,6 @@ "pretty-format": "^27.0.0" } }, - "@types/lodash": { - "version": "4.14.182", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", - "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", - "dev": true - }, - "@types/lodash.get": { - "version": "4.4.7", - "resolved": "https://registry.npmjs.org/@types/lodash.get/-/lodash.get-4.4.7.tgz", - "integrity": "sha512-af34Mj+KdDeuzsJBxc/XeTtOx0SZHZNLd+hdrn+PcKGQs0EG2TJTzQAOTCZTgDJCArahlCzLWSy8c2w59JRz7Q==", - "dev": true, - "requires": { - "@types/lodash": "*" - } - }, - "@types/lodash.set": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/@types/lodash.set/-/lodash.set-4.3.7.tgz", - "integrity": "sha512-bS5Wkg/nrT82YUfkNYPSccFrNZRL+irl7Yt4iM6OTSQ0VZJED2oUIVm15NkNtUAQ8SRhCe+axqERUV6MJgkeEg==", - "dev": true, - "requires": { - "@types/lodash": "*" - } - }, "@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -16182,11 +16116,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" - }, "lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -16199,11 +16128,6 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, - "lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==" - }, "log4js": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.7.0.tgz", diff --git a/package.json b/package.json index c3acc1f..b52c2bd 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,6 @@ "constructs": "10.1.139", "@types/fs-extra": "^8.1.2", "@types/jest": "^27.5.2", - "@types/lodash.get": "^4.4.7", - "@types/lodash.set": "^4.3.7", "@types/node": "^14.18.21", "@types/uuid": "^8.3.4", "jest": "^27.5.1", @@ -64,14 +62,10 @@ "aws-cdk-lib": "^2.77.0", "constructs": "^10.1.139", "fs-extra": "10.1.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", "uuid": "^8.3.2" }, "bundledDependencies": [ "fs-extra", - "lodash.get", - "lodash.set", "uuid" ], "keywords": [ diff --git a/src/export-backend-asset-handler/index.ts b/src/export-backend-asset-handler/index.ts index 7f73d6c..a43248c 100644 --- a/src/export-backend-asset-handler/index.ts +++ b/src/export-backend-asset-handler/index.ts @@ -5,8 +5,6 @@ import { CfnInclude } from 'aws-cdk-lib/cloudformation-include'; import { Stack } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import * as fs from 'fs-extra'; -// eslint-disable-next-line import/no-extraneous-dependencies -import * as _ from 'lodash'; import { v4 } from 'uuid'; import { Constants } from '../constants'; import { @@ -66,9 +64,7 @@ export class AmplifyExportAssetHandler extends Construct { } private referenceDeploymentBucket(): IBucket { - const deploymentBucketName = _.get(this.exportManifest.props.parameters, [ - PARAMETERS_DEPLOYMENT_BUCKET_NAME, - ]); + const deploymentBucketName = this.exportManifest.props.parameters?.[PARAMETERS_DEPLOYMENT_BUCKET_NAME] if (!deploymentBucketName) { throw new Error('deployment bucket not specified'); @@ -328,11 +324,8 @@ export class AmplifyExportAssetHandler extends Construct { private uploadAuthTriggerFiles(resourceName: string): undefined { const logicalId = `${AUTH_CATEGORY.NAME}${resourceName}`; const nestedStacks = this.exportManifest.props.loadNestedStacks; - const verificationBucketName = _.get(nestedStacks, [ - logicalId, - 'parameters', - PARAMTERS_AUTH_VERIFICATION_BUCKET_NAME, - ]); + const verificationBucketName = nestedStacks?.[logicalId]?.parameters?.[PARAMTERS_AUTH_VERIFICATION_BUCKET_NAME] + if (verificationBucketName) { const verificationWithEnv = this.env ? `${verificationBucketName}-${this.env}`