@duffel/components 3.1.2 → 3.1.3--prototype.3
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 +2 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.prettierignore +5 -1
- package/.storybook/main.ts +1 -1
- package/.tool-versions +1 -1
- package/.vscode/extensions.json +7 -0
- package/.vscode/settings.json +10 -0
- package/.yarn/releases/yarn-4.0.1.cjs +893 -0
- package/.yarn/sdks/eslint/bin/eslint.js +20 -0
- package/.yarn/sdks/eslint/lib/api.js +20 -0
- package/.yarn/sdks/eslint/lib/unsupported-api.js +20 -0
- package/.yarn/sdks/eslint/package.json +14 -0
- package/.yarn/sdks/integrations.yml +5 -0
- package/.yarn/sdks/prettier/bin-prettier.js +20 -0
- package/.yarn/sdks/prettier/index.js +20 -0
- package/.yarn/sdks/prettier/package.json +7 -0
- package/.yarn/sdks/typescript/bin/tsc +20 -0
- package/.yarn/sdks/typescript/bin/tsserver +20 -0
- package/.yarn/sdks/typescript/lib/tsc.js +20 -0
- package/.yarn/sdks/typescript/lib/tsserver.js +225 -0
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +225 -0
- package/.yarn/sdks/typescript/lib/typescript.js +20 -0
- package/.yarn/sdks/typescript/package.json +10 -0
- package/.yarnrc.yml +3 -0
- package/README.md +4 -0
- package/jest.config.ts +1 -1
- package/package.json +83 -134
- package/react-dist/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +0 -1
- package/react-dist/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +0 -1
- package/react-dist/custom-elements.js +20 -17
- package/react-dist/custom-elements.js.map +4 -4
- package/react-dist/index.d.ts +0 -1
- package/react-dist/index.js +21 -47
- package/react-dist/index.js.map +4 -4
- package/react-dist/lib/logging.d.ts +1 -1
- package/scripts/build-and-publish.sh +42 -0
- package/scripts/generate-fixture.ts +2 -2
- package/scripts.tsconfig.json +1 -1
- package/src/components/PlacesLookup/PlacesLookup.tsx +2 -3
- package/src/examples/just-typescript/.yarn/install-state.gz +0 -0
- package/src/examples/just-typescript/package.json +2 -2
- package/src/examples/just-typescript/src/index.ts +1 -1
- package/src/examples/just-typescript/yarn.lock +467 -154
- package/src/examples/next/README.md +28 -0
- package/src/examples/next/next-env.d.ts +5 -0
- package/src/examples/next/next.config.js +4 -0
- package/src/examples/next/package.json +24 -0
- package/src/examples/next/src/app/DuffelComponents.tsx +40 -0
- package/src/examples/next/src/app/layout.tsx +18 -0
- package/src/examples/next/src/app/page.tsx +9 -0
- package/src/examples/next/tsconfig.json +27 -0
- package/src/examples/next/yarn.lock +257 -0
- package/src/examples/react-app/src/index.tsx +1 -1
- package/src/index.ts +0 -1
- package/src/lib/logging.ts +1 -1
- package/tsconfig.json +9 -3
- package/.github/workflows/autoapprove.yml +0 -18
- package/.github/workflows/release.yml +0 -89
- package/.husky/post-commit +0 -4
- package/.husky/pre-commit +0 -4
- package/.storybook/Storyshots.test.js +0 -3
- package/.storybook/__snapshots__/Storyshots.test.js.snap +0 -67984
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
if [[ "$@" == *"--help"* ]]; then
|
|
2
|
+
echo ""
|
|
3
|
+
echo "Builds and publishes the package to npm and CDN."
|
|
4
|
+
echo ""
|
|
5
|
+
echo "Usage:"
|
|
6
|
+
echo " build-and-publish.sh [--dry-run] [--help]"
|
|
7
|
+
echo ""
|
|
8
|
+
echo "Options:"
|
|
9
|
+
echo " ‣ --help Show this help message"
|
|
10
|
+
echo " ‣ --dry-run Build and test, but do not publish"
|
|
11
|
+
echo ""
|
|
12
|
+
|
|
13
|
+
exit 0
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Cleanup the old builds:
|
|
17
|
+
rm -rf ./cdn-dist
|
|
18
|
+
rm -rf ./react-dist
|
|
19
|
+
|
|
20
|
+
# Build for distribution
|
|
21
|
+
|
|
22
|
+
## For those that rely on <script></script>
|
|
23
|
+
node config/esbuild.cdn.config.js
|
|
24
|
+
|
|
25
|
+
## For those that rely on `npm i`
|
|
26
|
+
node config/esbuild.react.config.js
|
|
27
|
+
|
|
28
|
+
## For those that use typescript
|
|
29
|
+
tsc --project tsconfig.json
|
|
30
|
+
|
|
31
|
+
# Only upload to CDN and publish to npm if it's not a dry run
|
|
32
|
+
if [[ "$@" != *"--dry-run"* ]]; then
|
|
33
|
+
# Upload css, js and fixtures to CDN
|
|
34
|
+
bash ./scripts/upload-to-cdn.sh
|
|
35
|
+
|
|
36
|
+
# Publish to npm with tag
|
|
37
|
+
npm publish --tag igorp1-prototype
|
|
38
|
+
else
|
|
39
|
+
echo ""
|
|
40
|
+
echo "Dry run. @duffel/components not published."
|
|
41
|
+
echo ""
|
|
42
|
+
fi
|
|
@@ -24,7 +24,7 @@ const duffelHeaders = {
|
|
|
24
24
|
Authorization: `Bearer ${DUFFEL_API_TOKEN}`,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export const makeMockDateInTheFuture = (daysAhead) => {
|
|
27
|
+
export const makeMockDateInTheFuture = (daysAhead: number) => {
|
|
28
28
|
const now = new Date(Date.now());
|
|
29
29
|
now.setDate(now.getDate() + daysAhead);
|
|
30
30
|
return now;
|
|
@@ -137,7 +137,7 @@ const main = async () => {
|
|
|
137
137
|
);
|
|
138
138
|
if (VERBOSE) {
|
|
139
139
|
const airlines = new Set(
|
|
140
|
-
offerRequest.offers.map((offer) => offer.owner.iata_code)
|
|
140
|
+
offerRequest.offers.map((offer: Offer) => offer.owner.iata_code)
|
|
141
141
|
);
|
|
142
142
|
log(
|
|
143
143
|
`Received ${withPlural(
|
package/scripts.tsconfig.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Fuse from "fuse.js";
|
|
2
2
|
import { debounce } from "lodash";
|
|
3
|
-
import fetch from "node-fetch";
|
|
4
3
|
import React from "react";
|
|
5
4
|
import { Icon } from "../shared/Icon";
|
|
6
5
|
|
|
@@ -61,8 +60,8 @@ export const PlacesLookup: React.FC<PlacesLookupProps> = ({
|
|
|
61
60
|
|
|
62
61
|
React.useEffect(() => {
|
|
63
62
|
fetch(DATA_SOURCE)
|
|
64
|
-
.then((response) => response.json())
|
|
65
|
-
.then((data) =>
|
|
63
|
+
.then((response: Response) => response.json())
|
|
64
|
+
.then((data: string[]) =>
|
|
66
65
|
setLookupData(
|
|
67
66
|
new Fuse<Place>(mapDataRowsIntoObjects(data), {
|
|
68
67
|
threshold: 0.2,
|
|
Binary file
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"build": "esbuild src/index.ts --bundle --outfile=dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
+
"@duffel/components": "3.1.3--prototype.2",
|
|
9
10
|
"@types/node": "20.2.5",
|
|
10
|
-
"typescript": "5.0.4"
|
|
11
|
-
"duffel-components": "../../../../duffel-components/react-dist"
|
|
11
|
+
"typescript": "5.0.4"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"esbuild": "^0.17.19"
|