Update app dependencies.

Also includes TypeScript and Prettier fixes.
This commit is contained in:
Jayden Seric 2023-10-23 23:52:15 +11:00
parent f53d1a2cfd
commit b415d67201
7 changed files with 950 additions and 953 deletions

View File

@ -14,6 +14,6 @@ export default function Page({ title, children }) {
Fragment, Fragment,
null, null,
h(nextHead.default, null, h("title", null, title)), h(nextHead.default, null, h("title", null, title)),
children children,
); );
} }

View File

@ -22,7 +22,7 @@ export default function UploadBlob() {
const [name, setName] = useState(""); const [name, setName] = useState("");
const [content, setContent] = useState(""); const [content, setContent] = useState("");
const [singleUploadMutation, { loading }] = useMutation( const [singleUploadMutation, { loading }] = useMutation(
SINGLE_UPLOAD_MUTATION SINGLE_UPLOAD_MUTATION,
); );
const apolloClient = useApolloClient(); const apolloClient = useApolloClient();
@ -68,7 +68,7 @@ export default function UploadBlob() {
null, null,
"File name (without ", "File name (without ",
h(Code, null, ".txt"), h(Code, null, ".txt"),
")" ")",
), ),
}, },
h(Textbox, { h(Textbox, {
@ -76,7 +76,7 @@ export default function UploadBlob() {
required: true, required: true,
value: name, value: name,
onChange: onNameChange, onChange: onNameChange,
}) }),
), ),
h( h(
Fieldset, Fieldset,
@ -87,8 +87,8 @@ export default function UploadBlob() {
required: true, required: true,
value: content, value: content,
onChange: onContentChange, onChange: onContentChange,
}) }),
), ),
h(ButtonSubmit, { loading }, "Upload") h(ButtonSubmit, { loading }, "Upload"),
); );
} }

View File

@ -44,8 +44,8 @@ export default function Uploads() {
h( h(
"tbody", "tbody",
null, null,
uploads.map(({ id, url }) => h("tr", { key: id }, h("td", null, url))) uploads.map(({ id, url }) => h("tr", { key: id }, h("td", null, url))),
) ),
) ),
); );
} }

1827
app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,31 +21,31 @@
}, },
"browserslist": "Node 18.15 - 19 and Node < 19, Node >= 20.4, > 0.5%, not OperaMini all, not IE > 0, not dead", "browserslist": "Node 18.15 - 19 and Node < 19, Node >= 20.4, > 0.5%, not OperaMini all, not IE > 0, not dead",
"dependencies": { "dependencies": {
"@apollo/client": "^3.7.4", "@apollo/client": "^3.8.6",
"apollo-upload-client": "^17.0.0", "apollo-upload-client": "^17.0.0",
"device-agnostic-ui": "~10.0.0", "device-agnostic-ui": "~10.0.0",
"graphql": "^16.6.0", "graphql": "^16.8.1",
"next": "^13.1.2", "next": "^13.5.6",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.19.1", "@babel/eslint-parser": "^7.22.15",
"@types/eslint": "^8.4.10", "@types/eslint": "^8.44.6",
"@types/node": "^18.11.18", "@types/node": "^20.8.7",
"@types/react": "^18.0.26", "@types/react": "^18.2.31",
"@types/react-dom": "^18.0.10", "@types/react-dom": "^18.2.14",
"babel-plugin-graphql-tag": "^3.3.0", "babel-plugin-graphql-tag": "^3.3.0",
"eslint": "^8.31.0", "eslint": "^8.52.0",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^8.0.0", "eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^2.8.2", "prettier": "^3.0.3",
"stylelint": "^14.16.1", "stylelint": "^15.11.0",
"stylelint-config-recommended": "^9.0.0", "stylelint-config-recommended": "^13.0.0",
"typescript": "^4.9.4" "typescript": "^5.2.2"
}, },
"overrides": { "overrides": {
"next": "^13.1.2", "next": "^13.5.6",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
}, },

View File

@ -23,7 +23,9 @@ import { createElement as h, Fragment } from "react";
/** /**
* Creates an Apollo Client instance. * Creates an Apollo Client instance.
* @param {{ [key: string]: unknown }} [cache] Apollo Client initial cache. * @param {import(
* "@apollo/client/cache/inmemory/types.js"
* ).NormalizedCacheObject} [cache] Apollo Client initial cache.
*/ */
const createApolloClient = (cache = {}) => const createApolloClient = (cache = {}) =>
new ApolloClient({ new ApolloClient({
@ -61,9 +63,9 @@ function App({
}), }),
h("meta", { name: "color-scheme", content: "light dark" }), h("meta", { name: "color-scheme", content: "light dark" }),
h("meta", { name: "theme-color", content: "white" }), h("meta", { name: "theme-color", content: "white" }),
h("link", { rel: "manifest", href: "/manifest.webmanifest" }) h("link", { rel: "manifest", href: "/manifest.webmanifest" }),
), ),
h(Component, pageProps) h(Component, pageProps),
), ),
}); });
} }
@ -106,6 +108,8 @@ export default App;
/** /**
* Next.js app custom props. * Next.js app custom props.
* @typedef {object} AppCustomProps * @typedef {object} AppCustomProps
* @prop {{ [key: string]: unknown }} [apolloCache] Apollo Client initial cache. * @prop {import(
* "@apollo/client/cache/inmemory/types.js"
* ).NormalizedCacheObject} [apolloCache] Apollo Client initial cache.
* @prop {ApolloClient<any>} apolloClient Apollo Client. * @prop {ApolloClient<any>} apolloClient Apollo Client.
*/ */

View File

@ -20,7 +20,7 @@ export default function IndexPage() {
h( h(
Header, Header,
null, null,
h(Heading, { level: 1, size: 1 }, "Apollo upload examples") h(Heading, { level: 1, size: 1 }, "Apollo upload examples"),
), ),
h( h(
Section, Section,
@ -28,9 +28,9 @@ export default function IndexPage() {
h( h(
Header, Header,
null, null,
h(Heading, { level: 2, size: 2 }, "Upload ", h(Code, null, "FileList")) h(Heading, { level: 2, size: 2 }, "Upload ", h(Code, null, "FileList")),
), ),
h(Margin, null, h(UploadFileList)) h(Margin, null, h(UploadFileList)),
), ),
h( h(
Section, Section,
@ -38,9 +38,9 @@ export default function IndexPage() {
h( h(
Header, Header,
null, null,
h(Heading, { level: 2, size: 2 }, "Upload ", h(Code, null, "File")) h(Heading, { level: 2, size: 2 }, "Upload ", h(Code, null, "File")),
), ),
h(Margin, null, h(UploadFile)) h(Margin, null, h(UploadFile)),
), ),
h( h(
Section, Section,
@ -48,10 +48,10 @@ export default function IndexPage() {
h( h(
Header, Header,
null, null,
h(Heading, { level: 2, size: 2 }, "Upload ", h(Code, null, "Blob")) h(Heading, { level: 2, size: 2 }, "Upload ", h(Code, null, "Blob")),
), ),
h(Margin, null, h(UploadBlob)) h(Margin, null, h(UploadBlob)),
), ),
h(Section, null, h(Header, null, h(Heading, null, "Uploads")), h(Uploads)) h(Section, null, h(Header, null, h(Heading, null, "Uploads")), h(Uploads)),
); );
} }