@duffel/components 2.7.20 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +67 -0
- package/.eslintrc.js +47 -0
- package/.github/renovate.json +16 -0
- package/.github/workflows/autoapprove.yml +18 -0
- package/.github/workflows/release.yml +89 -0
- package/.husky/post-commit +4 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/.prettierignore +2 -0
- package/.storybook/Storyshots.test.js +3 -0
- package/.storybook/__snapshots__/Storyshots.test.js.snap +48318 -0
- package/.storybook/main.ts +33 -0
- package/.storybook/preview.tsx +28 -0
- package/.tool-versions +1 -0
- package/CONTRIBUTING.md +83 -0
- package/README.md +53 -15
- package/__mocks__/styleMock.js +6 -0
- package/babel.config.js +20 -0
- package/commitlint.config.js +4 -0
- package/config/esbuild.base.config.js +18 -0
- package/config/esbuild.cdn.config.js +51 -0
- package/config/esbuild.dev.config.js +46 -0
- package/config/esbuild.react.config.js +42 -0
- package/jest.config.ts +14 -0
- package/package.json +135 -193
- package/react-dist/components/DuffelAncillaries/Card.d.ts +14 -0
- package/react-dist/components/DuffelAncillaries/Counter.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/DuffelAncillaries.d.ts +3 -0
- package/react-dist/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +14 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +9 -0
- package/react-dist/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +4 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/Amenity.d.ts +6 -0
- package/react-dist/components/DuffelAncillaries/seats/DeckSelect.d.ts +15 -0
- package/react-dist/components/DuffelAncillaries/seats/Element.d.ts +15 -0
- package/react-dist/components/DuffelAncillaries/seats/EmptyElement.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/ExitElement.d.ts +6 -0
- package/react-dist/components/DuffelAncillaries/seats/Legend.d.ts +12 -0
- package/react-dist/components/DuffelAncillaries/seats/Row.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/RowSection.d.ts +17 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatElement.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatInfo.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatMap.d.ts +12 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +4 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +16 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +5 -0
- package/react-dist/components/DuffelPayments/DuffelPayments.d.ts +11 -0
- package/react-dist/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +14 -0
- package/react-dist/components/shared/AnimatedLoaderEllipsis.d.ts +2 -0
- package/react-dist/components/shared/Button.d.ts +23 -0
- package/react-dist/components/shared/ErrorBoundary.d.ts +13 -0
- package/react-dist/components/shared/FetchOfferErrorState.d.ts +5 -0
- package/react-dist/components/shared/Icon.d.ts +44 -0
- package/react-dist/components/shared/IconButton.d.ts +16 -0
- package/react-dist/components/shared/Modal.d.ts +11 -0
- package/react-dist/components/shared/NonIdealState.d.ts +4 -0
- package/react-dist/components/shared/Stamp.d.ts +7 -0
- package/react-dist/components/shared/Tabs.d.ts +16 -0
- package/react-dist/custom-elements.d.ts +6 -0
- package/react-dist/custom-elements.js +37 -0
- package/react-dist/custom-elements.js.map +7 -0
- package/react-dist/index.d.ts +7 -0
- package/react-dist/index.js +37 -0
- package/react-dist/index.js.map +7 -0
- package/react-dist/lib/captureErrorInSentry.d.ts +1 -0
- package/react-dist/lib/compileCreateOrderPayload.d.ts +14 -0
- package/react-dist/lib/createPriceFormatters.d.ts +12 -0
- package/react-dist/lib/fetchFromDuffelAPI.d.ts +8 -0
- package/react-dist/lib/fetchFromFixtures.d.ts +4 -0
- package/react-dist/lib/formatAvailableServices.d.ts +12 -0
- package/react-dist/lib/formatDate.d.ts +2 -0
- package/react-dist/lib/formatSeatMaps.d.ts +4 -0
- package/react-dist/lib/getBaggageServiceDescription.d.ts +2 -0
- package/react-dist/lib/getCabinsForSegmentAndDeck.d.ts +2 -0
- package/react-dist/lib/getCurrencyForSeatMaps.d.ts +10 -0
- package/react-dist/lib/getCurrencyForServices.d.ts +11 -0
- package/react-dist/lib/getFirstSeatElementMatchingCriteria.d.ts +3 -0
- package/react-dist/lib/getPassengerBySegmentList.d.ts +6 -0
- package/react-dist/lib/getPassengerInitials.d.ts +1 -0
- package/react-dist/lib/getPassengerMapById.d.ts +3 -0
- package/react-dist/lib/getPassengerName.d.ts +3 -0
- package/react-dist/lib/getRowNumber.d.ts +2 -0
- package/react-dist/lib/getSegmentList.d.ts +2 -0
- package/react-dist/lib/getServicePriceMapById.d.ts +3 -0
- package/react-dist/lib/getSymbols.d.ts +2 -0
- package/react-dist/lib/getTotalAmountForServices.d.ts +6 -0
- package/react-dist/lib/getTotalQuantity.d.ts +2 -0
- package/react-dist/lib/hasService.d.ts +2 -0
- package/react-dist/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +3 -0
- package/react-dist/lib/hasWings.d.ts +2 -0
- package/react-dist/lib/isBaggageService.d.ts +2 -0
- package/react-dist/lib/isCancelForAnyReasonService.d.ts +2 -0
- package/react-dist/lib/isFixtureOfferId.d.ts +2 -0
- package/react-dist/lib/isPayloadComplete.d.ts +2 -0
- package/react-dist/lib/isSeatElement.d.ts +2 -0
- package/react-dist/lib/logging.d.ts +46 -0
- package/react-dist/lib/moneyStringFormatter.d.ts +8 -0
- package/react-dist/lib/offerIsExpired.d.ts +2 -0
- package/react-dist/lib/retrieveOffer.d.ts +2 -0
- package/react-dist/lib/retrieveOfferFromDuffelAPI.d.ts +1 -0
- package/react-dist/lib/retrieveSeatMaps.d.ts +2 -0
- package/react-dist/lib/retrieveSeatMapsFromDuffelAPI.d.ts +1 -0
- package/react-dist/lib/setBodyScrollability.d.ts +1 -0
- package/react-dist/lib/validateProps.d.ts +7 -0
- package/react-dist/lib/withPlural.d.ts +1 -0
- package/react-dist/types/Aircraft.d.ts +14 -0
- package/react-dist/types/Airline.d.ts +14 -0
- package/react-dist/types/Airport.d.ts +44 -0
- package/react-dist/types/City.d.ts +18 -0
- package/react-dist/types/CreateOrderPayload.d.ts +72 -0
- package/react-dist/types/CurrencyConversion.d.ts +10 -0
- package/react-dist/types/DuffelAncillariesProps.d.ts +70 -0
- package/react-dist/types/Offer.d.ts +711 -0
- package/react-dist/types/Order.d.ts +8 -0
- package/react-dist/types/Place.d.ts +8 -0
- package/react-dist/types/SeatMap.d.ts +190 -0
- package/react-dist/types/index.d.ts +11 -0
- package/scripts/generate-fixture.ts +200 -0
- package/scripts/upload-to-cdn.sh +34 -0
- package/scripts.tsconfig.json +11 -0
- package/src/components/DuffelAncillaries/Card.tsx +126 -0
- package/src/components/DuffelAncillaries/Counter.tsx +40 -0
- package/src/components/DuffelAncillaries/DuffelAncillaries.tsx +344 -0
- package/src/components/DuffelAncillaries/DuffelAncillariesCustomElement.tsx +124 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionCard.tsx +96 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionController.tsx +88 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModal.tsx +81 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.tsx +60 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.tsx +122 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.tsx +81 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.tsx +76 -0
- package/src/components/DuffelAncillaries/bags/IncludedBaggageBanner.tsx +51 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.tsx +90 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.tsx +63 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.tsx +56 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx +11 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.tsx +74 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.tsx +9 -0
- package/src/components/DuffelAncillaries/seats/Amenity.tsx +21 -0
- package/src/components/DuffelAncillaries/seats/DeckSelect.tsx +27 -0
- package/src/components/DuffelAncillaries/seats/Element.tsx +52 -0
- package/src/components/DuffelAncillaries/seats/EmptyElement.tsx +5 -0
- package/src/components/DuffelAncillaries/seats/ExitElement.tsx +17 -0
- package/src/components/DuffelAncillaries/seats/Legend.tsx +60 -0
- package/src/components/DuffelAncillaries/seats/Row.tsx +47 -0
- package/src/components/DuffelAncillaries/seats/RowSection.tsx +78 -0
- package/src/components/DuffelAncillaries/seats/SeatElement.tsx +120 -0
- package/src/components/DuffelAncillaries/seats/SeatInfo.tsx +32 -0
- package/src/components/DuffelAncillaries/seats/SeatMap.tsx +81 -0
- package/src/components/DuffelAncillaries/seats/SeatMapUnavailable.tsx +21 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionCard.tsx +103 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModal.tsx +142 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalBody.tsx +13 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.tsx +82 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.tsx +87 -0
- package/src/components/DuffelAncillaries/seats/SeatUnavailable.tsx +14 -0
- package/src/components/DuffelPayments/DuffelPayments.tsx +218 -0
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +130 -0
- package/src/components/shared/AnimatedLoaderEllipsis.tsx +5 -0
- package/src/components/shared/Button.tsx +63 -0
- package/src/components/shared/ErrorBoundary.tsx +54 -0
- package/src/components/shared/FetchOfferErrorState.tsx +35 -0
- package/src/components/shared/Icon.tsx +152 -0
- package/src/components/shared/IconButton.tsx +42 -0
- package/src/components/shared/Modal.tsx +40 -0
- package/src/components/shared/NonIdealState.tsx +28 -0
- package/src/components/shared/Stamp.tsx +29 -0
- package/src/components/shared/Tabs.tsx +36 -0
- package/src/custom-elements.ts +13 -0
- package/src/examples/client-side/README.md +30 -0
- package/src/examples/client-side/index.html +57 -0
- package/src/examples/full-stack/README.md +34 -0
- package/src/examples/full-stack/index.html +48 -0
- package/src/examples/full-stack/server.mjs +158 -0
- package/src/examples/just-typescript/README.md +37 -0
- package/src/examples/just-typescript/package.json +16 -0
- package/src/examples/just-typescript/src/index.html +23 -0
- package/src/examples/just-typescript/src/index.ts +36 -0
- package/src/examples/just-typescript/yarn.lock +154 -0
- package/src/examples/payments-custom-element/README.md +17 -0
- package/src/examples/payments-custom-element/index.html +43 -0
- package/src/examples/payments-just-typescript/README.md +37 -0
- package/src/examples/payments-just-typescript/package.json +16 -0
- package/src/examples/payments-just-typescript/src/index.html +23 -0
- package/src/examples/payments-just-typescript/src/index.ts +18 -0
- package/src/examples/payments-just-typescript/yarn.lock +154 -0
- package/src/examples/react-app/README.md +37 -0
- package/src/examples/react-app/package.json +20 -0
- package/src/examples/react-app/src/index.html +19 -0
- package/src/examples/react-app/src/index.tsx +48 -0
- package/src/examples/react-app/yarn.lock +219 -0
- package/src/fixtures/offers/off_0000AUde3KwTztSRK1cznH.json +497 -0
- package/src/fixtures/offers/off_0000AVx4lUFFKW8PsPeQeQ.json +307 -0
- package/src/fixtures/offers/off_1.json +497 -0
- package/src/fixtures/passengers/mock_passengers.ts +26 -0
- package/src/fixtures/seat-maps/off_0000AUde3KwTztSRK1cznH.json +6852 -0
- package/src/fixtures/seat-maps/off_0000AVx4lUFFKW8PsPeQeQ.json +1 -0
- package/src/fixtures/seat-maps/off_1.json +6852 -0
- package/src/index.ts +7 -0
- package/src/lib/captureErrorInSentry.ts +42 -0
- package/src/lib/compileCreateOrderPayload.ts +63 -0
- package/src/lib/createPriceFormatters.ts +73 -0
- package/src/lib/fetchFromDuffelAPI.ts +54 -0
- package/src/lib/fetchFromFixtures.ts +18 -0
- package/src/lib/formatAvailableServices.ts +91 -0
- package/src/lib/formatDate.ts +20 -0
- package/src/lib/formatSeatMaps.ts +81 -0
- package/src/lib/getBaggageServiceDescription.ts +42 -0
- package/src/lib/getCabinsForSegmentAndDeck.ts +4 -0
- package/src/lib/getCurrencyForSeatMaps.ts +22 -0
- package/src/lib/getCurrencyForServices.ts +24 -0
- package/src/lib/getFirstSeatElementMatchingCriteria.ts +22 -0
- package/src/lib/getPassengerBySegmentList.ts +10 -0
- package/src/lib/getPassengerInitials.ts +6 -0
- package/src/lib/getPassengerMapById.ts +17 -0
- package/src/lib/getPassengerName.ts +37 -0
- package/src/lib/getRowNumber.ts +16 -0
- package/src/lib/getSegmentList.ts +7 -0
- package/src/lib/getServicePriceMapById.ts +20 -0
- package/src/lib/getSymbols.ts +22 -0
- package/src/lib/getTotalAmountForServices.ts +72 -0
- package/src/lib/getTotalQuantity.ts +5 -0
- package/src/lib/hasService.ts +24 -0
- package/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.ts +35 -0
- package/src/lib/hasWings.ts +8 -0
- package/src/lib/isBaggageService.ts +8 -0
- package/src/lib/isCancelForAnyReasonService.ts +9 -0
- package/src/lib/isFixtureOfferId.ts +4 -0
- package/src/lib/isPayloadComplete.ts +11 -0
- package/src/lib/isSeatElement.ts +10 -0
- package/src/lib/logging.ts +120 -0
- package/src/lib/moneyStringFormatter.ts +34 -0
- package/src/lib/offerIsExpired.ts +5 -0
- package/src/lib/retrieveOffer.ts +54 -0
- package/src/lib/retrieveOfferFromDuffelAPI.ts +13 -0
- package/src/lib/retrieveSeatMaps.ts +55 -0
- package/src/lib/retrieveSeatMapsFromDuffelAPI.ts +13 -0
- package/src/lib/setBodyScrollability.ts +7 -0
- package/src/lib/validateProps.ts +37 -0
- package/src/lib/withPlural.ts +8 -0
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +21 -0
- package/src/stories/Button.stories.tsx +69 -0
- package/src/stories/DuffelAncillaries.stories.tsx +126 -0
- package/src/stories/DuffelPayments.stories.tsx +34 -0
- package/src/stories/Icon.stories.tsx +35 -0
- package/src/stories/IconButton.stories.tsx +25 -0
- package/src/styles/colors.css +22 -0
- package/src/styles/components/Amenity.css +23 -0
- package/src/styles/components/BaggageDisplay.css +25 -0
- package/src/styles/components/Button.css +161 -0
- package/src/styles/components/Card.css +52 -0
- package/src/styles/components/CfarSelectionModal.css +34 -0
- package/src/styles/components/Counter.css +18 -0
- package/src/styles/components/DuffelPayments.css +42 -0
- package/src/styles/components/IconButton.css +63 -0
- package/src/styles/components/Legend.css +58 -0
- package/src/styles/components/Loader.css +37 -0
- package/src/styles/components/LoadingState.css +81 -0
- package/src/styles/components/Modal.css +84 -0
- package/src/styles/components/PassengerSelect.css +93 -0
- package/src/styles/components/PassengersLayout.css +90 -0
- package/src/styles/components/Row.css +70 -0
- package/src/styles/components/Seat.css +57 -0
- package/src/styles/components/SeatInfo.css +61 -0
- package/src/styles/components/SeatMap.css +24 -0
- package/src/styles/components/SeatSelect.css +92 -0
- package/src/styles/components/Segment.css +17 -0
- package/src/styles/components/SelectionSegment.css +10 -0
- package/src/styles/components/Summary.css +70 -0
- package/src/styles/components/Tabs.css +49 -0
- package/src/styles/flex.css +5 -0
- package/src/styles/font-families.css +47 -0
- package/src/styles/global.css +51 -0
- package/src/styles/margin.css +3 -0
- package/src/styles/spacing.css +18 -0
- package/src/styles/transitions.css +3 -0
- package/src/styles/typography.css +13 -0
- package/src/tests/components/DuffelAncillaries.test.tsx +342 -0
- package/src/tests/lib/createPriceFormatters.test.tsx +152 -0
- package/src/tests/lib/formatAvailableServices.test.tsx +79 -0
- package/src/tests/lib/formatSeatMaps.test.tsx +49 -0
- package/src/tests/lib/getCurrencyForServices.test.tsx +44 -0
- package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +86 -0
- package/src/tests/lib/logging.test.tsx +32 -0
- package/src/tests/lib/moneyStringFormatter.test.tsx +12 -0
- package/src/tests/lib/validateProps.test.tsx +57 -0
- package/src/types/Aircraft.ts +16 -0
- package/src/types/Airline.ts +16 -0
- package/src/types/Airport.ts +54 -0
- package/src/types/City.ts +21 -0
- package/src/types/CreateOrderPayload.ts +99 -0
- package/src/types/CurrencyConversion.ts +10 -0
- package/src/types/DuffelAncillariesProps.ts +108 -0
- package/src/types/Offer.ts +851 -0
- package/src/types/Order.ts +6 -0
- package/src/types/Place.ts +6 -0
- package/src/types/SeatMap.ts +231 -0
- package/src/types/index.ts +11 -0
- package/tsconfig.json +52 -0
- package/LICENSE +0 -21
- package/dist/AdditionalBaggage.esm.js +0 -1
- package/dist/AdditionalBaggage.js +0 -1
- package/dist/AdditionalBaggage.min.css +0 -408
- package/dist/AdditionalBaggage.umd.min.js +0 -2
- package/dist/AdditionalBaggage.umd.min.js.LICENSE.txt +0 -60
- package/dist/AdditionalBaggageSelection.esm.js +0 -1
- package/dist/AdditionalBaggageSelection.js +0 -1
- package/dist/AdditionalBaggageSelection.min.css +0 -744
- package/dist/AdditionalBaggageSelection.umd.min.js +0 -2
- package/dist/AdditionalBaggageSelection.umd.min.js.LICENSE.txt +0 -93
- package/dist/CardPayment.esm.js +0 -2
- package/dist/CardPayment.esm.js.LICENSE.txt +0 -6
- package/dist/CardPayment.js +0 -2
- package/dist/CardPayment.js.LICENSE.txt +0 -6
- package/dist/CardPayment.min.css +0 -233
- package/dist/CardPayment.umd.min.js +0 -2
- package/dist/CardPayment.umd.min.js.LICENSE.txt +0 -61
- package/dist/SeatSelection.esm.js +0 -1
- package/dist/SeatSelection.js +0 -1
- package/dist/SeatSelection.min.css +0 -1127
- package/dist/SeatSelection.umd.min.js +0 -2
- package/dist/SeatSelection.umd.min.js.LICENSE.txt +0 -60
- package/dist/duffel-components.d.ts +0 -1614
- package/dist/duffel-components.esm.js +0 -2
- package/dist/duffel-components.esm.js.LICENSE.txt +0 -6
- package/dist/duffel-components.js +0 -2
- package/dist/duffel-components.js.LICENSE.txt +0 -6
- package/dist/duffel-components.min.css +0 -1280
- package/dist/duffel-components.umd.min.js +0 -2
- package/dist/duffel-components.umd.min.js.LICENSE.txt +0 -102
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 2.1
|
|
3
|
+
|
|
4
|
+
# Note: You can validate your config file using the Circle CLI:
|
|
5
|
+
# https://support.circleci.com/hc/en-us/articles/360006735753-Validating-your-CircleCI-Configuration
|
|
6
|
+
|
|
7
|
+
aliases:
|
|
8
|
+
- &working_directory ~/duffel_app
|
|
9
|
+
- &cache_directory ~/.cache/yarn
|
|
10
|
+
|
|
11
|
+
executors:
|
|
12
|
+
node-executor:
|
|
13
|
+
working_directory: *working_directory
|
|
14
|
+
docker:
|
|
15
|
+
- image: cimg/node:lts
|
|
16
|
+
|
|
17
|
+
commands:
|
|
18
|
+
save_deps_cache:
|
|
19
|
+
description: Save Yarn Package Cache
|
|
20
|
+
steps:
|
|
21
|
+
- save_cache:
|
|
22
|
+
name: Save Yarn Package Cache
|
|
23
|
+
key: v${CACHE_VERSION}-yarn-packages-{{ checksum "yarn.lock" }}
|
|
24
|
+
paths:
|
|
25
|
+
- *cache_directory
|
|
26
|
+
|
|
27
|
+
restore_deps_cache:
|
|
28
|
+
description: Restore Yarn Package Cache
|
|
29
|
+
steps:
|
|
30
|
+
- restore_cache:
|
|
31
|
+
key: v${CACHE_VERSION}-yarn-packages-{{ checksum "yarn.lock" }}
|
|
32
|
+
paths:
|
|
33
|
+
- *cache_directory
|
|
34
|
+
|
|
35
|
+
setup:
|
|
36
|
+
description: Set up common system expectations
|
|
37
|
+
steps:
|
|
38
|
+
- checkout
|
|
39
|
+
- restore_deps_cache
|
|
40
|
+
- run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
|
41
|
+
- save_deps_cache
|
|
42
|
+
|
|
43
|
+
jobs:
|
|
44
|
+
lint:
|
|
45
|
+
executor: node-executor
|
|
46
|
+
steps:
|
|
47
|
+
- setup
|
|
48
|
+
- run: yarn check-types
|
|
49
|
+
- run: yarn lint
|
|
50
|
+
- run: yarn prettier-check
|
|
51
|
+
build-storybook:
|
|
52
|
+
executor: node-executor
|
|
53
|
+
steps:
|
|
54
|
+
- setup
|
|
55
|
+
- run: yarn build-storybook
|
|
56
|
+
test:
|
|
57
|
+
executor: node-executor
|
|
58
|
+
steps:
|
|
59
|
+
- setup
|
|
60
|
+
- run: yarn test
|
|
61
|
+
|
|
62
|
+
workflows:
|
|
63
|
+
build_and_test:
|
|
64
|
+
jobs:
|
|
65
|
+
- lint
|
|
66
|
+
- test
|
|
67
|
+
- build-storybook
|
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
settings: {
|
|
3
|
+
react: {
|
|
4
|
+
version: "detect",
|
|
5
|
+
},
|
|
6
|
+
},
|
|
7
|
+
env: {
|
|
8
|
+
browser: true,
|
|
9
|
+
node: true,
|
|
10
|
+
jest: true,
|
|
11
|
+
},
|
|
12
|
+
ignorePatterns: [
|
|
13
|
+
"**/dist/**",
|
|
14
|
+
"**/cdn-dist/**",
|
|
15
|
+
"**/react-dist/**",
|
|
16
|
+
"__generated__**",
|
|
17
|
+
],
|
|
18
|
+
parser: "@typescript-eslint/parser",
|
|
19
|
+
extends: [
|
|
20
|
+
"eslint:recommended",
|
|
21
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
22
|
+
"plugin:@typescript-eslint/recommended",
|
|
23
|
+
"plugin:jsx-a11y/recommended",
|
|
24
|
+
"plugin:react/recommended",
|
|
25
|
+
"plugin:react-hooks/recommended",
|
|
26
|
+
"prettier",
|
|
27
|
+
"plugin:storybook/recommended",
|
|
28
|
+
],
|
|
29
|
+
overrides: [],
|
|
30
|
+
plugins: ["@typescript-eslint", "jsx-a11y", "import"],
|
|
31
|
+
rules: {
|
|
32
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
33
|
+
"@typescript-eslint/no-non-null-assertion": 0,
|
|
34
|
+
"react/display-name": 0,
|
|
35
|
+
"react/react-in-jsx-scope": 0,
|
|
36
|
+
"react/prop-types": 0,
|
|
37
|
+
"react-hooks/exhaustive-deps": 0,
|
|
38
|
+
"no-restricted-syntax": [
|
|
39
|
+
"error",
|
|
40
|
+
{
|
|
41
|
+
selector: "CallExpression[callee.object.name='console']",
|
|
42
|
+
message:
|
|
43
|
+
"Prefer 'log' or 'logGroup' from 'src/lib/logging.ts' instead of 'console'.",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": [
|
|
4
|
+
"config:base",
|
|
5
|
+
"schedule:earlyMondays",
|
|
6
|
+
":combinePatchMinorReleases"
|
|
7
|
+
],
|
|
8
|
+
"labels": ["dependencies"],
|
|
9
|
+
"enabledManagers": ["github-actions", "npm"],
|
|
10
|
+
"packageRules": [
|
|
11
|
+
{
|
|
12
|
+
"matchPackagePrefixes": ["@types", "eslint", "jest", "prettier"],
|
|
13
|
+
"automerge": true
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Our automated release process (see release.yml) creates PRs
|
|
2
|
+
# to bump the version in package.json.
|
|
3
|
+
#
|
|
4
|
+
# This workflow automatically approves these PRs so they can
|
|
5
|
+
# be merged without human intervention.
|
|
6
|
+
|
|
7
|
+
name: Auto approve bump version PR
|
|
8
|
+
|
|
9
|
+
on: pull_request_target
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
auto-approve:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: hmarr/auto-approve-action@v2
|
|
16
|
+
if: github.actor == 'duffel-bot'
|
|
17
|
+
with:
|
|
18
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: Release to npm
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
jobs:
|
|
7
|
+
Release:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- name: Checkout
|
|
11
|
+
uses: actions/checkout@v2
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0
|
|
14
|
+
|
|
15
|
+
- name: Setup Node.js
|
|
16
|
+
uses: actions/setup-node@v1
|
|
17
|
+
with:
|
|
18
|
+
node-version: "18.x"
|
|
19
|
+
|
|
20
|
+
- name: Get yarn cache directory path
|
|
21
|
+
id: yarn-cache-dir-path
|
|
22
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
23
|
+
|
|
24
|
+
- uses: actions/cache@v2
|
|
25
|
+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
26
|
+
with:
|
|
27
|
+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
28
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
29
|
+
restore-keys: |
|
|
30
|
+
${{ runner.os }}-yarn-
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: yarn install --frozen-lock-file --prefer-offline
|
|
34
|
+
|
|
35
|
+
- name: Get version from package.json before release step
|
|
36
|
+
id: initversion
|
|
37
|
+
run: echo "::set-output name=version::$(npm run get-version --silent)"
|
|
38
|
+
|
|
39
|
+
- name: Release to NPM
|
|
40
|
+
id: release
|
|
41
|
+
env:
|
|
42
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
44
|
+
GIT_AUTHOR_NAME: duffel-bot
|
|
45
|
+
GIT_AUTHOR_EMAIL: duffel-bot-read-write@duffel.com
|
|
46
|
+
GIT_COMMITTER_NAME: duffel-bot
|
|
47
|
+
GIT_COMMITTER_EMAIL: duffel-bot-read-write@duffel.com
|
|
48
|
+
DUFFEL_API_URL: https://api.duffel.com
|
|
49
|
+
COMPONENT_CDN: https://assets.duffel.com/components
|
|
50
|
+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
51
|
+
run: yarn release
|
|
52
|
+
|
|
53
|
+
- name: Get version from package.json after release step
|
|
54
|
+
id: extractver
|
|
55
|
+
run: echo "::set-output name=extractver::$(npm run get-version --silent)"
|
|
56
|
+
|
|
57
|
+
- name: Check if package versions are different
|
|
58
|
+
run: |
|
|
59
|
+
echo "Init Version - ${{ steps.initversion.outputs.version }}"
|
|
60
|
+
echo "extract version - ${{ steps.extractver.outputs.extractver }}"
|
|
61
|
+
echo "extract version - ${{ steps.initversion.outputs.version != steps.extractver.outputs.extractver }}"
|
|
62
|
+
|
|
63
|
+
- name: Create Pull Request with updated package files
|
|
64
|
+
id: cpr
|
|
65
|
+
if: steps.initversion.outputs.version != steps.extractver.outputs.extractver
|
|
66
|
+
uses: peter-evans/create-pull-request@v3.10.0
|
|
67
|
+
with:
|
|
68
|
+
token: ${{ secrets.PAT }} # You can fin this on https://duffel.1password.com/vaults/all/allitems/m3heg3y3ijclli4tmmp4bsyxna
|
|
69
|
+
commit-message: "chore(release): ${{ steps.extractver.outputs.extractver }}"
|
|
70
|
+
committer: duffel-bot <duffel-bot-read-write@duffel.com>
|
|
71
|
+
author: duffel-bot <duffel-bot-read-write@duffel.com>
|
|
72
|
+
title: "chore(release): ${{ steps.extractver.outputs.extractver }}"
|
|
73
|
+
body: "Version bump in package.json for release [${{ steps.extractver.outputs.extractver }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.extractver.outputs.extractver }})"
|
|
74
|
+
branch: version-bump/${{ steps.extractver.outputs.extractver }}
|
|
75
|
+
labels: |
|
|
76
|
+
automated pr
|
|
77
|
+
|
|
78
|
+
- name: Check outputs
|
|
79
|
+
run: |
|
|
80
|
+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
81
|
+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
|
82
|
+
|
|
83
|
+
- name: Enable Pull Request Automerge
|
|
84
|
+
if: steps.cpr.outputs.pull-request-operation == 'created'
|
|
85
|
+
uses: peter-evans/enable-pull-request-automerge@v1
|
|
86
|
+
with:
|
|
87
|
+
token: ${{ secrets.PAT }}
|
|
88
|
+
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
|
|
89
|
+
merge-method: squash
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/hydrogen
|
package/.prettierignore
ADDED