From 77fe89242a2a0d14d6dd5b9c6cc1802162c74aaa Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Tue, 14 Nov 2023 13:04:54 +0100 Subject: [PATCH 01/12] fix: add missing schema for Button component --- packages/components/button/schema.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/components/button/schema.json diff --git a/packages/components/button/schema.json b/packages/components/button/schema.json new file mode 100644 index 0000000..ce3683d --- /dev/null +++ b/packages/components/button/schema.json @@ -0,0 +1,6 @@ +{ + "name": "Button", + "componentsDependencies": [], + "directoryName": "button", + "packagesDependencies": [] +} From 67a910b19db868f04c428fbe281389ef2b00d251 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Tue, 14 Nov 2023 13:08:35 +0100 Subject: [PATCH 02/12] ci: add components deployment to s3 --- .github/workflows/deploy-staging.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 7b13c04..e7bb018 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -18,11 +18,17 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 - name: Install dependencies run: npm ci - name: Build run: npm run build-storybook - name: Deploy run: aws s3 sync ./storybook-static s3://${{ secrets.S3_BUCKET }} --delete + - name: Deploy Components + run: + aws s3 sync ./packages/components s3://${{ secrets.S3_BUCKET_COMPONENT_ITEMS }}/${{steps.package-version.outputs.current-version}} --delete - name: Invalidate Cloudfront run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION }} --paths "/*" From ff28f46aaf123c89eb4bcd39bce9fa856359275e Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Tue, 14 Nov 2023 13:09:12 +0100 Subject: [PATCH 03/12] feat: bump packages version and add s3 client package --- package.json | 2 +- packages/cli/package-lock.json | 1535 +++++++++++++++++++++++++++++++- packages/cli/package.json | 3 +- 3 files changed, 1537 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 88977cb..b653a98 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "ISC", "description": "TSH Frontend Components", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "test": "jest --passWithNoTests", diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index 398d0a1..30f57e0 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -10,10 +10,13 @@ "license": "ISC", "dependencies": { "@antfu/ni": "^0.21.6", + "@aws-sdk/client-s3": "^3.445.0", "chalk": "^5.3.0", "commander": "^11.0.0", "ora": "^7.0.1", - "prompts": "^2.4.2" + "prompts": "^2.4.2", + "react-slick": "^0.29.0", + "slick-carousel": "^1.8.1" }, "bin": { "tsh-frontend-components-cli": "dist/index.js" @@ -39,6 +42,761 @@ "nun": "bin/nun.mjs" } }, + "node_modules/@aws-crypto/crc32": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-3.0.0.tgz", + "integrity": "sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/crc32/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/crc32c": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32c/-/crc32c-3.0.0.tgz", + "integrity": "sha512-ENNPPManmnVJ4BTXlOjAgD7URidbAznURqD0KvfREyc4o20DPYdEldU1f5cQ7Jbj0CJJSPaMIk/9ZshdB3210w==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/crc32c/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/ie11-detection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", + "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha1-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha1-browser/-/sha1-browser-3.0.0.tgz", + "integrity": "sha512-NJth5c997GLHs6nOYTzFKTbYdMNA6/1XlKVgnZoaZcQ7z7UJlOgj2JdbHE8tiYLS3fzXNCguct77SPGat2raSw==", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha1-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", + "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", + "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", + "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-sdk/client-s3": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.445.0.tgz", + "integrity": "sha512-2G+3MnO78irZRjlfkdvtlKRQ3yuOfrRMg8mztKpMw0q/9WHtwCcmaUUpl1bXwJ+BcNTVHopLQXdbzCeaxxI92w==", + "dependencies": { + "@aws-crypto/sha1-browser": "3.0.0", + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.445.0", + "@aws-sdk/core": "3.445.0", + "@aws-sdk/credential-provider-node": "3.445.0", + "@aws-sdk/middleware-bucket-endpoint": "3.433.0", + "@aws-sdk/middleware-expect-continue": "3.433.0", + "@aws-sdk/middleware-flexible-checksums": "3.433.0", + "@aws-sdk/middleware-host-header": "3.433.0", + "@aws-sdk/middleware-location-constraint": "3.433.0", + "@aws-sdk/middleware-logger": "3.433.0", + "@aws-sdk/middleware-recursion-detection": "3.433.0", + "@aws-sdk/middleware-sdk-s3": "3.440.0", + "@aws-sdk/middleware-signing": "3.433.0", + "@aws-sdk/middleware-ssec": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", + "@aws-sdk/region-config-resolver": "3.433.0", + "@aws-sdk/signature-v4-multi-region": "3.437.0", + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", + "@aws-sdk/util-user-agent-browser": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", + "@aws-sdk/xml-builder": "3.310.0", + "@smithy/config-resolver": "^2.0.16", + "@smithy/eventstream-serde-browser": "^2.0.12", + "@smithy/eventstream-serde-config-resolver": "^2.0.12", + "@smithy/eventstream-serde-node": "^2.0.12", + "@smithy/fetch-http-handler": "^2.2.4", + "@smithy/hash-blob-browser": "^2.0.12", + "@smithy/hash-node": "^2.0.12", + "@smithy/hash-stream-node": "^2.0.12", + "@smithy/invalid-dependency": "^2.0.12", + "@smithy/md5-js": "^2.0.12", + "@smithy/middleware-content-length": "^2.0.14", + "@smithy/middleware-endpoint": "^2.1.3", + "@smithy/middleware-retry": "^2.0.18", + "@smithy/middleware-serde": "^2.0.12", + "@smithy/middleware-stack": "^2.0.6", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/node-http-handler": "^2.1.8", + "@smithy/protocol-http": "^3.0.8", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "@smithy/url-parser": "^2.0.12", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.16", + "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", + "@smithy/util-retry": "^2.0.5", + "@smithy/util-stream": "^2.0.17", + "@smithy/util-utf8": "^2.0.0", + "@smithy/util-waiter": "^2.0.12", + "fast-xml-parser": "4.2.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.445.0.tgz", + "integrity": "sha512-me4LvqNnu6kxi+sW7t0AgMv1Yi64ikas0x2+5jv23o6Csg32w0S0xOjCTKQYahOA5CMFunWvlkFIfxbqs+Uo7w==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/core": "3.445.0", + "@aws-sdk/middleware-host-header": "3.433.0", + "@aws-sdk/middleware-logger": "3.433.0", + "@aws-sdk/middleware-recursion-detection": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", + "@aws-sdk/region-config-resolver": "3.433.0", + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", + "@aws-sdk/util-user-agent-browser": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", + "@smithy/config-resolver": "^2.0.16", + "@smithy/fetch-http-handler": "^2.2.4", + "@smithy/hash-node": "^2.0.12", + "@smithy/invalid-dependency": "^2.0.12", + "@smithy/middleware-content-length": "^2.0.14", + "@smithy/middleware-endpoint": "^2.1.3", + "@smithy/middleware-retry": "^2.0.18", + "@smithy/middleware-serde": "^2.0.12", + "@smithy/middleware-stack": "^2.0.6", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/node-http-handler": "^2.1.8", + "@smithy/protocol-http": "^3.0.8", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "@smithy/url-parser": "^2.0.12", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.16", + "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", + "@smithy/util-retry": "^2.0.5", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.445.0.tgz", + "integrity": "sha512-ogbdqrS8x9O5BTot826iLnTQ6i4/F5BSi/74gycneCxYmAnYnyUBNOWVnynv6XZiEWyDJQCU2UtMd52aNGW1GA==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/core": "3.445.0", + "@aws-sdk/credential-provider-node": "3.445.0", + "@aws-sdk/middleware-host-header": "3.433.0", + "@aws-sdk/middleware-logger": "3.433.0", + "@aws-sdk/middleware-recursion-detection": "3.433.0", + "@aws-sdk/middleware-sdk-sts": "3.433.0", + "@aws-sdk/middleware-signing": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", + "@aws-sdk/region-config-resolver": "3.433.0", + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", + "@aws-sdk/util-user-agent-browser": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", + "@smithy/config-resolver": "^2.0.16", + "@smithy/fetch-http-handler": "^2.2.4", + "@smithy/hash-node": "^2.0.12", + "@smithy/invalid-dependency": "^2.0.12", + "@smithy/middleware-content-length": "^2.0.14", + "@smithy/middleware-endpoint": "^2.1.3", + "@smithy/middleware-retry": "^2.0.18", + "@smithy/middleware-serde": "^2.0.12", + "@smithy/middleware-stack": "^2.0.6", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/node-http-handler": "^2.1.8", + "@smithy/protocol-http": "^3.0.8", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "@smithy/url-parser": "^2.0.12", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.16", + "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", + "@smithy/util-retry": "^2.0.5", + "@smithy/util-utf8": "^2.0.0", + "fast-xml-parser": "4.2.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.445.0.tgz", + "integrity": "sha512-6GYLElUG1QTOdmXG8zXa+Ull9IUeSeItKDYHKzHYfIkbsagMfYlf7wm9XIYlatjtgodNfZ3gPHAJfRyPmwKrsg==", + "dependencies": { + "@smithy/smithy-client": "^2.1.12", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.433.0.tgz", + "integrity": "sha512-Vl7Qz5qYyxBurMn6hfSiNJeUHSqfVUlMt0C1Bds3tCkl3IzecRWwyBOlxtxO3VCrgVeW3HqswLzCvhAFzPH6nQ==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.445.0.tgz", + "integrity": "sha512-R7IYSGjNZ5KKJwQJ2HNPemjpAMWvdce91i8w+/aHfqeGfTXrmYJu99PeGRyyBTKEumBaojyjTRvmO8HzS+/l7g==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.433.0", + "@aws-sdk/credential-provider-process": "3.433.0", + "@aws-sdk/credential-provider-sso": "3.445.0", + "@aws-sdk/credential-provider-web-identity": "3.433.0", + "@aws-sdk/types": "3.433.0", + "@smithy/credential-provider-imds": "^2.0.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.445.0.tgz", + "integrity": "sha512-zI4k4foSjQRKNEsouculRcz7IbLfuqdFxypDLYwn+qPNMqJwWJ7VxOOeBSPUpHFcd7CLSfbHN2JAhQ7M02gPTA==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.433.0", + "@aws-sdk/credential-provider-ini": "3.445.0", + "@aws-sdk/credential-provider-process": "3.433.0", + "@aws-sdk/credential-provider-sso": "3.445.0", + "@aws-sdk/credential-provider-web-identity": "3.433.0", + "@aws-sdk/types": "3.433.0", + "@smithy/credential-provider-imds": "^2.0.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.433.0.tgz", + "integrity": "sha512-W7FcGlQjio9Y/PepcZGRyl5Bpwb0uWU7qIUCh+u4+q2mW4D5ZngXg8V/opL9/I/p4tUH9VXZLyLGwyBSkdhL+A==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.445.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.445.0.tgz", + "integrity": "sha512-gJz7kAiDecdhtApgXnxfZsXKsww8BnifDF9MAx9Dr4X6no47qYsCCS3XPuEyRiF9VebXvHOH0H260Zp3bVyniQ==", + "dependencies": { + "@aws-sdk/client-sso": "3.445.0", + "@aws-sdk/token-providers": "3.438.0", + "@aws-sdk/types": "3.433.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.433.0.tgz", + "integrity": "sha512-RlwjP1I5wO+aPpwyCp23Mk8nmRbRL33hqRASy73c4JA2z2YiRua+ryt6MalIxehhwQU6xvXUKulJnPG9VaMFZg==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.433.0.tgz", + "integrity": "sha512-Lk1xIu2tWTRa1zDw5hCF1RrpWQYSodUhrS/q3oKz8IAoFqEy+lNaD5jx+fycuZb5EkE4IzWysT+8wVkd0mAnOg==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-arn-parser": "3.310.0", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "@smithy/util-config-provider": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.433.0.tgz", + "integrity": "sha512-Uq2rPIsjz0CR2sulM/HyYr5WiqiefrSRLdwUZuA7opxFSfE808w5DBWSprHxbH3rbDSQR4nFiOiVYIH8Eth7nA==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.433.0.tgz", + "integrity": "sha512-Ptssx373+I7EzFUWjp/i/YiNFt6I6sDuRHz6DOUR9nmmRTlHHqmdcBXlJL2d9wwFxoBRCN8/PXGsTc/DJ4c95Q==", + "dependencies": { + "@aws-crypto/crc32": "3.0.0", + "@aws-crypto/crc32c": "3.0.0", + "@aws-sdk/types": "3.433.0", + "@smithy/is-array-buffer": "^2.0.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.433.0.tgz", + "integrity": "sha512-mBTq3UWv1UzeHG+OfUQ2MB/5GEkt5LTKFaUqzL7ESwzW8XtpBgXnjZvIwu3Vcd3sEetMwijwaGiJhY0ae/YyaA==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.433.0.tgz", + "integrity": "sha512-2YD860TGntwZifIUbxm+lFnNJJhByR/RB/+fV1I8oGKg+XX2rZU+94pRfHXRywoZKlCA0L+LGDA1I56jxrB9sw==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.433.0.tgz", + "integrity": "sha512-We346Fb5xGonTGVZC9Nvqtnqy74VJzYuTLLiuuftA5sbNzftBDy/22QCfvYSTOAl3bvif+dkDUzQY2ihc5PwOQ==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.433.0.tgz", + "integrity": "sha512-HEvYC9PQlWY/ccUYtLvAlwwf1iCif2TSAmLNr3YTBRVa98x6jKL0hlCrHWYklFeqOGSKy6XhE+NGJMUII0/HaQ==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.440.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.440.0.tgz", + "integrity": "sha512-DVTSr+82Z8jR9xTwDN3YHzxX7qvi0n96V92OfxvSRDq2BldCEx/KEL1orUZjw97SAXhINOlUWjRR7j4HpwWQtQ==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-arn-parser": "3.310.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.433.0.tgz", + "integrity": "sha512-ORYbJnBejUyonFl5FwIqhvI3Cq6sAp9j+JpkKZtFNma9tFPdrhmYgfCeNH32H/wGTQV/tUoQ3luh0gA4cuk6DA==", + "dependencies": { + "@aws-sdk/middleware-signing": "3.433.0", + "@aws-sdk/types": "3.433.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.433.0.tgz", + "integrity": "sha512-jxPvt59NZo/epMNLNTu47ikmP8v0q217I6bQFGJG7JVFnfl36zDktMwGw+0xZR80qiK47/2BWrNpta61Zd2FxQ==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/signature-v4": "^2.0.0", + "@smithy/types": "^2.4.0", + "@smithy/util-middleware": "^2.0.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.433.0.tgz", + "integrity": "sha512-2AMaPx0kYfCiekxoL7aqFqSSoA9du+yI4zefpQNLr+1cZOerYiDxdsZ4mbqStR1CVFaX6U6hrYokXzjInsvETw==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.438.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.438.0.tgz", + "integrity": "sha512-a+xHT1wOxT6EA6YyLmrfaroKWOkwwyiktUfXKM0FsUutGzNi4fKhb5NZ2al58NsXzHgHFrasSDp+Lqbd/X2cEw==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.433.0.tgz", + "integrity": "sha512-xpjRjCZW+CDFdcMmmhIYg81ST5UAnJh61IHziQEk0FXONrg4kjyYPZAOjEdzXQ+HxJQuGQLKPhRdzxmQnbX7pg==", + "dependencies": { + "@smithy/node-config-provider": "^2.1.3", + "@smithy/types": "^2.4.0", + "@smithy/util-config-provider": "^2.0.0", + "@smithy/util-middleware": "^2.0.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.437.0.tgz", + "integrity": "sha512-MmrqudssOs87JgVg7HGVdvJws/t4kcOrJJd+975ki+DPeSoyK2U4zBDfDkJ+n0tFuZBs3sLwLh0QXE7BV28rRA==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/signature-v4": "^2.0.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.438.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.438.0.tgz", + "integrity": "sha512-G2fUfTtU6/1ayYRMu0Pd9Ln4qYSvwJOWCqJMdkDgvXSwdgcOSOLsnAIk1AHGJDAvgLikdCzuyOsdJiexr9Vnww==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/middleware-host-header": "3.433.0", + "@aws-sdk/middleware-logger": "3.433.0", + "@aws-sdk/middleware-recursion-detection": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", + "@aws-sdk/region-config-resolver": "3.433.0", + "@aws-sdk/types": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", + "@aws-sdk/util-user-agent-browser": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", + "@smithy/config-resolver": "^2.0.16", + "@smithy/fetch-http-handler": "^2.2.4", + "@smithy/hash-node": "^2.0.12", + "@smithy/invalid-dependency": "^2.0.12", + "@smithy/middleware-content-length": "^2.0.14", + "@smithy/middleware-endpoint": "^2.1.3", + "@smithy/middleware-retry": "^2.0.18", + "@smithy/middleware-serde": "^2.0.12", + "@smithy/middleware-stack": "^2.0.6", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/node-http-handler": "^2.1.8", + "@smithy/property-provider": "^2.0.0", + "@smithy/protocol-http": "^3.0.8", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "@smithy/url-parser": "^2.0.12", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.16", + "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", + "@smithy/util-retry": "^2.0.5", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.433.0.tgz", + "integrity": "sha512-0jEE2mSrNDd8VGFjTc1otYrwYPIkzZJEIK90ZxisKvQ/EURGBhNzWn7ejWB9XCMFT6XumYLBR0V9qq5UPisWtA==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.310.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.310.0.tgz", + "integrity": "sha512-jL8509owp/xB9+Or0pvn3Fe+b94qfklc2yPowZZIFAkFcCSIdkIglz18cPDWnYAcy9JGewpMS1COXKIUhZkJsA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.438.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.438.0.tgz", + "integrity": "sha512-6VyPTq1kN3GWxwFt5DdZfOsr6cJZPLjWh0troY/0uUv3hK74C9o3Y0Xf/z8UAUvQFkVqZse12O0/BgPVMImvfA==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/util-endpoints": "^1.0.2", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.310.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.310.0.tgz", + "integrity": "sha512-qo2t/vBTnoXpjKxlsC2e1gBrRm80M3bId27r0BRB2VniSSe7bL1mmzM+/HFtujm0iAxtPM+aLEflLJlJeDPg0w==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.433.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.433.0.tgz", + "integrity": "sha512-2Cf/Lwvxbt5RXvWFXrFr49vXv0IddiUwrZoAiwhDYxvsh+BMnh+NUFot+ZQaTrk/8IPZVDeLPWZRdVy00iaVXQ==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/types": "^2.4.0", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.437.0.tgz", + "integrity": "sha512-JVEcvWaniamtYVPem4UthtCNoTBCfFTwYj7Y3CrWZ2Qic4TqrwLkAfaBGtI2TGrhIClVr77uzLI6exqMTN7orA==", + "dependencies": { + "@aws-sdk/types": "3.433.0", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-utf8-browser": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", + "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/xml-builder": { + "version": "3.310.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.310.0.tgz", + "integrity": "sha512-TqELu4mOuSIKQCqj63fGVs86Yh+vBx5nHRpWKNUNhB2nPTpfbziTs5c1X358be3peVWA4wPxW7Nt53KIg1tnNw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -486,6 +1244,622 @@ "node": ">= 8" } }, + "node_modules/@smithy/abort-controller": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-2.0.12.tgz", + "integrity": "sha512-YIJyefe1mi3GxKdZxEBEuzYOeQ9xpYfqnFmWzojCssRAuR7ycxwpoRQgp965vuW426xUAQhCV5rCaWElQ7XsaA==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-2.0.0.tgz", + "integrity": "sha512-k+J4GHJsMSAIQPChGBrjEmGS+WbPonCXesoqP9fynIqjn7rdOThdH8FAeCmokP9mxTYKQAKoHCLPzNlm6gh7Wg==", + "dependencies": { + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-2.0.0.tgz", + "integrity": "sha512-HM8V2Rp1y8+1343tkZUKZllFhEQPNmpNdgFAncbTsxkZ18/gqjk23XXv3qGyXWp412f3o43ZZ1UZHVcHrpRnCQ==", + "dependencies": { + "@smithy/util-base64": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-2.0.16.tgz", + "integrity": "sha512-1k+FWHQDt2pfpXhJsOmNMmlAZ3NUQ98X5tYsjQhVGq+0X6cOBMhfh6Igd0IX3Ut6lEO6DQAdPMI/blNr3JZfMQ==", + "dependencies": { + "@smithy/node-config-provider": "^2.1.3", + "@smithy/types": "^2.4.0", + "@smithy/util-config-provider": "^2.0.0", + "@smithy/util-middleware": "^2.0.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-2.0.18.tgz", + "integrity": "sha512-QnPBi6D2zj6AHJdUTo5zXmk8vwHJ2bNevhcVned1y+TZz/OI5cizz5DsYNkqFUIDn8tBuEyKNgbmKVNhBbuY3g==", + "dependencies": { + "@smithy/node-config-provider": "^2.1.3", + "@smithy/property-provider": "^2.0.13", + "@smithy/types": "^2.4.0", + "@smithy/url-parser": "^2.0.12", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-2.0.12.tgz", + "integrity": "sha512-ZZQLzHBJkbiAAdj2C5K+lBlYp/XJ+eH2uy+jgJgYIFW/o5AM59Hlj7zyI44/ZTDIQWmBxb3EFv/c5t44V8/g8A==", + "dependencies": { + "@aws-crypto/crc32": "3.0.0", + "@smithy/types": "^2.4.0", + "@smithy/util-hex-encoding": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-2.0.12.tgz", + "integrity": "sha512-0pi8QlU/pwutNshoeJcbKR1p7Ie5STd8UFAMX5xhSoSJjNlxIv/OsHbF023jscMRN2Prrqd6ToGgdCnsZVQjvg==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^2.0.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-2.0.12.tgz", + "integrity": "sha512-I0XfwQkIX3gAnbrU5rLMkBSjTM9DHttdbLwf12CXmj7SSI5dT87PxtKLRrZGanaCMbdf2yCep+MW5/4M7IbvQA==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-2.0.12.tgz", + "integrity": "sha512-vf1vMHGOkG3uqN9x1zKOhnvW/XgvhJXWqjV6zZiT2FMjlEayugQ1mzpSqr7uf89+BzjTzuZKERmOsEAmewLbxw==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^2.0.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-2.0.12.tgz", + "integrity": "sha512-xZ3ZNpCxIND+q+UCy7y1n1/5VQEYicgSTNCcPqsKawX+Vd+6OcFX7gUHMyPzL8cZr+GdmJuxNleqHlH4giK2tw==", + "dependencies": { + "@smithy/eventstream-codec": "^2.0.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-2.2.4.tgz", + "integrity": "sha512-gIPRFEGi+c6V52eauGKrjDzPWF2Cu7Z1r5F8A3j2wcwz25sPG/t8kjsbEhli/tS/2zJp/ybCZXe4j4ro3yv/HA==", + "dependencies": { + "@smithy/protocol-http": "^3.0.8", + "@smithy/querystring-builder": "^2.0.12", + "@smithy/types": "^2.4.0", + "@smithy/util-base64": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/hash-blob-browser": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-2.0.12.tgz", + "integrity": "sha512-riLnV16f27yyePX8UF0deRHAeccUK8SrOxyTykSTrnVkgS3DsjNapZtTbd8OGNKEbI60Ncdb5GwN3rHZudXvog==", + "dependencies": { + "@smithy/chunked-blob-reader": "^2.0.0", + "@smithy/chunked-blob-reader-native": "^2.0.0", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-2.0.12.tgz", + "integrity": "sha512-fDZnTr5j9t5qcbeJ037aMZXxMka13Znqwrgy3PAqYj6Dm3XHXHftTH3q+NWgayUxl1992GFtQt1RuEzRMy3NnQ==", + "dependencies": { + "@smithy/types": "^2.4.0", + "@smithy/util-buffer-from": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/hash-stream-node": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-2.0.12.tgz", + "integrity": "sha512-x/DrSynPKrW0k00q7aZ/vy531a3mRw79mOajHp+cIF0TrA1SqEMFoy/B8X0XtoAtlJWt/vvgeDNqt/KAeaAqMw==", + "dependencies": { + "@smithy/types": "^2.4.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-2.0.12.tgz", + "integrity": "sha512-p5Y+iMHV3SoEpy3VSR7mifbreHQwVSvHSAz/m4GdoXfOzKzaYC8hYv10Ks7Deblkf7lhas8U+lAp9ThbBM+ZXA==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.0.0.tgz", + "integrity": "sha512-z3PjFjMyZNI98JFRJi/U0nGoLWMSJlDjAW4QUX2WNZLas5C0CmVV6LJ01JI0k90l7FvpmixjWxPFmENSClQ7ug==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/md5-js": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-2.0.12.tgz", + "integrity": "sha512-OgDt+Xnrw+W5z3MSl5KZZzebqmXrYl9UdbCiBYnnjErmNywwSjV6QB/Oic3/7hnsPniSU81n7Rvlhz2kH4EREQ==", + "dependencies": { + "@smithy/types": "^2.4.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-2.0.14.tgz", + "integrity": "sha512-poUNgKTw9XwPXfX9nEHpVgrMNVpaSMZbshqvPxFVoalF4wp6kRzYKOfdesSVectlQ51VtigoLfbXcdyPwvxgTg==", + "dependencies": { + "@smithy/protocol-http": "^3.0.8", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-2.1.3.tgz", + "integrity": "sha512-ZrQ0/YX6hNVTxqMEHtEaDbDv6pNeEji/a5Vk3HuFC5R3ZY8lfoATyxmOGxBVYnF3NUvZLNC7umEv1WzWGWvCGQ==", + "dependencies": { + "@smithy/middleware-serde": "^2.0.12", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/shared-ini-file-loader": "^2.2.2", + "@smithy/types": "^2.4.0", + "@smithy/url-parser": "^2.0.12", + "@smithy/util-middleware": "^2.0.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-2.0.18.tgz", + "integrity": "sha512-VyrHQRldGSb3v9oFOB5yPxmLT7U2sQic2ytylOnYlnsmVOLlFIaI6sW22c+w2675yq+XZ6HOuzV7x2OBYCWRNA==", + "dependencies": { + "@smithy/node-config-provider": "^2.1.3", + "@smithy/protocol-http": "^3.0.8", + "@smithy/service-error-classification": "^2.0.5", + "@smithy/types": "^2.4.0", + "@smithy/util-middleware": "^2.0.5", + "@smithy/util-retry": "^2.0.5", + "tslib": "^2.5.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-2.0.12.tgz", + "integrity": "sha512-IBeco157lIScecq2Z+n0gq56i4MTnfKxS7rbfrAORveDJgnbBAaEQgYqMqp/cYqKrpvEXcyTjwKHrBjCCIZh2A==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-2.0.6.tgz", + "integrity": "sha512-YSvNZeOKWLJ0M/ycxwDIe2Ztkp6Qixmcml1ggsSv2fdHKGkBPhGrX5tMzPGMI1yyx55UEYBi2OB4s+RriXX48A==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-2.1.3.tgz", + "integrity": "sha512-J6lXvRHGVnSX3n1PYi+e1L5HN73DkkJpUviV3Ebf+8wSaIjAf+eVNbzyvh/S5EQz7nf4KVfwbD5vdoZMAthAEQ==", + "dependencies": { + "@smithy/property-provider": "^2.0.13", + "@smithy/shared-ini-file-loader": "^2.2.2", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-2.1.8.tgz", + "integrity": "sha512-KZylM7Wff/So5SmCiwg2kQNXJ+RXgz34wkxS7WNwIUXuZrZZpY/jKJCK+ZaGyuESDu3TxcaY+zeYGJmnFKbQsA==", + "dependencies": { + "@smithy/abort-controller": "^2.0.12", + "@smithy/protocol-http": "^3.0.8", + "@smithy/querystring-builder": "^2.0.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-2.0.13.tgz", + "integrity": "sha512-VJqUf2CbsQX6uUiC5dUPuoEATuFjkbkW3lJHbRnpk9EDC9X+iKqhfTK+WP+lve5EQ9TcCI1Q6R7hrg41FyC54w==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-3.0.8.tgz", + "integrity": "sha512-SHJvYeWq8q0FK8xHk+xjV9dzDUDjFMT+G1pZbV+XB6OVoac/FSVshlMNPeUJ8AmSkcDKHRu5vASnRqZHgD3qhw==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-2.0.12.tgz", + "integrity": "sha512-cDbF07IuCjiN8CdGvPzfJjXIrmDSelScRfyJYrYBNBbKl2+k7QD/KqiHhtRyEKgID5mmEVrV6KE6L/iPJ98sFw==", + "dependencies": { + "@smithy/types": "^2.4.0", + "@smithy/util-uri-escape": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-2.0.12.tgz", + "integrity": "sha512-fytyTcXaMzPBuNtPlhj5v6dbl4bJAnwKZFyyItAGt4Tgm9HFPZNo7a9r1SKPr/qdxUEBzvL9Rh+B9SkTX3kFxg==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-2.0.5.tgz", + "integrity": "sha512-M0SeJnEgD2ywJyV99Fb1yKFzmxDe9JfpJiYTVSRMyRLc467BPU0qsuuDPzMCdB1mU8M8u1rVOdkqdoyFN8UFTw==", + "dependencies": { + "@smithy/types": "^2.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-2.2.2.tgz", + "integrity": "sha512-noyQUPn7b1M8uB0GEXc/Zyxq+5K2b7aaqWnLp+hgJ7+xu/FCvtyWy5eWLDjQEsHnAet2IZhS5QF8872OR69uNg==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-2.0.12.tgz", + "integrity": "sha512-6Kc2lCZEVmb1nNYngyNbWpq0d82OZwITH11SW/Q0U6PX5fH7B2cIcFe7o6eGEFPkTZTP8itTzmYiGcECL0D0Lw==", + "dependencies": { + "@smithy/eventstream-codec": "^2.0.12", + "@smithy/is-array-buffer": "^2.0.0", + "@smithy/types": "^2.4.0", + "@smithy/util-hex-encoding": "^2.0.0", + "@smithy/util-middleware": "^2.0.5", + "@smithy/util-uri-escape": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "2.1.12", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-2.1.12.tgz", + "integrity": "sha512-XXqhridfkKnpj+lt8vM6HRlZbqUAqBjVC74JIi13F/AYQd/zTj9SOyGfxnbp4mjY9q28LityxIuV8CTinr9r5w==", + "dependencies": { + "@smithy/middleware-stack": "^2.0.6", + "@smithy/types": "^2.4.0", + "@smithy/util-stream": "^2.0.17", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-2.4.0.tgz", + "integrity": "sha512-iH1Xz68FWlmBJ9vvYeHifVMWJf82ONx+OybPW8ZGf5wnEv2S0UXcU4zwlwJkRXuLKpcSLHrraHbn2ucdVXLb4g==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-2.0.12.tgz", + "integrity": "sha512-qgkW2mZqRvlNUcBkxYB/gYacRaAdck77Dk3/g2iw0S9F0EYthIS3loGfly8AwoWpIvHKhkTsCXXQfzksgZ4zIA==", + "dependencies": { + "@smithy/querystring-parser": "^2.0.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/util-base64": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-2.0.0.tgz", + "integrity": "sha512-Zb1E4xx+m5Lud8bbeYi5FkcMJMnn+1WUnJF3qD7rAdXpaL7UjkFQLdmW5fHadoKbdHpwH9vSR8EyTJFHJs++tA==", + "dependencies": { + "@smithy/util-buffer-from": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-2.0.0.tgz", + "integrity": "sha512-JdDuS4ircJt+FDnaQj88TzZY3+njZ6O+D3uakS32f2VNnDo3vyEuNdBOh/oFd8Df1zSZOuH1HEChk2AOYDezZg==", + "dependencies": { + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-2.1.0.tgz", + "integrity": "sha512-/li0/kj/y3fQ3vyzn36NTLGmUwAICb7Jbe/CsWCktW363gh1MOcpEcSO3mJ344Gv2dqz8YJCLQpb6hju/0qOWw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.0.0.tgz", + "integrity": "sha512-/YNnLoHsR+4W4Vf2wL5lGv0ksg8Bmk3GEGxn2vEQt52AQaPSCuaO5PM5VM7lP1K9qHRKHwrPGktqVoAHKWHxzw==", + "dependencies": { + "@smithy/is-array-buffer": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-2.0.0.tgz", + "integrity": "sha512-xCQ6UapcIWKxXHEU4Mcs2s7LcFQRiU3XEluM2WcCjjBtQkUN71Tb+ydGmJFPxMUrW/GWMgQEEGipLym4XG0jZg==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-2.0.16.tgz", + "integrity": "sha512-Uv5Cu8nVkuvLn0puX+R9zWbSNpLIR3AxUlPoLJ7hC5lvir8B2WVqVEkJLwtixKAncVLasnTVjPDCidtAUTGEQw==", + "dependencies": { + "@smithy/property-provider": "^2.0.13", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "2.0.21", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-2.0.21.tgz", + "integrity": "sha512-cUEsttVZ79B7Al2rWK2FW03HBpD9LyuqFtm+1qFty5u9sHSdesr215gS2Ln53fTopNiPgeXpdoM3IgjvIO0rJw==", + "dependencies": { + "@smithy/config-resolver": "^2.0.16", + "@smithy/credential-provider-imds": "^2.0.18", + "@smithy/node-config-provider": "^2.1.3", + "@smithy/property-provider": "^2.0.13", + "@smithy/smithy-client": "^2.1.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-1.0.2.tgz", + "integrity": "sha512-QEdq+sP68IJHAMVB2ugKVVZEWeKQtZLuf+akHzc8eTVElsZ2ZdVLWC6Cp+uKjJ/t4yOj1qu6ZzyxJQEQ8jdEjg==", + "dependencies": { + "@smithy/node-config-provider": "^2.1.3", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-2.0.0.tgz", + "integrity": "sha512-c5xY+NUnFqG6d7HFh1IFfrm3mGl29lC+vF+geHv4ToiuJCBmIfzx6IeHLg+OgRdPFKDXIw6pvi+p3CsscaMcMA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-2.0.5.tgz", + "integrity": "sha512-1lyT3TcaMJQe+OFfVI+TlomDkPuVzb27NZYdYtmSTltVmLaUjdCyt4KE+OH1CnhZKsz4/cdCL420Lg9UH5Z2Mw==", + "dependencies": { + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-2.0.5.tgz", + "integrity": "sha512-x3t1+MQAJ6QONk3GTbJNcugCFDVJ+Bkro5YqQQK1EyVesajNDqxFtCx9WdOFNGm/Cbm7tUdwVEmfKQOJoU2Vtw==", + "dependencies": { + "@smithy/service-error-classification": "^2.0.5", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-2.0.17.tgz", + "integrity": "sha512-fP/ZQ27rRvHsqItds8yB7jerwMpZFTL3QqbQbidUiG0+mttMoKdP0ZqnvM8UK5q0/dfc3/pN7g4XKPXOU7oRWw==", + "dependencies": { + "@smithy/fetch-http-handler": "^2.2.4", + "@smithy/node-http-handler": "^2.1.8", + "@smithy/types": "^2.4.0", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-buffer-from": "^2.0.0", + "@smithy/util-hex-encoding": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-2.0.0.tgz", + "integrity": "sha512-ebkxsqinSdEooQduuk9CbKcI+wheijxEb3utGXkCoYQkJnwTnLbH1JXGimJtUkQwNQbsbuYwG2+aFVyZf5TLaw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.0.0.tgz", + "integrity": "sha512-rctU1VkziY84n5OXe3bPNpKR001ZCME2JCaBBFgtiM2hfKbHFudc/BkMuPab8hRbLd0j3vbnBTTZ1igBf0wgiQ==", + "dependencies": { + "@smithy/util-buffer-from": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-waiter": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-2.0.12.tgz", + "integrity": "sha512-3sENmyVa1NnOPoiT2NCApPmu7ukP7S/v7kL9IxNmnygkDldn7/yK0TP42oPJLwB2k3mospNsSePIlqdXEUyPHA==", + "dependencies": { + "@smithy/abort-controller": "^2.0.12", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -636,6 +2010,11 @@ "readable-stream": "^3.4.0" } }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -743,6 +2122,11 @@ "fsevents": "~2.3.2" } }, + "node_modules/classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "node_modules/cli-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", @@ -850,6 +2234,11 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz", "integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==" }, + "node_modules/enquire.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/enquire.js/-/enquire.js-2.1.6.tgz", + "integrity": "sha512-/KujNpO+PT63F7Hlpu4h3pE3TokKRHN26JYmQpPyjkRD/N57R7bPDNojMXdi7uveAKjYB7yQnartCxZnFWr0Xw==" + }, "node_modules/esbuild": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", @@ -926,6 +2315,27 @@ "node": ">=8.6.0" } }, + "node_modules/fast-xml-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz", + "integrity": "sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==", + "funding": [ + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + }, + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -1174,6 +2584,26 @@ "node": ">=10" } }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "peer": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, + "node_modules/json2mq": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", + "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==", + "dependencies": { + "string-convert": "^0.2.0" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -1206,6 +2636,11 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -1227,6 +2662,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -1491,6 +2938,47 @@ } ] }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/react-slick": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/react-slick/-/react-slick-0.29.0.tgz", + "integrity": "sha512-TGdOKE+ZkJHHeC4aaoH85m8RnFyWqdqRfAGkhd6dirmATXMZWAxOpTLmw2Ll/jPTQ3eEG7ercFr/sbzdeYCJXA==", + "dependencies": { + "classnames": "^2.2.5", + "enquire.js": "^2.1.6", + "json2mq": "^0.2.0", + "lodash.debounce": "^4.0.8", + "resize-observer-polyfill": "^1.5.0" + }, + "peerDependencies": { + "react": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -1516,6 +3004,11 @@ "node": ">=8.10.0" } }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -1608,6 +3101,15 @@ } ] }, + "node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1648,6 +3150,14 @@ "node": ">=8" } }, + "node_modules/slick-carousel": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/slick-carousel/-/slick-carousel-1.8.1.tgz", + "integrity": "sha512-XB9Ftrf2EEKfzoQXt3Nitrt/IPbT+f1fgqBdoxO3W/+JYvtEOW6EgxnWfr9GH6nmULv7Y2tPmEX3koxThVmebA==", + "peerDependencies": { + "jquery": ">=1.8.0" + } + }, "node_modules/source-map": { "version": "0.8.0-beta.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", @@ -1682,6 +3192,11 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-convert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", + "integrity": "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==" + }, "node_modules/string-width": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", @@ -1721,6 +3236,11 @@ "node": ">=6" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, "node_modules/sucrase": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", @@ -1852,6 +3372,11 @@ } } }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "node_modules/tsup": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz", @@ -1915,6 +3440,14 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/packages/cli/package.json b/packages/cli/package.json index f5cf82e..7c1fc6b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -8,12 +8,13 @@ "bin": "dist/index.js", "type": "module", "scripts": { - "build": "tsup && rm -rf ./dist/components && cp -r ../components ./dist/components && node dist/index.js buildSchema ", + "build": "tsup && node dist/index.js buildSchema ", "init": "if [ -d dist ]; then node dist/index.js init; else npm run build && node dist/index.js; fi", "copy": "if [ -d dist ]; then node dist/index.js copy; else npm run build && node dist/index.js; fi" }, "dependencies": { "@antfu/ni": "^0.21.6", + "@aws-sdk/client-s3": "^3.445.0", "chalk": "^5.3.0", "commander": "^11.0.0", "ora": "^7.0.1", From a51471ad8987bfd6fb19df79575720bbb6482540 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Tue, 14 Nov 2023 13:41:46 +0100 Subject: [PATCH 04/12] feat: update build schema and copy components from s3 --- package-lock.json | 4 +- packages/cli/commands/buildSchema.ts | 48 +++++++++++----- packages/cli/commands/copy.ts | 26 ++++++--- packages/cli/shared/constants.ts | 8 +++ packages/cli/shared/prompts.ts | 2 +- packages/cli/types/index.ts | 2 + .../cli/utils/copyAwsFolderWithExclusion.ts | 57 +++++++++++++++++++ packages/cli/utils/copyComponents.ts | 41 +++++++------ packages/cli/utils/getBucketContent.ts | 41 +++++++++++++ packages/cli/utils/getS3Object.ts | 18 ++++++ packages/cli/utils/installDependencies.ts | 30 ++++++++-- packages/cli/utils/s3Client.ts | 9 +++ 12 files changed, 239 insertions(+), 47 deletions(-) create mode 100644 packages/cli/utils/copyAwsFolderWithExclusion.ts create mode 100644 packages/cli/utils/getBucketContent.ts create mode 100644 packages/cli/utils/getS3Object.ts create mode 100644 packages/cli/utils/s3Client.ts diff --git a/package-lock.json b/package-lock.json index 368e086..e4b01c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tsh-frontend-components", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tsh-frontend-components", - "version": "0.0.0", + "version": "1.0.0", "license": "ISC", "dependencies": { "@emotion/react": "11.11.1", diff --git a/packages/cli/commands/buildSchema.ts b/packages/cli/commands/buildSchema.ts index 2e96d16..9565ad0 100644 --- a/packages/cli/commands/buildSchema.ts +++ b/packages/cli/commands/buildSchema.ts @@ -2,10 +2,11 @@ import { Command } from 'commander'; import fs from 'fs'; import path from 'path'; -import { __dirname, componentsDirectoryPath, defaultEncoding, schemaFileName } from '../shared/constants'; -import { getDirectories } from '../utils/getDirectories'; +import { __dirname, COMPONENT_ITEMS_BUCKET, EXCLUDED_BASE_S3_PATHS, schemaFileName } from '../shared/constants'; import { SchemaComponent } from '../types'; import { logger } from '../utils/logger'; +import { getS3Object } from '../utils/getS3Object'; +import { getBucketContent } from '../utils/getBucketContent'; export const buildSchema = new Command(); @@ -15,20 +16,41 @@ buildSchema .action(async () => { const components: SchemaComponent[] = []; - getDirectories(componentsDirectoryPath).forEach((dirName) => { - const schemaPath = path.resolve('../components', dirName, schemaFileName); - const isSchemaDefined = fs.existsSync(schemaPath); + try { + const { pathList, Contents } = await getBucketContent(); - if (!isSchemaDefined) { - logger.error(`Couldn't build CLI, schema.json is missing for ${dirName} component`); + if (!pathList) { + logger.error(`Couldn't find list of folders with components in S3`); process.exit(0); } - const component = JSON.parse(fs.readFileSync(schemaPath, defaultEncoding)) as SchemaComponent; - components.push(component); - }); + for (const element of pathList) { + if (!element || EXCLUDED_BASE_S3_PATHS.includes(element)) { + continue; + } - const schemaJsonFile = JSON.stringify({ components }); - const destinationPath = path.join(__dirname, schemaFileName); - fs.writeFileSync(destinationPath, schemaJsonFile); + const schemaPath = `${element}/${schemaFileName}`; + const getSchema = Contents?.find((content) => content.Key === schemaPath); + const dirName = element?.split(path.sep).at(-1); + + if (!getSchema || !getSchema?.Key) { + logger.error(`Couldn't build CLI, schema.json is missing for path ${dirName}`); + process.exit(0); + } + + const getObjectItem = await getS3Object(COMPONENT_ITEMS_BUCKET, getSchema.Key); + + if (getObjectItem) { + const component = JSON.parse(getObjectItem); + components.push(component); + } + } + + const schemaJsonFile = JSON.stringify({ components }); + const destinationPath = path.join(__dirname, schemaFileName); + + fs.writeFileSync(destinationPath, schemaJsonFile); + } catch (error) { + logger.error("Couldn't find selected component, try again"); + } }); diff --git a/packages/cli/commands/copy.ts b/packages/cli/commands/copy.ts index 3356152..618802b 100644 --- a/packages/cli/commands/copy.ts +++ b/packages/cli/commands/copy.ts @@ -8,16 +8,16 @@ import { logger } from '../utils/logger'; import { settingsJsonOutputPath, defaultEncoding, - componentsDirectoryPath, jsonFileExtenstion, storiesFileExtenstion, + packageVersion, } from '../shared/constants'; import { generatePath } from '../utils/generatePath'; import { installDependencies } from '../utils/installDependencies'; -import { isDirectoryEmpty } from '../utils/isDirectoryEmpty'; -import { copyDirectoryWithExclusion } from '../utils/copyDirectoryWithExclusion'; import { PromptSelectChoices, PromptsNames, SettingsFile } from '../types/index'; import { promptsMap } from '../shared/prompts'; +import { copyAwsFolderWithExclusion } from '../utils/copyAwsFolderWithExclusion'; +import { getBucketContent } from '../utils/getBucketContent'; const getCopyPrompts = ({ projectsChoices, @@ -58,10 +58,12 @@ copy const componentsChoices: PromptSelectChoices = []; const { components, getComponentByName } = getSchema(); + const { pathList, Contents } = await getBucketContent(); + try { components.forEach(({ name, directoryName }) => { - const directoryPath = generatePath({ basePath: componentsDirectoryPath, targetPath: directoryName }); - const isEmpty = isDirectoryEmpty(directoryPath); + const directoryPath = generatePath({ basePath: `${packageVersion}/`, targetPath: directoryName }); + const isEmpty = !pathList?.includes(directoryPath); if (isEmpty) return; @@ -80,7 +82,6 @@ copy } const copyPrompts = getCopyPrompts({ projectsChoices, componentsChoices }); - const results = await prompts(copyPrompts, { onCancel: () => process.exit(0) }); const { path: outputPath, packageManager } = results.project ?? projectsChoices[0].value; const destinationDirectory = `${outputPath}/${path.basename(results.srcPath)}`; @@ -89,8 +90,9 @@ copy : [jsonFileExtenstion]; try { - copyDirectoryWithExclusion({ - sourceDirectory: results.srcPath, + copyAwsFolderWithExclusion({ + Contents, + folderPath: results.srcPath, destinationDirectory, excludedExtensions, }); @@ -109,5 +111,11 @@ copy if (!component) return; - await installDependencies({ component, outputPath, packageManager }); + await installDependencies({ + component, + packageManager, + Contents, + pathList, + destinationDirectory, + }); }); diff --git a/packages/cli/shared/constants.ts b/packages/cli/shared/constants.ts index a07fc65..4788fda 100644 --- a/packages/cli/shared/constants.ts +++ b/packages/cli/shared/constants.ts @@ -17,4 +17,12 @@ export const promptTypes = { confirm: 'confirm', text: 'text', } as const; + export const packageManagers = ['npm', 'yarn']; + +/* eslint-disable @typescript-eslint/no-var-requires */ +export const { version: packageVersion } = require('../../../package.json'); + +export const COMPONENT_ITEMS_BUCKET = process.env.S3_BUCKET_COMPONENT_ITEMS || ''; + +export const EXCLUDED_BASE_S3_PATHS = [`${packageVersion}/.`, `${packageVersion}/`, `.`]; diff --git a/packages/cli/shared/prompts.ts b/packages/cli/shared/prompts.ts index 92a62ee..a86d9ab 100644 --- a/packages/cli/shared/prompts.ts +++ b/packages/cli/shared/prompts.ts @@ -8,7 +8,7 @@ import { packageManagers, promptTypes } from './constants'; export const promptsMap = { [PromptsNames.Packages]: (packages: string[]) => ({ name: PromptsNames.Packages, - message: `Which packages used by that component would you like to instal?`, + message: `Which packages used by that component would you like to install?`, type: promptTypes.multiselect, choices: packages.map((packageName) => ({ value: packageName, title: packageName })), instructions: false, diff --git a/packages/cli/types/index.ts b/packages/cli/types/index.ts index cd46a04..f3b2d6c 100644 --- a/packages/cli/types/index.ts +++ b/packages/cli/types/index.ts @@ -38,3 +38,5 @@ export enum PackageManagers { Npm = 'npm', Yarn = 'yarn', } + +export type PathList = Array; diff --git a/packages/cli/utils/copyAwsFolderWithExclusion.ts b/packages/cli/utils/copyAwsFolderWithExclusion.ts new file mode 100644 index 0000000..63e50ee --- /dev/null +++ b/packages/cli/utils/copyAwsFolderWithExclusion.ts @@ -0,0 +1,57 @@ +import path from 'path'; +import fs from 'fs'; +import { ListObjectsV2Output } from '@aws-sdk/client-s3'; + +import { COMPONENT_ITEMS_BUCKET, packageVersion } from '../shared/constants'; + +import { getS3Object } from './getS3Object'; +import { logger } from './logger'; + +interface CopyAwsFolderWithExclusionArguments { + folderPath: string; + Contents: ListObjectsV2Output['Contents']; + destinationDirectory: string; + excludedExtensions: string[]; +} + +export const copyAwsFolderWithExclusion = async ({ + folderPath, + Contents, + destinationDirectory, + excludedExtensions, +}: CopyAwsFolderWithExclusionArguments) => { + const dir = path.dirname(destinationDirectory); + + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + + if (!Contents) { + return; + } + + try { + const getContentsByFolderPath = Contents.filter((content) => content.Key?.includes(folderPath)); + + for (const object of getContentsByFolderPath) { + if (excludedExtensions.length && excludedExtensions.some((extension) => object.Key?.includes(extension))) { + return; + } + + const getObjectItem = await getS3Object(COMPONENT_ITEMS_BUCKET, object.Key as string); + const destinationDirName = `${path.dirname(destinationDirectory)}/`; + const filePath = `${destinationDirName}${object.Key?.replace(packageVersion, '')}`; + const dirName = `${destinationDirName}${path.dirname(object.Key || '').replace(packageVersion, '')}`; + + if (!fs.existsSync(dirName)) { + fs.mkdirSync(dirName, { recursive: true }); + } + + if (!fs.existsSync(filePath) && getObjectItem) { + await fs.writeFileSync(filePath, getObjectItem); + } + } + } catch (error) { + logger.error("Couldn't find selected component, try again"); + } +}; diff --git a/packages/cli/utils/copyComponents.ts b/packages/cli/utils/copyComponents.ts index e6e6e99..959ab09 100644 --- a/packages/cli/utils/copyComponents.ts +++ b/packages/cli/utils/copyComponents.ts @@ -1,40 +1,49 @@ import prompts from 'prompts'; -import path from 'path'; +import { ListObjectsV2Output } from '@aws-sdk/client-s3'; -import { componentsDirectoryPath, jsonFileExtenstion, storiesFileExtenstion } from '../shared/constants'; +import { jsonFileExtenstion, packageVersion, storiesFileExtenstion } from '../shared/constants'; import { promptsMap } from '../shared/prompts'; -import { PromptsNames } from '../types/index'; +import { PathList, PromptsNames } from '../types/index'; import { logger } from './logger'; import { generatePath } from './generatePath'; -import { isDirectoryEmpty } from './isDirectoryEmpty'; -import { copyDirectoryWithExclusion } from './copyDirectoryWithExclusion'; +import { copyAwsFolderWithExclusion } from './copyAwsFolderWithExclusion'; -export const copyComponents = async (componentsNames: string[], outputPath: string) => { +type CopyComponentsArguments = { + componentsDependencies: string[]; + Contents: ListObjectsV2Output['Contents']; + destinationDirectory: string; + pathList: PathList; +}; + +export const copyComponents = async ({ + componentsDependencies, + Contents, + pathList, + destinationDirectory, +}: CopyComponentsArguments) => { try { - componentsNames.forEach(async (componentName) => { - const componentPath = generatePath({ - basePath: componentsDirectoryPath, - targetPath: componentName.toLowerCase(), - }); - const isEmpty = isDirectoryEmpty(componentPath); + for (const name of componentsDependencies) { + const directoryPath = generatePath({ basePath: `${packageVersion}/`, targetPath: name }); + const isEmpty = !pathList?.includes(directoryPath); if (isEmpty) throw Error(); - const destinationDirectory = path.join(outputPath, componentName.toLocaleLowerCase()); const { shouldIncludeStories } = await prompts([promptsMap[PromptsNames.ShouldIncludeStories]], { onCancel: () => process.exit(0), }); + const excludedExtensions = !shouldIncludeStories ? [jsonFileExtenstion, storiesFileExtenstion] : [jsonFileExtenstion]; - copyDirectoryWithExclusion({ - sourceDirectory: componentPath, + copyAwsFolderWithExclusion({ + Contents, + folderPath: directoryPath, destinationDirectory, excludedExtensions, }); - }); + } } catch (error) { logger.error('There is no component to copy'); } diff --git a/packages/cli/utils/getBucketContent.ts b/packages/cli/utils/getBucketContent.ts new file mode 100644 index 0000000..bca1beb --- /dev/null +++ b/packages/cli/utils/getBucketContent.ts @@ -0,0 +1,41 @@ +import { ListObjectsV2Command, _Object } from '@aws-sdk/client-s3'; +import path from 'path'; + +import { COMPONENT_ITEMS_BUCKET, EXCLUDED_BASE_S3_PATHS } from '../shared/constants'; +import { PathList } from '../types'; + +import { logger } from './logger'; +import { client } from './s3Client'; + +export const getBucketContent = async (): Promise<{ + pathList?: PathList; + Contents?: _Object[]; +}> => { + const command = new ListObjectsV2Command({ + Bucket: COMPONENT_ITEMS_BUCKET, + }); + + try { + const { Contents } = await client.send(command); + const contentsList = Contents?.map((content) => { + if (!content?.Key || EXCLUDED_BASE_S3_PATHS.includes(content?.Key)) { + return; + } + + const pathDirName = path.dirname(content.Key || ''); + const baseFolderName = pathDirName.split(path.sep).slice(0, 2).join(path.sep); + + return baseFolderName; + }).filter(Boolean); + + const pathList = [...new Set(contentsList)]; + + return { + pathList, + Contents, + }; + } catch (error) { + logger.error("Couldn't get access to S3 bucket, please try again"); + throw Error(); + } +}; diff --git a/packages/cli/utils/getS3Object.ts b/packages/cli/utils/getS3Object.ts new file mode 100644 index 0000000..993315c --- /dev/null +++ b/packages/cli/utils/getS3Object.ts @@ -0,0 +1,18 @@ +import { GetObjectCommand } from '@aws-sdk/client-s3'; + +import { client } from './s3Client'; + +export async function getS3Object(Bucket: string, Key: string) { + const getObjectCommand = new GetObjectCommand({ + Bucket, + Key, + }); + + try { + const response = await client.send(getObjectCommand); + const bodyString = await response.Body?.transformToString(); + return bodyString; + } catch (error) { + throw Error(error as string); + } +} diff --git a/packages/cli/utils/installDependencies.ts b/packages/cli/utils/installDependencies.ts index 0f3d9ee..832026f 100644 --- a/packages/cli/utils/installDependencies.ts +++ b/packages/cli/utils/installDependencies.ts @@ -1,6 +1,7 @@ import prompts from 'prompts'; +import { ListObjectsV2Output } from '@aws-sdk/client-s3'; -import { PackageManagers, PromptsNames, SchemaComponent } from '../types/index'; +import { PackageManagers, PathList, PromptsNames, SchemaComponent } from '../types/index'; import { promptsMap } from '../shared/prompts'; import { installPackages } from './installPackages'; @@ -8,17 +9,28 @@ import { copyComponents } from './copyComponents'; interface InstallDependenciesArguments { component: SchemaComponent; - outputPath: string; packageManager: PackageManagers; + Contents: ListObjectsV2Output['Contents']; + destinationDirectory: string; + pathList: PathList; } -export const installDependencies = async ({ component, outputPath, packageManager }: InstallDependenciesArguments) => { +export const installDependencies = async ({ + component, + packageManager, + Contents, + pathList, + destinationDirectory, +}: InstallDependenciesArguments) => { const { packagesDependencies, componentsDependencies } = component; if (packagesDependencies.length) { const packagesPrompt = promptsMap[PromptsNames.Packages](packagesDependencies); - const { packages } = await prompts(packagesPrompt, { onCancel: () => process.exit(0) }); - + const { packages } = await prompts(packagesPrompt, { + onCancel: () => { + return process.exit(0); + }, + }); if (packages.length) await installPackages(packages, packageManager); } @@ -27,6 +39,12 @@ export const installDependencies = async ({ component, outputPath, packageManage const componentsPrompt = promptsMap[PromptsNames.ShouldCopyComponents](components); const { shouldCopyComponents } = await prompts(componentsPrompt, { onCancel: () => process.exit(0) }); - if (shouldCopyComponents) await copyComponents(componentsDependencies, outputPath); + if (shouldCopyComponents) + await copyComponents({ + componentsDependencies, + Contents, + pathList, + destinationDirectory, + }); } }; diff --git a/packages/cli/utils/s3Client.ts b/packages/cli/utils/s3Client.ts new file mode 100644 index 0000000..ae7b999 --- /dev/null +++ b/packages/cli/utils/s3Client.ts @@ -0,0 +1,9 @@ +import { S3Client } from '@aws-sdk/client-s3'; + +export const client = new S3Client({ + region: process.env.AWS_REGION || '', + credentials: { + accessKeyId: process.env.AWS_ACCESS_KEY_ID || '', + secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || '', + }, +}); From 643c82b02deb59e66235b59b0decae9d6f46e44e Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Tue, 14 Nov 2023 13:44:10 +0100 Subject: [PATCH 05/12] fix: add dummy .env file needed to pass gh action --- .env.dist | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .env.dist diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..e69de29 From 07b0c57080881c9b86b3ffc988204e4334570625 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Wed, 15 Nov 2023 08:57:11 +0100 Subject: [PATCH 06/12] docs: change hosting url to cloudfront --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 31bbb1d..d92c913 100644 --- a/README.md +++ b/README.md @@ -156,8 +156,5 @@ npn run build-cli It will transform Typescript source code of CLI to Javascript and copy components directory to `dist`. ### Storybook hosting - -[![Netlify Status](https://api.netlify.com/api/v1/badges/7a89d9c3-1e97-493c-9ce4-14538ef3fe6e/deploy-status)](https://app.netlify.com/sites/tangerine-valkyrie-6f47b8/deploys) - -Storybook is currently hosted at https://tangerine-valkyrie-6f47b8.netlify.app \ No newline at end of file +Storybook is currently hosted at https://dz6s1m3491km4.cloudfront.net/ \ No newline at end of file From b9a3eb6157b3d5deb663efa2dcf1fae571b1cf8a Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Wed, 15 Nov 2023 12:24:59 +0100 Subject: [PATCH 07/12] ci: move component deployment to separate file --- .github/workflows/deploy-components.yml | 26 +++++++++++++++++++++++++ .github/workflows/deploy-staging.yml | 6 ------ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/deploy-components.yml diff --git a/.github/workflows/deploy-components.yml b/.github/workflows/deploy-components.yml new file mode 100644 index 0000000..011fac5 --- /dev/null +++ b/.github/workflows/deploy-components.yml @@ -0,0 +1,26 @@ +name: Deploy components to S3 +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + environment: staging + steps: + - uses: actions/checkout@v2 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + - name: Setup Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + - name: Deploy Components + run: + aws s3 sync ./packages/components s3://${{ secrets.S3_BUCKET_COMPONENT_ITEMS }}/${{steps.package-version.outputs.current-version}} --delete diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index e7bb018..7b13c04 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -18,17 +18,11 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - - name: get-npm-version - id: package-version - uses: martinbeentjes/npm-get-version-action@v1.3.1 - name: Install dependencies run: npm ci - name: Build run: npm run build-storybook - name: Deploy run: aws s3 sync ./storybook-static s3://${{ secrets.S3_BUCKET }} --delete - - name: Deploy Components - run: - aws s3 sync ./packages/components s3://${{ secrets.S3_BUCKET_COMPONENT_ITEMS }}/${{steps.package-version.outputs.current-version}} --delete - name: Invalidate Cloudfront run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION }} --paths "/*" From cc0704342fa2d23979e54e93fc8ca406009c11f8 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Wed, 15 Nov 2023 14:40:21 +0100 Subject: [PATCH 08/12] feat: install dependencies for copied components --- packages/cli/commands/copy.ts | 21 +++++--- packages/cli/shared/prompts.ts | 14 +++-- packages/cli/utils/copyComponents.ts | 25 +++++---- .../utils/installComponentsDependencies.ts | 53 +++++++++++++++++++ packages/cli/utils/installDependencies.ts | 33 ++---------- 5 files changed, 96 insertions(+), 50 deletions(-) create mode 100644 packages/cli/utils/installComponentsDependencies.ts diff --git a/packages/cli/commands/copy.ts b/packages/cli/commands/copy.ts index 618802b..b702e67 100644 --- a/packages/cli/commands/copy.ts +++ b/packages/cli/commands/copy.ts @@ -8,8 +8,8 @@ import { logger } from '../utils/logger'; import { settingsJsonOutputPath, defaultEncoding, - jsonFileExtenstion, - storiesFileExtenstion, + jsonFileExtension, + storiesFileExtension, packageVersion, } from '../shared/constants'; import { generatePath } from '../utils/generatePath'; @@ -18,12 +18,16 @@ import { PromptSelectChoices, PromptsNames, SettingsFile } from '../types/index' import { promptsMap } from '../shared/prompts'; import { copyAwsFolderWithExclusion } from '../utils/copyAwsFolderWithExclusion'; import { getBucketContent } from '../utils/getBucketContent'; +import { installComponentsDependencies } from '../utils/installComponentsDependencies'; const getCopyPrompts = ({ projectsChoices, componentsChoices, }: Record): PromptObject[] => { - const prompts = [promptsMap[PromptsNames.SrcPath](componentsChoices), promptsMap[PromptsNames.ShouldIncludeStories]]; + const prompts = [ + promptsMap[PromptsNames.SrcPath](componentsChoices), + promptsMap[PromptsNames.ShouldIncludeStories](), + ]; if (projectsChoices.length > 1) { prompts.unshift(promptsMap[PromptsNames.Project](projectsChoices)); @@ -86,8 +90,8 @@ copy const { path: outputPath, packageManager } = results.project ?? projectsChoices[0].value; const destinationDirectory = `${outputPath}/${path.basename(results.srcPath)}`; const excludedExtensions = !results.shouldIncludeStories - ? [jsonFileExtenstion, storiesFileExtenstion] - : [jsonFileExtenstion]; + ? [jsonFileExtension, storiesFileExtension] + : [jsonFileExtension]; try { copyAwsFolderWithExclusion({ @@ -109,11 +113,16 @@ copy const component = getComponentByName(copiedComponentName); - if (!component) return; + if (!component || !pathList) return; await installDependencies({ component, packageManager, + }); + + await installComponentsDependencies({ + component, + packageManager, Contents, pathList, destinationDirectory, diff --git a/packages/cli/shared/prompts.ts b/packages/cli/shared/prompts.ts index a86d9ab..42d1243 100644 --- a/packages/cli/shared/prompts.ts +++ b/packages/cli/shared/prompts.ts @@ -6,9 +6,11 @@ import { highlightText } from '../utils/highlightText'; import { packageManagers, promptTypes } from './constants'; export const promptsMap = { - [PromptsNames.Packages]: (packages: string[]) => ({ + [PromptsNames.Packages]: (packages: string[], componentName?: string) => ({ name: PromptsNames.Packages, - message: `Which packages used by that component would you like to install?`, + message: `Which packages used by ${ + componentName ? `${highlightText(componentName)}` : 'that component' + } would you like to install?`, type: promptTypes.multiselect, choices: packages.map((packageName) => ({ value: packageName, title: packageName })), instructions: false, @@ -40,12 +42,14 @@ export const promptsMap = { message: `Which ${highlightText('component')} would you like to copy?`, choices: componentsChoices, }), - [PromptsNames.ShouldIncludeStories]: { + [PromptsNames.ShouldIncludeStories]: (componentName?: string) => ({ type: promptTypes.confirm, name: PromptsNames.ShouldIncludeStories, - message: `Would you like to copy ${highlightText('Storybook (*.stories.tsx)')} files as well?`, + message: `Would you like to copy ${highlightText('Storybook (*.stories.tsx)')} files ${ + componentName ? `for ${highlightText(componentName)} ` : '' + }as well?`, initial: true, - }, + }), [PromptsNames.Project]: (projectsChoices: PromptSelectChoices) => ({ type: promptTypes.select, name: PromptsNames.Project, diff --git a/packages/cli/utils/copyComponents.ts b/packages/cli/utils/copyComponents.ts index 959ab09..3f5618e 100644 --- a/packages/cli/utils/copyComponents.ts +++ b/packages/cli/utils/copyComponents.ts @@ -1,43 +1,47 @@ import prompts from 'prompts'; import { ListObjectsV2Output } from '@aws-sdk/client-s3'; -import { jsonFileExtenstion, packageVersion, storiesFileExtenstion } from '../shared/constants'; +import { jsonFileExtension, packageVersion, storiesFileExtension } from '../shared/constants'; import { promptsMap } from '../shared/prompts'; -import { PathList, PromptsNames } from '../types/index'; +import { PathList, PromptsNames, SchemaComponent } from '../types/index'; import { logger } from './logger'; import { generatePath } from './generatePath'; import { copyAwsFolderWithExclusion } from './copyAwsFolderWithExclusion'; type CopyComponentsArguments = { - componentsDependencies: string[]; + listOfComponentDependencies: Array; Contents: ListObjectsV2Output['Contents']; destinationDirectory: string; pathList: PathList; }; export const copyComponents = async ({ - componentsDependencies, + listOfComponentDependencies, Contents, pathList, destinationDirectory, }: CopyComponentsArguments) => { try { - for (const name of componentsDependencies) { - const directoryPath = generatePath({ basePath: `${packageVersion}/`, targetPath: name }); + for (const component of listOfComponentDependencies) { + const directoryPath = generatePath({ + basePath: `${packageVersion}/`, + targetPath: component?.directoryName || '', + }); + const isEmpty = !pathList?.includes(directoryPath); if (isEmpty) throw Error(); - const { shouldIncludeStories } = await prompts([promptsMap[PromptsNames.ShouldIncludeStories]], { + const { shouldIncludeStories } = await prompts([promptsMap[PromptsNames.ShouldIncludeStories](component?.name)], { onCancel: () => process.exit(0), }); const excludedExtensions = !shouldIncludeStories - ? [jsonFileExtenstion, storiesFileExtenstion] - : [jsonFileExtenstion]; + ? [jsonFileExtension, storiesFileExtension] + : [jsonFileExtension]; - copyAwsFolderWithExclusion({ + await copyAwsFolderWithExclusion({ Contents, folderPath: directoryPath, destinationDirectory, @@ -46,5 +50,6 @@ export const copyComponents = async ({ } } catch (error) { logger.error('There is no component to copy'); + process.exit(0); } }; diff --git a/packages/cli/utils/installComponentsDependencies.ts b/packages/cli/utils/installComponentsDependencies.ts new file mode 100644 index 0000000..c3dce31 --- /dev/null +++ b/packages/cli/utils/installComponentsDependencies.ts @@ -0,0 +1,53 @@ +import prompts from 'prompts'; +import { ListObjectsV2Output } from '@aws-sdk/client-s3'; + +import { PackageManagers, PathList, PromptsNames, SchemaComponent } from '../types/index'; +import { promptsMap } from '../shared/prompts'; + +import { getSchema } from './getSchema'; +import { copyComponents } from './copyComponents'; +import { installDependencies } from './installDependencies'; + +interface InstallComponentsDependenciesArguments { + component: SchemaComponent; + packageManager: PackageManagers; + Contents: ListObjectsV2Output['Contents']; + destinationDirectory: string; + pathList: PathList; +} + +export const installComponentsDependencies = async ({ + component, + packageManager, + Contents, + pathList, + destinationDirectory, +}: InstallComponentsDependenciesArguments) => { + const { componentsDependencies } = component; + + if (componentsDependencies.length) { + const components = componentsDependencies.join(', '); + const componentsPrompt = promptsMap[PromptsNames.ShouldCopyComponents](components); + const { shouldCopyComponents } = await prompts(componentsPrompt, { onCancel: () => process.exit(0) }); + + if (shouldCopyComponents) { + const { getComponentByName } = getSchema(); + const listOfComponentDependencies = componentsDependencies.map((component) => getComponentByName(component)); + + if (listOfComponentDependencies.length > 0) { + await copyComponents({ + listOfComponentDependencies, + Contents, + pathList, + destinationDirectory, + }); + + for (const component of listOfComponentDependencies) { + if (component) { + await installDependencies({ component, packageManager }); + } + } + } + } + } +}; diff --git a/packages/cli/utils/installDependencies.ts b/packages/cli/utils/installDependencies.ts index 832026f..c5f1a03 100644 --- a/packages/cli/utils/installDependencies.ts +++ b/packages/cli/utils/installDependencies.ts @@ -1,31 +1,20 @@ import prompts from 'prompts'; -import { ListObjectsV2Output } from '@aws-sdk/client-s3'; -import { PackageManagers, PathList, PromptsNames, SchemaComponent } from '../types/index'; +import { PackageManagers, PromptsNames, SchemaComponent } from '../types/index'; import { promptsMap } from '../shared/prompts'; import { installPackages } from './installPackages'; -import { copyComponents } from './copyComponents'; interface InstallDependenciesArguments { component: SchemaComponent; packageManager: PackageManagers; - Contents: ListObjectsV2Output['Contents']; - destinationDirectory: string; - pathList: PathList; } -export const installDependencies = async ({ - component, - packageManager, - Contents, - pathList, - destinationDirectory, -}: InstallDependenciesArguments) => { - const { packagesDependencies, componentsDependencies } = component; +export const installDependencies = async ({ component, packageManager }: InstallDependenciesArguments) => { + const { packagesDependencies, name } = component; if (packagesDependencies.length) { - const packagesPrompt = promptsMap[PromptsNames.Packages](packagesDependencies); + const packagesPrompt = promptsMap[PromptsNames.Packages](packagesDependencies, name); const { packages } = await prompts(packagesPrompt, { onCancel: () => { return process.exit(0); @@ -33,18 +22,4 @@ export const installDependencies = async ({ }); if (packages.length) await installPackages(packages, packageManager); } - - if (componentsDependencies.length) { - const components = componentsDependencies.join(', '); - const componentsPrompt = promptsMap[PromptsNames.ShouldCopyComponents](components); - const { shouldCopyComponents } = await prompts(componentsPrompt, { onCancel: () => process.exit(0) }); - - if (shouldCopyComponents) - await copyComponents({ - componentsDependencies, - Contents, - pathList, - destinationDirectory, - }); - } }; From 0d9c722e21697a311bd29409cd9c4e36150cef81 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Fri, 17 Nov 2023 12:44:14 +0100 Subject: [PATCH 09/12] feat: add prompt option to select multiple components at once --- packages/cli/shared/prompts.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/cli/shared/prompts.ts b/packages/cli/shared/prompts.ts index 42d1243..9d64b57 100644 --- a/packages/cli/shared/prompts.ts +++ b/packages/cli/shared/prompts.ts @@ -5,6 +5,10 @@ import { highlightText } from '../utils/highlightText'; import { packageManagers, promptTypes } from './constants'; +const MULTISELECT_HINT = `${highlightText('SPACE')} to select | ${highlightText('ENTER')} to submit | ${highlightText( + 'A', +)} to select/unselect all`; + export const promptsMap = { [PromptsNames.Packages]: (packages: string[], componentName?: string) => ({ name: PromptsNames.Packages, @@ -14,9 +18,7 @@ export const promptsMap = { type: promptTypes.multiselect, choices: packages.map((packageName) => ({ value: packageName, title: packageName })), instructions: false, - hint: `${highlightText('SPACE')} to select | ${highlightText('ENTER')} to submit | ${highlightText( - 'A', - )} to select/unselect all`, + hint: MULTISELECT_HINT, }), [PromptsNames.ShouldCopyComponents]: (components: string) => ({ name: PromptsNames.ShouldCopyComponents, @@ -37,10 +39,12 @@ export const promptsMap = { initial: 'my-current-project', }, [PromptsNames.SrcPath]: (componentsChoices: PromptSelectChoices) => ({ - type: promptTypes.select, name: PromptsNames.SrcPath, - message: `Which ${highlightText('component')} would you like to copy?`, + message: `Which ${highlightText('components')} would you like to copy?`, + type: promptTypes.multiselect, choices: componentsChoices, + instructions: false, + hint: MULTISELECT_HINT, }), [PromptsNames.ShouldIncludeStories]: (componentName?: string) => ({ type: promptTypes.confirm, From 35396762c85718db8ad4b75f7f77b6b4e8719a11 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Fri, 17 Nov 2023 12:45:53 +0100 Subject: [PATCH 10/12] fix: problem with blocking copy of other files when first matching extension --- packages/cli/utils/copyAwsFolderWithExclusion.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cli/utils/copyAwsFolderWithExclusion.ts b/packages/cli/utils/copyAwsFolderWithExclusion.ts index 63e50ee..1dcec36 100644 --- a/packages/cli/utils/copyAwsFolderWithExclusion.ts +++ b/packages/cli/utils/copyAwsFolderWithExclusion.ts @@ -32,10 +32,9 @@ export const copyAwsFolderWithExclusion = async ({ try { const getContentsByFolderPath = Contents.filter((content) => content.Key?.includes(folderPath)); - for (const object of getContentsByFolderPath) { - if (excludedExtensions.length && excludedExtensions.some((extension) => object.Key?.includes(extension))) { - return; + if (excludedExtensions.length && excludedExtensions.some((extension) => object.Key?.endsWith(extension))) { + continue; } const getObjectItem = await getS3Object(COMPONENT_ITEMS_BUCKET, object.Key as string); From 9c70bbb0377566b980d860ca0778e28cd9c72e5b Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Fri, 17 Nov 2023 12:47:18 +0100 Subject: [PATCH 11/12] feat: iterate through selected components, exit process when no option is selected --- packages/cli/commands/copy.ts | 77 +++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/packages/cli/commands/copy.ts b/packages/cli/commands/copy.ts index b702e67..32c170f 100644 --- a/packages/cli/commands/copy.ts +++ b/packages/cli/commands/copy.ts @@ -24,15 +24,14 @@ const getCopyPrompts = ({ projectsChoices, componentsChoices, }: Record): PromptObject[] => { - const prompts = [ - promptsMap[PromptsNames.SrcPath](componentsChoices), - promptsMap[PromptsNames.ShouldIncludeStories](), - ]; + const prompts = []; if (projectsChoices.length > 1) { - prompts.unshift(promptsMap[PromptsNames.Project](projectsChoices)); + prompts.push(promptsMap[PromptsNames.Project](projectsChoices)); } + prompts.push(promptsMap[PromptsNames.SrcPath](componentsChoices), promptsMap[PromptsNames.ShouldIncludeStories]()); + return prompts; }; @@ -88,43 +87,51 @@ copy const copyPrompts = getCopyPrompts({ projectsChoices, componentsChoices }); const results = await prompts(copyPrompts, { onCancel: () => process.exit(0) }); const { path: outputPath, packageManager } = results.project ?? projectsChoices[0].value; - const destinationDirectory = `${outputPath}/${path.basename(results.srcPath)}`; - const excludedExtensions = !results.shouldIncludeStories - ? [jsonFileExtension, storiesFileExtension] - : [jsonFileExtension]; - - try { - copyAwsFolderWithExclusion({ - Contents, - folderPath: results.srcPath, - destinationDirectory, - excludedExtensions, - }); - logger.success(`Component was successfully copied to: ${destinationDirectory}`); - } catch (error) { - logger.error("Couldn't copy selected component, try again"); + if (results.srcPath.length === 0) { + logger.error('No component has been selected, try again'); process.exit(0); } - const copiedComponentName = componentsChoices.find(({ value }) => value === results.srcPath)?.title; + for (const resultSrcPath of results.srcPath) { + const destinationDirectory = `${outputPath}/${path.basename(resultSrcPath)}`; + const excludedExtensions = !results.shouldIncludeStories + ? [jsonFileExtension, storiesFileExtension] + : [jsonFileExtension]; + + try { + await copyAwsFolderWithExclusion({ + Contents, + folderPath: resultSrcPath, + destinationDirectory, + excludedExtensions, + }); + + logger.success(`Component was successfully copied to: ${destinationDirectory}`); + } catch (error) { + logger.error("Couldn't copy selected component, try again"); + process.exit(0); + } + + const copiedComponentName = componentsChoices.find(({ value }) => value === resultSrcPath)?.title; - if (typeof copiedComponentName !== 'string') return; + if (typeof copiedComponentName !== 'string') return; - const component = getComponentByName(copiedComponentName); + const component = getComponentByName(copiedComponentName); - if (!component || !pathList) return; + if (!component || !pathList) return; - await installDependencies({ - component, - packageManager, - }); + await installDependencies({ + component, + packageManager, + }); - await installComponentsDependencies({ - component, - packageManager, - Contents, - pathList, - destinationDirectory, - }); + await installComponentsDependencies({ + component, + packageManager, + Contents, + pathList, + destinationDirectory, + }); + } }); From 9036572e6352eac6015c5a13892a986192cb840c Mon Sep 17 00:00:00 2001 From: Przemyslaw Bak Date: Fri, 17 Nov 2023 12:47:59 +0100 Subject: [PATCH 12/12] fix: typos in constants file --- packages/cli/shared/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/shared/constants.ts b/packages/cli/shared/constants.ts index 4788fda..af01a65 100644 --- a/packages/cli/shared/constants.ts +++ b/packages/cli/shared/constants.ts @@ -9,8 +9,8 @@ export const componentsDirectoryPath = path.resolve(__filename, '../components') export const defaultEncoding = 'utf-8'; export const settingsJsonOutputPath = `${currentPath}/cli.settings.json`; export const schemaFileName = 'schema.json'; -export const storiesFileExtenstion = '.stories.tsx'; -export const jsonFileExtenstion = '.json'; +export const storiesFileExtension = '.stories.tsx'; +export const jsonFileExtension = '.json'; export const promptTypes = { multiselect: 'multiselect', select: 'select',