aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/with-gatsby/apps/web
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:47:57 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:47:57 +0800
commit8b2c4a38a461ff5ecc95972291bc711e2c5dec9a (patch)
tree29f552e3df949073e21bf5c76d7abc3044830ec6 /examples/with-gatsby/apps/web
parentfc8c5fdce62fb229202659408798a7b6c98f6e8b (diff)
downloadHydroRoll-8b2c4a38a461ff5ecc95972291bc711e2c5dec9a.tar.gz
HydroRoll-8b2c4a38a461ff5ecc95972291bc711e2c5dec9a.zip
Diffstat (limited to 'examples/with-gatsby/apps/web')
-rw-r--r--examples/with-gatsby/apps/web/.eslintrc.js4
-rw-r--r--examples/with-gatsby/apps/web/.gitignore4
-rw-r--r--examples/with-gatsby/apps/web/README.md15
-rw-r--r--examples/with-gatsby/apps/web/gatsby-config.ts19
-rw-r--r--examples/with-gatsby/apps/web/package.json29
-rw-r--r--examples/with-gatsby/apps/web/src/pages/404.tsx49
-rw-r--r--examples/with-gatsby/apps/web/src/pages/index.tsx16
-rw-r--r--examples/with-gatsby/apps/web/tsconfig.json5
-rw-r--r--examples/with-gatsby/apps/web/turbo.json11
9 files changed, 152 insertions, 0 deletions
diff --git a/examples/with-gatsby/apps/web/.eslintrc.js b/examples/with-gatsby/apps/web/.eslintrc.js
new file mode 100644
index 0000000..5d8a502
--- /dev/null
+++ b/examples/with-gatsby/apps/web/.eslintrc.js
@@ -0,0 +1,4 @@
+module.exports = {
+ root: true,
+ extends: ["custom/react"],
+};
diff --git a/examples/with-gatsby/apps/web/.gitignore b/examples/with-gatsby/apps/web/.gitignore
new file mode 100644
index 0000000..5282102
--- /dev/null
+++ b/examples/with-gatsby/apps/web/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+.cache/
+public
+src/gatsby-types.d.ts
diff --git a/examples/with-gatsby/apps/web/README.md b/examples/with-gatsby/apps/web/README.md
new file mode 100644
index 0000000..b348ca3
--- /dev/null
+++ b/examples/with-gatsby/apps/web/README.md
@@ -0,0 +1,15 @@
+## 🚀 Quick start
+
+1. **Start developing.**
+
+ Navigate into your new site’s directory and start it up.
+
+ ```bash
+ turbo dev
+ ```
+
+2. **Open the code and start customizing!**
+
+ Your site is now running at http://localhost:8000!
+
+ Edit `src/pages/index.tsx` to see your site update in real-time!
diff --git a/examples/with-gatsby/apps/web/gatsby-config.ts b/examples/with-gatsby/apps/web/gatsby-config.ts
new file mode 100644
index 0000000..4bf467b
--- /dev/null
+++ b/examples/with-gatsby/apps/web/gatsby-config.ts
@@ -0,0 +1,19 @@
+import type { GatsbyConfig } from "gatsby";
+
+const config: GatsbyConfig = {
+ siteMetadata: {
+ siteUrl: `https://www.yourdomain.tld`,
+ },
+ graphqlTypegen: true,
+ plugins: [
+ `gatsby-plugin-pnpm`,
+ {
+ resolve: `gatsby-plugin-compile-es6-packages`,
+ options: {
+ modules: [`ui`],
+ },
+ },
+ ],
+};
+
+export default config;
diff --git a/examples/with-gatsby/apps/web/package.json b/examples/with-gatsby/apps/web/package.json
new file mode 100644
index 0000000..00f0c85
--- /dev/null
+++ b/examples/with-gatsby/apps/web/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "web",
+ "version": "1.0.0",
+ "private": true,
+ "scripts": {
+ "dev": "gatsby develop",
+ "build": "gatsby build",
+ "start": "gatsby develop",
+ "lint": "tsc --noEmit && eslint src/**/*.ts*"
+ },
+ "dependencies": {
+ "eslint": "7.32.0",
+ "gatsby": "^5.7.0",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "ui": "workspace:*"
+ },
+ "devDependencies": {
+ "@types/node": "^18.15.0",
+ "@types/react": "^18.0.28",
+ "@types/react-dom": "^18.0.11",
+ "babel-eslint": "^10.1.0",
+ "eslint-config-custom": "workspace:*",
+ "gatsby-plugin-compile-es6-packages": "^2.1.1",
+ "gatsby-plugin-pnpm": "^1.2.10",
+ "tsconfig": "workspace:*",
+ "typescript": "^4.9.5"
+ }
+}
diff --git a/examples/with-gatsby/apps/web/src/pages/404.tsx b/examples/with-gatsby/apps/web/src/pages/404.tsx
new file mode 100644
index 0000000..68a3a72
--- /dev/null
+++ b/examples/with-gatsby/apps/web/src/pages/404.tsx
@@ -0,0 +1,49 @@
+import * as React from "react";
+import { Link, HeadFC, PageProps } from "gatsby";
+
+const pageStyles = {
+ color: "#232129",
+ padding: "96px",
+ fontFamily: "-apple-system, Roboto, sans-serif, serif",
+};
+const headingStyles = {
+ marginTop: 0,
+ marginBottom: 64,
+ maxWidth: 320,
+};
+
+const paragraphStyles = {
+ marginBottom: 48,
+};
+const codeStyles = {
+ color: "#8A6534",
+ padding: 4,
+ backgroundColor: "#FFF4DB",
+ fontSize: "1.25rem",
+ borderRadius: 4,
+};
+
+const NotFoundPage: React.FC<PageProps> = () => {
+ return (
+ <main style={pageStyles}>
+ <h1 style={headingStyles}>Page not found</h1>
+ <p style={paragraphStyles}>
+ Sorry 😔, we couldn’t find what you were looking for.
+ <br />
+ {process.env.NODE_ENV === "development" ? (
+ <>
+ <br />
+ Try creating a page in <code style={codeStyles}>src/pages/</code>.
+ <br />
+ </>
+ ) : null}
+ <br />
+ <Link to="/">Go home</Link>.
+ </p>
+ </main>
+ );
+};
+
+export default NotFoundPage;
+
+export const Head: HeadFC = () => <title>Not found</title>;
diff --git a/examples/with-gatsby/apps/web/src/pages/index.tsx b/examples/with-gatsby/apps/web/src/pages/index.tsx
new file mode 100644
index 0000000..30844d6
--- /dev/null
+++ b/examples/with-gatsby/apps/web/src/pages/index.tsx
@@ -0,0 +1,16 @@
+import * as React from "react";
+import type { HeadFC, PageProps } from "gatsby";
+import { Button } from "ui";
+
+const IndexPage: React.FC<PageProps> = () => {
+ return (
+ <main>
+ <h1>Web</h1>
+ <Button />
+ </main>
+ );
+};
+
+export default IndexPage;
+
+export const Head: HeadFC = () => <title>Home Page</title>;
diff --git a/examples/with-gatsby/apps/web/tsconfig.json b/examples/with-gatsby/apps/web/tsconfig.json
new file mode 100644
index 0000000..1f1b42d
--- /dev/null
+++ b/examples/with-gatsby/apps/web/tsconfig.json
@@ -0,0 +1,5 @@
+{
+ "extends": "tsconfig/gatsby.json",
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
+ "exclude": ["node_modules"]
+}
diff --git a/examples/with-gatsby/apps/web/turbo.json b/examples/with-gatsby/apps/web/turbo.json
new file mode 100644
index 0000000..fa10d78
--- /dev/null
+++ b/examples/with-gatsby/apps/web/turbo.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://turbo.build/schema.json",
+ "extends": ["//"],
+ "pipeline": {
+ "build": {
+ // include .vercel to ensure output is cached when deploying on Vercel (https://vercel.com/docs/build-output-api/v3)
+ "outputs": ["public/**", ".cache/**", ".vercel/**"],
+ "env": ["NODE_ENV"]
+ }
+ }
+}