Skip to content

Commit 17a67e3

Browse files
authored
copy blitzjs example from vercel/vercel (#1002)
1 parent bc7eb99 commit 17a67e3

File tree

23 files changed

+9865
-0
lines changed

23 files changed

+9865
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
presets: ["next/babel"],
3+
plugins: [],
4+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: ["react-app", "plugin:jsx-a11y/recommended"],
3+
plugins: ["jsx-a11y"],
4+
rules: {
5+
"import/no-anonymous-default-export": "error",
6+
"import/no-webpack-loader-syntax": "off",
7+
"react/react-in-jsx-scope": "off", // React is always in scope with Blitz
8+
"jsx-a11y/anchor-is-valid": "off", //Doesn't play well with Blitz/Next <Link> usage
9+
},
10+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# dependencies
2+
node_modules
3+
.yarn/cache
4+
.yarn/unplugged
5+
.yarn/build-state.yml
6+
.pnp.*
7+
.npm
8+
web_modules/
9+
10+
# blitz
11+
/.blitz/
12+
/.next/
13+
*.sqlite
14+
.now
15+
.vercel
16+
.blitz-console-history
17+
blitz-log.log
18+
19+
# misc
20+
.DS_Store
21+
22+
# local env files
23+
.env
24+
.envrc
25+
.env.local
26+
.env.development.local
27+
.env.test.local
28+
.env.production.local
29+
30+
# Logs
31+
logs
32+
*.log
33+
34+
# Runtime data
35+
pids
36+
*.pid
37+
*.seed
38+
*.pid.lock
39+
40+
# Testing
41+
coverage
42+
*.lcov
43+
.nyc_output
44+
lib-cov
45+
46+
# Caches
47+
*.tsbuildinfo
48+
.eslintcache
49+
.node_repl_history
50+
.yarn-integrity
51+
52+
# Serverless directories
53+
.serverless/
54+
55+
# Stores VSCode versions used for testing VSCode extensions
56+
.vscode-test
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-exact=true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.gitkeep
2+
.env
3+
*.ico
4+
*.lock
5+
db/migrations
6+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Blitz.js
2+
3+
This directory is a brief example of a [Blitz.js](https://blitzjs.com/) project that can be deployed to Vercel with zero configuration.
4+
5+
## Deploy Your Own
6+
7+
Deploy your own Blitz.js project with Vercel by viewing the [documentation on deploying to Vercel](https://blitzjs.com/docs/deploy-vercel)
8+
9+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/framework-boilerplates/blitzjs&template=blitzjs)
10+
11+
_Live Example: https://blitz-template.vercel.app_
12+
13+
### How We Created This Example
14+
15+
To get started with Blitz.js, you can use [npx](https://www.npmjs.com/package/npx) to initialize the project:
16+
17+
```shell
18+
$ npx blitz new
19+
```

framework-boilerplates/blitzjs/app/components/.keep

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from "react"
2+
3+
export default class ErrorBoundary extends React.Component<{
4+
fallback: (error: any) => React.ReactNode
5+
}> {
6+
state = { hasError: false, error: null }
7+
8+
static getDerivedStateFromError(error: any) {
9+
return {
10+
hasError: true,
11+
error,
12+
}
13+
}
14+
15+
render() {
16+
if (this.state.hasError) {
17+
return this.props.fallback(this.state.error)
18+
}
19+
return this.props.children
20+
}
21+
}

framework-boilerplates/blitzjs/app/layouts/.keep

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { AppProps } from "blitz"
2+
3+
export default function MyApp({ Component, pageProps }: AppProps) {
4+
return <Component {...pageProps} />
5+
}

0 commit comments

Comments
 (0)