Skip to content

Commit

Permalink
chore: remove next-auth (#190)
Browse files Browse the repository at this point in the history
# Pull Request type



Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [x] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?



Issue Number: N/A

## What is the new behavior?



-
-
-

## Does this introduce a breaking change?

- [ ] Yes
- [ ] No



## Other information




PR-URL: #190
Co-authored-by: Joe Karow <[email protected]>
  • Loading branch information
kodiakhq[bot] and JoeKarow authored Sep 26, 2023
2 parents 8f60b10 + a202ed6 commit 4cd80e2
Show file tree
Hide file tree
Showing 19 changed files with 652 additions and 1,308 deletions.
130 changes: 130 additions & 0 deletions .github/workflows/nextjs_bundle_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: 'Next.js Bundle Analysis'

on:
pull_request:
push:
branches:
- main # change this if your default branch is named differently
workflow_dispatch:

defaults:
run:
# change this if your nextjs app does not live at the root of the repo
working-directory: ./

permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Restore next build
uses: actions/cache@v3
id: restore-build-cache
env:
cache-name: cache-next-build
with:
# if you use a custom build directory, replace all instances of `.next` in this file with your build directory
# ex: if your app builds to `dist`, replace `.next` with `dist`
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Build next.js app
# change this if your site requires a custom build command
run: ./node_modules/.bin/next build
env:
POSTGRES_PRISMA_URL: ${{ secrets.POSTGRES_PRISMA_URL }}

# Here's the first place where next-bundle-analysis' own script is used
# This step pulls the raw bundle stats for the current bundle
- name: Analyze bundle
run: npx -p nextjs-bundle-analysis report

- name: Upload bundle
uses: actions/upload-artifact@v3
with:
name: bundle
path: .next/analyze/__bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
if: success() && github.event.number
with:
workflow: nextjs_bundle_analysis.yml
branch: ${{ github.event.pull_request.base.ref }}
path: .next/analyze/base

# And here's the second place - this runs after we have both the current and
# base branch bundle stats, and will compare them to determine what changed.
# There are two configurable arguments that come from package.json:
#
# - budget: optional, set a budget (bytes) against which size changes are measured
# it's set to 350kb here by default, as informed by the following piece:
# https://infrequently.org/2021/03/the-performance-inequality-gap/
#
# - red-status-percentage: sets the percent size increase where you get a red
# status indicator, defaults to 20%
#
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
# entry in your package.json file.
- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare

- name: Get Comment Body
id: get-comment-body
if: success() && github.event.number
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$(cat .next/analyze/__bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: Find Comment
uses: peter-evans/find-comment@v2
if: success() && github.event.number
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: '<!-- __NEXTJS_BUNDLE -->'

- name: Create Comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}

- name: Update Comment
uses: peter-evans/create-or-update-comment@v2
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.get-comment-body.outputs.body }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import i18nConfig from './next-i18next.config.js'
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful for
* Docker builds.
*/
// eslint-disable-next-line turbo/no-undeclared-env-vars

!process.env.SKIP_ENV_VALIDATION && (await import('./src/env/server.mjs'))

const withRoutes = nextRoutes({ outDir: 'src/types' })
Expand Down
24 changes: 7 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,26 @@
"@emotion/server": "11.11.0",
"@mantine/carousel": "6.0.21",
"@mantine/core": "6.0.21",
"@mantine/dates": "6.0.21",
"@mantine/dropzone": "6.0.21",
"@mantine/form": "6.0.21",
"@mantine/hooks": "6.0.21",
"@mantine/modals": "6.0.21",
"@mantine/next": "6.0.21",
"@mantine/notifications": "6.0.21",
"@mantine/nprogress": "6.0.21",
"@mantine/prism": "6.0.21",
"@mantine/spotlight": "6.0.21",
"@mantine/tiptap": "6.0.21",
"@mantine/utils": "6.0.21",
"@next-auth/prisma-adapter": "1.0.7",
"@next/bundle-analyzer": "13.5.3",
"@prisma/client": "5.3.1",
"@tabler/icons-react": "2.35.0",
"@tanstack/react-query": "4.35.3",
"@tanstack/react-query-devtools": "4.35.3",
"@tiptap/extension-link": "2.1.11",
"@tiptap/react": "2.1.11",
"@tiptap/starter-kit": "2.1.11",
"@trpc/client": "10.38.4",
"@trpc/next": "10.38.4",
"@trpc/react-query": "10.38.4",
"@trpc/server": "10.38.4",
"@vercel/analytics": "1.0.2",
"dayjs": "1.11.10",
"embla-carousel-auto-height": "7.1.0",
"embla-carousel-react": "7.1.0",
"eslint-config-prettier": "9.0.0",
"i18next": "23.5.1",
"i18next-browser-languagedetector": "7.1.0",
"i18next-http-backend": "2.2.2",
"luxon": "3.4.3",
"nanoid": "5.0.1",
"next": "13.5.3",
"next-auth": "4.23.1",
"next-i18next": "14.0.3",
"next-sitemap": "4.2.3",
"nextjs-routes": "2.0.1",
Expand Down Expand Up @@ -123,6 +106,7 @@
"husky": "8.0.3",
"lint-staged": "14.0.1",
"listr2": "6.6.1",
"luxon": "3.4.3",
"merge-anything": "5.1.7",
"prettier": "3.0.3",
"prettier-plugin-jsdoc": "1.0.2",
Expand All @@ -144,6 +128,12 @@
"ct3aMetadata": {
"initVersion": "7.3.2"
},
"nextBundleAnalysis": {
"budget": 358400,
"budgetPercentIncreaseRed": 20,
"minimumChangeThreshold": 0,
"showDetails": true
},
"pnpm": {
"overrides": {
"eslint-plugin-import": "npm:eslint-plugin-i"
Expand Down
Loading

0 comments on commit 4cd80e2

Please sign in to comment.