Skip to content

Commit

Permalink
feat: refactored from vite to nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
KatoakDR committed Oct 15, 2023
1 parent 72c2bd7 commit 7d8e557
Show file tree
Hide file tree
Showing 72 changed files with 3,180 additions and 1,490 deletions.
31 changes: 16 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# ==========================================================
# BUILD TIME ENV VARIABLES
# ==========================================================
# To allow Sentry to upload events from renderer process.
# Our Content-Security Policy allow lists this domain.
# Infer this from the SENTRY_DSN.
SENTRY_INGEST_DOMAIN="https://456.ingest.sentry.io"

# The SENTRY_AUTH_TOKEN variable is picked up by the Sentry Build Plugin.
# It's used for authentication when uploading source maps.
# Sentry auth token for uploading sourcemaps.
SENTRY_AUTH_TOKEN="sntrys_xxx"

# ==========================================================
# MAIN PROCESS RUNTIME ENV VARIABLES
# ==========================================================
MAIN_VITE_SENTRY_DSN="https://xxx@yyy.ingest.sentry.io/zzz"
MAIN_VITE_SENTRY_CRASH_REPORT_DSN="https://xxx.ingest.sentry.io/api/yyy/minidump/?sentry_key=zzz"
# Sentry DSN for posting events.
SENTRY_DSN="https://123@456.ingest.sentry.io/xxx"

# ==========================================================
# RENDERER PROCESS RUNTIME ENV VARIABLES
# ==========================================================
RENDERER_VITE_SENTRY_DSN="https://xxx@yyy.ingest.sentry.io/zzz"
RENDERER_VITE_SENTRY_CRASH_REPORT_DSN="https://xxx.ingest.sentry.io/api/yyy/minidump/?sentry_key=zzz"
# Sentry organization and project for tagging events.
# The Sentry organization is the same as the GitHub organization.
# The Sentry project is the same as the GitHub repository.
SENTRY_ORG="dragonrealms-phoenix"
SENTRY_PROJECT="phoenix"

# https://docs.sentry.io/platforms/javascript/guides/electron/configuration/tree-shaking/
__SENTRY_DEBUG__=false
__SENTRY_TRACING__=false
36 changes: 31 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
node_modules
out
dist
coverage
.gitignore
# See https://eslint.org/docs/latest/use/configure/ignore for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# next.js
/electron/build
/electron/renderer/.next
/electron/renderer/public/themes

# production
/build
/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# typescript
*.tsbuildinfo
108 changes: 0 additions & 108 deletions .eslintrc.json

This file was deleted.

14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ jobs:

- name: Create .env file from GitHub Secrets
run: |
echo "SENTRY_INGEST_DOMAIN=${{ secrets.SENTRY_INGEST_DOMAIN }}" >> .env
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
echo "SENTRY_ORG=${{ github.repository_owner }}" >> .env
echo "SENTRY_PROJECT=${{ github.event.repository.name }}" >> .env
echo "MAIN_VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
echo "MAIN_VITE_SENTRY_CRASH_REPORT_DSN=${{ secrets.SENTRY_CRASH_REPORT_DSN }}" >> .env
echo "RENDERER_VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
echo "RENDERER_VITE_SENTRY_CRASH_REPORT_DSN=${{ secrets.SENTRY_CRASH_REPORT_DSN }}" >> .env
# https://docs.sentry.io/platforms/javascript/guides/electron/configuration/tree-shaking/
echo "__SENTRY_DEBUG__=false" >> .env
echo "__SENTRY_TRACING__=false" >> .env
- name: Install dependencies
run: yarn install
Expand All @@ -63,7 +65,7 @@ jobs:

- name: Build MacOS
if: matrix.os == 'macos-latest'
run: yarn build:mac
run: yarn build:mac && yarn sentry:sourcemaps

- name: Build Windows
if: matrix.os == 'windows-latest'
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ jobs:
run: ls -R
working-directory: dist

- name: Release
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: yarn semantic-release

- name: Sentry Release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ github.repository_owner }}
SENTRY_PROJECT: ${{ github.event.repository.name }}
with:
environment: production
112 changes: 24 additions & 88 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,98 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# dependencies
/node_modules

# Runtime data
pids
*.pid
*.seed
*.pid.lock
.DS_Store
# testing
/coverage

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# next.js
/electron/build
/electron/renderer/.next
/electron/renderer/public/themes

# Coverage directory used by tools like istanbul
coverage
*.lcov
# production
/build
/dist

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# misc
.DS_Store
*.pem

# Dependency directories
node_modules/
jspm_packages/
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# TypeScript v1 declaration files
typings/
# local env files
.env*.local

# TypeScript cache
# typescript
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Webpack
.webpack/

# Vite
.vite/

# Electron Builder
out/

# TypeScript
dist/

# Sentry Auth Token
.env.sentry-build-plugin
# sentry
.sentryclirc
37 changes: 31 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
node_modules
out
dist
coverage
tsconfig.json
tsconfig.*.json
# See https://prettier.io/docs/en/ignore.html for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# next.js
/electron/build
/electron/renderer/.next
/electron/renderer/public/themes

# production
/build
/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# typescript
*.tsbuildinfo

# Changelog is auto-generated by semantic-release
CHANGELOG.md
Loading

0 comments on commit 7d8e557

Please sign in to comment.