Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website refactor #124

Merged
merged 7 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

6 changes: 0 additions & 6 deletions .dockerignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

93 changes: 25 additions & 68 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,33 @@
name: Checks

on:
pull_request:
push:
branches:
- master
workflow_dispatch:

name: CI
on: [push]
jobs:
pre_ci:
name: Prepare CI environment
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: '[Push] Get commit message'
if: github.event_name == 'push'
id: push_get_commit_message
run: echo ::set-output name=push_commit_message::$(git log --format=%B -n 1 HEAD)
- name: '[Pull Request] Get commit message'
if: github.event_name == 'pull_request'
id: pr_get_commit_message
run: echo ::set-output name=pr_commit_message::$(git log --format=%B -n 1 HEAD^2)
- name: Add problem matchers
run: |
echo "::add-matcher::.github/problemMatchers/eslint-stylish.json"
echo "::add-matcher::.github/problemMatchers/tsc.json"
outputs:
commit_message: $( [ -z "${{ steps.pr_get_commit_message.outputs.pr_commit_message }}" ] && echo "${{ steps.push_get_commit_message.outputs.push_commit_message }}" || echo "${{ steps.pr_get_commit_message.outputs.pr_commit_message }}" )
build:
name: Build, lint, and test on Node

Linting:
name: Linting
runs-on: ubuntu-latest
if: "!contains(needs.pre_ci.outputs.commit_message, '[skip ci]')"
needs: pre_ci
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v4
with:
node-version: 16
- name: Restore NodeJS Cache
uses: actions/cache@v4.1.1
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Run ESLint
run: yarn lint --fix=false

Build:
name: Compiling source code
runs-on: ubuntu-latest
if: "!contains(needs.pre_ci.outputs.commit_message, '[skip ci]')"
needs: pre_ci
env:
CI: true
NEXT_PUBLIC_APP_URL: "https://onruntime.com"

steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js 16
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Enable Corepack
run: corepack enable

- name: Use Node
uses: actions/setup-node@v4
with:
node-version: 16
- name: Restore NodeJS Cache
uses: actions/cache@v4.1.1
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
node-version: "22.x"
cache: "yarn"

- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Compiling source code
run: yarn build
run: yarn

- name: Lint
run: yarn lint

- name: Build
run: yarn build
19 changes: 13 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
# dependencies
/node_modules
/.pnp
.pnp.js
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage
Expand All @@ -23,12 +28,14 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": [],
"unwantedRecommendations": []
}
42 changes: 0 additions & 42 deletions Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions PRIVACY.md

This file was deleted.

36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
10 changes: 0 additions & 10 deletions app.json

This file was deleted.

21 changes: 21 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
20 changes: 20 additions & 0 deletions env.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
server: {
NODE_ENV: z.enum(["development", "production", "test"]),
PORT: z.string().optional(),
},
client: {
NEXT_PUBLIC_APP_URL: z.string().optional(),
},
runtimeEnv: {
NEXT_PUBLIC_APP_URL:
process.env.NEXT_PUBLIC_APP_URL || "https://onruntime.com",
NODE_ENV: process.env.NODE_ENV,
PORT: process.env.PORT,
},
skipValidation: !!process.env.CI,
emptyStringAsUndefined: true,
});
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];

export default eslintConfig;
1 change: 0 additions & 1 deletion is.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
7 changes: 0 additions & 7 deletions next.config.js

This file was deleted.

37 changes: 37 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { NextConfig } from "next";

import createMDX from "@next/mdx";

import "./env.mjs";

const nextConfig: NextConfig = {
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
reactStrictMode: process.env.NODE_ENV === "development",
env: {
NEXT_PUBLIC_NODE_ENV: process.env.NODE_ENV,
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
use: ["@svgr/webpack"],
});

return config;
},
experimental: {
turbo: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
},
};

const withMDX = createMDX({
extension: /\.mdx?$/,
});

export default withMDX(nextConfig);
Loading