Skip to content

Commit 45fcaa8

Browse files
committed
Fixing some type imports // updating package versions
1 parent 4302b09 commit 45fcaa8

File tree

7 files changed

+51
-34
lines changed

7 files changed

+51
-34
lines changed

shopify/standalone-shopify-template/api/actions/verifyConnections.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { VerifyConnectionsGlobalActionContext } from "gadget-server";
2-
31
export const run: ActionRun = async ({
42
params,
53
logger,
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { RouteContext } from "gadget-server";
1+
import { RouteHandler } from "gadget-server";
22

3-
export default async function route({
3+
const route: RouteHandler = async ({
44
request,
55
reply,
66
api,
77
logger,
88
connections,
99
session,
10-
}: RouteContext) {
10+
}) => {
1111
// See if the request is coming from the Shopify admin
1212
const shopId = connections.shopify.currentShopId;
1313

@@ -18,4 +18,4 @@ export default async function route({
1818

1919
// Redirect the user to the standalone dashboard
2020
return await reply.redirect(`/dashboard`);
21-
}
21+
};

shopify/standalone-shopify-template/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
},
1010
"dependencies": {
1111
"@gadget-client/standalone-shopify-template": "link:.gadget/client",
12-
"@gadgetinc/react": "^0.18.0",
13-
"@gadgetinc/react-shopify-app-bridge": "^0.16.4",
12+
"@gadgetinc/react": "^0.18.4",
13+
"@gadgetinc/react-shopify-app-bridge": "^0.16.6",
1414
"@shopify/app-bridge-react": "4.0.0",
1515
"@shopify/polaris": "^13.9.0",
1616
"@shopify/polaris-icons": "^9.3.0",

shopify/standalone-shopify-template/web/providers/AuthProvider.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import { createContext, useEffect } from "react";
22
import { api } from "../api";
33
import { useGlobalAction, useUser } from "@gadgetinc/react";
4-
import { GadgetRecord } from "@gadget-client/standalone-shopify-template";
4+
import type { GadgetRecord } from "@gadget-client/standalone-shopify-template";
55

6-
export type AuthContextType = {
6+
type AuthContextType = {
77
user?: GadgetRecord<Record<string, any>>;
88
};
99

1010
export const AuthContext = createContext<AuthContextType>({});
1111

1212
export default ({ children }: { children: React.ReactNode }) => {
13-
const user = useUser();
13+
const user = useUser() as unknown as
14+
| GadgetRecord<Record<string, any>>
15+
| undefined;
1416

1517
const [_, verifyConnections] = useGlobalAction(api.verifyConnections);
1618

shopify/standalone-shopify-template/web/providers/ShopProvider.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { createContext, useEffect } from "react";
22
import { api } from "../api";
33
import { useFindMany } from "@gadgetinc/react";
44

5-
type Shop = {
6-
id: string;
7-
domain: string | null;
8-
shopOwner: string | null;
9-
};
10-
11-
export type ShopContextType = {
12-
shops?: Shop[];
5+
type ShopContextType = {
6+
shops?: {
7+
id: string;
8+
domain: string | null;
9+
shopOwner: string | null;
10+
}[];
1311
};
1412

1513
export const ShopContext = createContext<ShopContextType>({});

shopify/standalone-shopify-template/web/routes/signed-in.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import { Link } from "react-router-dom";
33
import { useContext } from "react";
44
import { ShopContext, AuthContext } from "../providers";
55
import { BlockStack, Card, Text, Button, Box } from "@shopify/polaris";
6-
import { ShopContextType } from "../providers/ShopProvider";
7-
import { AuthContextType } from "../providers/AuthProvider";
86

97
export default function () {
108
const signOut = useSignOut();
11-
const { user }: AuthContextType = useContext(AuthContext);
12-
const { shops }: ShopContextType = useContext(ShopContext);
9+
const { user } = useContext(AuthContext);
10+
const { shops } = useContext(ShopContext);
1311

1412
return user ? (
1513
<>

shopify/standalone-shopify-template/yarn.lock

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
version "0.0.0"
169169
uid ""
170170

171-
"@gadgetinc/[email protected]", "@gadgetinc/api-client-core@^0.15.33":
171+
"@gadgetinc/[email protected]":
172172
version "0.15.33"
173173
resolved "https://registry.yarnpkg.com/@gadgetinc/api-client-core/-/api-client-core-0.15.33.tgz#8c64768dfc3069d14a6537b80c34d9a758be1f11"
174174
integrity sha512-Y1EbiR0QIMWnVjNsfubw4utBjkJe49w/Rb9eTfBQXW9Q71/IrAcSxUQsg06jTTcp8eStFl+chmawBjQyKX2qAQ==
@@ -189,22 +189,43 @@
189189
wonka "^6.3.2"
190190
ws "^8.17.0"
191191

192-
"@gadgetinc/react-shopify-app-bridge@^0.16.4":
193-
version "0.16.4"
194-
resolved "https://registry.yarnpkg.com/@gadgetinc/react-shopify-app-bridge/-/react-shopify-app-bridge-0.16.4.tgz#7c02ae4c9462f9556019f688cca994cd0529cae8"
195-
integrity sha512-WStOSHi1597HzPkeLwg80PLpGa7p3fRj56uwmfSGC9f40cxLFH05KdzlLi+1n+YpevSW+2elya1c8oSrRsHh3g==
192+
"@gadgetinc/api-client-core@^0.15.35", "@gadgetinc/api-client-core@^0.15.36":
193+
version "0.15.36"
194+
resolved "https://registry.yarnpkg.com/@gadgetinc/api-client-core/-/api-client-core-0.15.36.tgz#aca6f7d1fa65677a7180f9b6a6b1251778e1af84"
195+
integrity sha512-PkNSf1kXAi6nIba5eqZ7d8KJCyqQ2NA0/Z5JweJQoCMOXSTbsqnAD77fTmkRh1LsH48wfMNDQF7qTxWI3VCCTw==
196196
dependencies:
197-
"@gadgetinc/api-client-core" "^0.15.33"
197+
"@0no-co/graphql.web" "^1.0.4"
198+
"@n1ru4l/graphql-live-query" "^0.10.0"
199+
"@n1ru4l/json-patch-plus" "^0.2.0"
200+
"@n1ru4l/push-pull-async-iterable-iterator" "^3.2.0"
201+
"@urql/core" "^4.0.10"
202+
cross-fetch "^4.0.0"
203+
graphql "^16.8.1"
204+
graphql-ws "^5.13.1"
205+
isomorphic-ws "^5.0.0"
206+
klona "^2.0.6"
207+
tiny-graphql-query-compiler "^0.2.2"
208+
tslib "^2.6.2"
209+
type-fest "^3.13.1"
210+
wonka "^6.3.2"
211+
ws "^8.17.0"
212+
213+
"@gadgetinc/react-shopify-app-bridge@^0.16.6":
214+
version "0.16.6"
215+
resolved "https://registry.yarnpkg.com/@gadgetinc/react-shopify-app-bridge/-/react-shopify-app-bridge-0.16.6.tgz#27abf7850819b742b897fa58e26a4db6897afa32"
216+
integrity sha512-Zg6oxTL5RYLDuPhL1psnVOUYmY8RHQ/Fa5Q50nkcfagG4bmt8oHN2I6jNWZTD/KcIYs6shg7kEvc5bxompfg5g==
217+
dependencies:
218+
"@gadgetinc/api-client-core" "^0.15.35"
198219
crypto-js "^4.2.0"
199220
tslib "^2.6.2"
200221

201-
"@gadgetinc/react@^0.18.0":
202-
version "0.18.0"
203-
resolved "https://registry.yarnpkg.com/@gadgetinc/react/-/react-0.18.0.tgz#cf27595ca5052957106a0613d7abb276539d8f05"
204-
integrity sha512-AJsxc6OhU5A1UPXDA8UUMNIkGTppqPFvMyZLjp9590sbVn/1JS3xQmVYunDQEtSJjOe6Pt6Gjxq+ZVKqxFTkYA==
222+
"@gadgetinc/react@^0.18.4":
223+
version "0.18.4"
224+
resolved "https://registry.yarnpkg.com/@gadgetinc/react/-/react-0.18.4.tgz#5177a806bfc2800cd0492691313242776e711aba"
225+
integrity sha512-lwf+8zpotLh+Ts+vk7IPNm7l59Zhs7b4XAjr4C4mqmBQW9iERKkJa9an7vffyNw0yX7VRfmnOBXvkqoLkJmbBw==
205226
dependencies:
206227
"@0no-co/graphql.web" "^1.0.4"
207-
"@gadgetinc/api-client-core" "^0.15.33"
228+
"@gadgetinc/api-client-core" "^0.15.36"
208229
"@hookform/resolvers" "^3.3.1"
209230
filesize "^10.1.2"
210231
pluralize "^8.0.0"

0 commit comments

Comments
 (0)