-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: create trpc app router example
- Loading branch information
Showing
23 changed files
with
6,915 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NEXT_PUBLIC_AXIOM_DATASET="" | ||
NEXT_PUBLIC_AXIOM_TOKEN="xaat-" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
const config = { | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: true, | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
extends: [ | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended-type-checked", | ||
"plugin:@typescript-eslint/stylistic-type-checked", | ||
], | ||
rules: { | ||
// These opinionated rules are enabled in stylistic-type-checked above. | ||
// Feel free to reconfigure them to your own preference. | ||
"@typescript-eslint/array-type": "off", | ||
"@typescript-eslint/consistent-type-definitions": "off", | ||
|
||
"@typescript-eslint/consistent-type-imports": [ | ||
"warn", | ||
{ | ||
prefer: "type-imports", | ||
fixStyle: "inline-type-imports", | ||
}, | ||
], | ||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], | ||
"@typescript-eslint/no-misused-promises": [ | ||
2, | ||
{ | ||
checksVoidReturn: { attributes: false }, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# database | ||
/prisma/db.sqlite | ||
/prisma/db.sqlite-journal | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
next-env.d.ts | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables | ||
.env | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# next-axiom tRPC + App Router Example | ||
|
||
This is an example for using next-axiom with the Next.js App Router and tRPC. It is based on `create-t3-app`. | ||
|
||
## Setup | ||
|
||
- Clone this repo | ||
- Add the dataset you want to ingest into and your token to `.env` | ||
- Run `npm install` | ||
- Run `npm run dev` | ||
- Visit `localhost:3000`. Your app should now be logging to Axiom. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { withAxiomNextConfig } from "next-axiom"; | ||
|
||
/** | ||
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful | ||
* for Docker builds. | ||
*/ | ||
await import("./src/env.mjs"); | ||
|
||
/** @type {import("next").NextConfig} */ | ||
const config = {}; | ||
|
||
export default withAxiomNextConfig(config); |
Oops, something went wrong.