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

feat(web): 🔥✨ rebuild on Next.js #4359

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1fd350a
refactor(web): ♻️🔥 purge existing create-react-app site
collinbarrett Jun 15, 2024
9eab5ce
feat(web): ✨ npx create-next-app@latest filterlists
collinbarrett Jun 15, 2024
97a3bdd
feat(web): ✨ npx shadcn-ui@latest init
collinbarrett Jun 15, 2024
19241a1
feat(web): ✨🎨 npm install --save-dev --save-exact prettier
collinbarrett Jun 15, 2024
05e2584
chore(web): 🎨 npx prettier . --write
collinbarrett Jun 15, 2024
88f07bf
ci: add Azure Static Web Apps workflow file
collinbarrett Jun 15, 2024
2fa09c2
refactor(web): ♻️ customize stapp Build & Deploy Action
collinbarrett Jun 15, 2024
70f7f31
refactor(web): 🔥 rm next README
collinbarrett Jun 15, 2024
94579f7
feat(web): ✨ add favicon
collinbarrett Jun 15, 2024
84f62e2
feat(web): ✨ add metadata
collinbarrett Jun 15, 2024
40e75ed
refactor(web): 🔥 purge Next.js boilerplate homepage
collinbarrett Jun 15, 2024
be275d5
feat(web): ✨🚧 WIP scaffold FilterLists table
collinbarrett Jun 15, 2024
ff94b48
feat(web): ✨🌗 add dark mode
collinbarrett Jun 15, 2024
4972b56
feat(web): ✨🚧 add pagination
collinbarrett Jun 15, 2024
555a936
feat(web): ✨🚧 add column sorting
collinbarrett Jun 15, 2024
9eb4595
feat(web): ✨ add logo
collinbarrett Jun 15, 2024
e09cffa
refactor(web): ♻️ set fixed row height
collinbarrett Jun 16, 2024
ccafd2e
refactor(web): ♻️🔥 rm rows per page selector
collinbarrett Jun 16, 2024
ffac01e
refactor(web): ♻️ expand table to fill width
collinbarrett Jun 16, 2024
228aff4
refactor(web): ♻️ rm extra vertical space
collinbarrett Jun 16, 2024
9703de6
refactor(web): ♻️⚡️ import logo statically
collinbarrett Jun 16, 2024
a4002d1
refactor(web): ♻️⚡️ extract FilterListsTable w/Loading state
collinbarrett Jun 16, 2024
8c4f901
refactor(web): ♻️ extract metadata to another file
collinbarrett Jun 16, 2024
6f711af
refactor(web): ♻️🔥 simplify root layout
collinbarrett Jun 16, 2024
2c77170
refactor(web): ♻️⚡️ extract logo client component
collinbarrett Jun 16, 2024
565783f
refactor(web): ♻️ misc. tidy
collinbarrett Jun 16, 2024
5bdde5d
refactor(web): ♻️ prettierignore shadcn/ui for diff cli support
collinbarrett Jun 16, 2024
9610f58
refactor(web): 🎨 npm i --save-dev @ianvs/prettier-plugin-sort-imports
collinbarrett Jun 17, 2024
2350912
feat(web): ✨⚡️ ensure stapp service cache-control for _next/static
collinbarrett Jun 17, 2024
11014ae
feat(web): ✨🎨 npm install -D prettier prettier-plugin-tailwindcss
collinbarrett Jun 17, 2024
6cb73af
build(deps-dev): bump @types/node from 20.14.2 to 20.14.5 in /web
dependabot[bot] Jun 18, 2024
ccc9f1b
feat(web): ✨🚧 adopt shadcn/ui dashboard-01 Block
collinbarrett Jun 18, 2024
1a1cce4
fix(web): 🐛 prevent horizontal scrolling in the table
collinbarrett Jun 18, 2024
c1b34dd
refactor(web): ♻️ set rows-per-page by window height
collinbarrett Jun 18, 2024
6ebe04f
refactor(web): ♻️ use Skeleton Suspense
collinbarrett Jun 18, 2024
e446553
refactor(web): ♻️ simplify metadata override
collinbarrett Jun 18, 2024
46b60f1
feat(web): ✨📄 add About copy
collinbarrett Jun 18, 2024
88a1638
feat(web): ✨🚧 WIP add button->modal
collinbarrett Jun 19, 2024
dbd83c3
Revert "feat(web): ✨🚧 WIP add button->modal"
collinbarrett Jun 20, 2024
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
129 changes: 52 additions & 77 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,34 @@ name: Web - Build & Deploy
on:
push:
branches:
- main
paths:
- .github/workflows/web.yml
- web/**
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
# - main # TODO: uncomment when merging nextjs to main
- nextjs # TODO: remove when merging nextjs to main
paths:
- .github/workflows/web.yml
- web/**
# TODO: uncomment when merging nextjs to main
# pull_request:
# types: [opened, synchronize, reopened, closed]
# branches:
# - main
# paths:
# - .github/workflows/web.yml
# - web/**

jobs:
build_and_deploy_staging:
name: Build & Deploy to Staging
# name: Build & Deploy to Staging
name: Build & Deploy to Next.js Staging

runs-on: ubuntu-latest

if: github.event_name == 'pull_request' && github.event.action != 'closed'
# if: github.event_name == 'pull_request' && github.event.action != 'closed'
if: github.event_name == 'push'

environment:
name: staging-web
url: ${{ steps.builddeploy.outputs.static_web_app_url }}
name: nextjs-web
# url: ${{ steps.builddeploy.outputs.static_web_app_url }}
url: https://next.filterlists.com

steps:
- name: Checkout
Expand All @@ -43,89 +48,59 @@ jobs:
working-directory: ./web

- name: Run Prettier
run: npm run prettier:check
run: npm run prettier
working-directory: ./web

- name: Run ESLint
run: npm run eslint:check
run: npm run lint
working-directory: ./web

- name: Build
run: npm run build
working-directory: ./web

- name: Copy Static Web App Config
run: cp staticwebapp.config.json build/
working-directory: ./web

- name: Deploy
- name: Build & Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }}
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_NEXTJS_PROD }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: ./web/build
app_location: ./web
output_location: ""
skip_app_build: true
continue-on-error: true

build_and_deploy_production:
name: Build & Deploy to Production
# build_and_deploy_production:
# name: Build & Deploy to Production

runs-on: ubuntu-latest

if: github.event_name == 'push'

environment:
name: production-web
url: https://filterlists.com

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
cache-dependency-path: web/package-lock.json
# runs-on: ubuntu-latest

- name: Install
run: npm ci
working-directory: ./web
# if: github.event_name == 'push'

- name: Build
run: npm run build
working-directory: ./web
# environment:
# name: production-web
# url: https://filterlists.com

- name: Copy Static Web App Config
run: cp staticwebapp.config.json build/
working-directory: ./web
# steps:
# - name: Checkout
# uses: actions/checkout@v4

- name: Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: ./web/build
output_location: ""
skip_app_build: true
# - name: Build & Deploy
# id: builddeploy
# uses: Azure/static-web-apps-deploy@v1
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }}
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# action: upload
# app_location: ./web
# output_location: ""

close_pull_request:
name: Close Pull Request
# close_pull_request:
# name: Close Pull Request

runs-on: ubuntu-latest
# runs-on: ubuntu-latest

if: github.event_name == 'pull_request' && github.event.action == 'closed'
# if: github.event_name == 'pull_request' && github.event.action == 'closed'

steps:
- name: Close Pull Request
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }}
action: close
app_location: ./web
# steps:
# - name: Close Pull Request
# uses: Azure/static-web-apps-deploy@v1
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_STAPP_FILTERLISTS_PROD }}
# action: close
# app_location: ./web
3 changes: 3 additions & 0 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "prettier"]
}
23 changes: 17 additions & 6 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
# https://raw.githubusercontent.com/facebook/create-react-app/master/packages/cra-template/template/gitignore

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

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

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
3 changes: 3 additions & 0 deletions web/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
56 changes: 55 additions & 1 deletion web/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
{
"endOfLine": "auto"
"importOrder": [
"^(react/(.*)$)|^(react$)",
"^(next/(.*)$)|^(next$)",
"<THIRD_PARTY_MODULES>",
"",
"^types$",
"^@/env(.*)$",
"^@/types/(.*)$",
"^@/config/(.*)$",
"^@/lib/(.*)$",
"^@/hooks/(.*)$",
"^@/components/ui/(.*)$",
"^@/components/(.*)$",
"^@/styles/(.*)$",
"^@/app/(.*)$",
"",
"^[./]"
],
"importOrderTypeScriptVersion": "5.0.0",
"plugins": [
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": "components/ui/*",
"options": {
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"importOrder": [
"^(react/(.*)$)|^(react$)",
"^(next/(.*)$)|^(next$)",
"<THIRD_PARTY_MODULES>",
"",
"^types$",
"^@/types/(.*)$",
"^@/config/(.*)$",
"^@/lib/(.*)$",
"^@/hooks/(.*)$",
"^@/components/ui/(.*)$",
"^@/components/(.*)$",
"^@/registry/(.*)$",
"^@/styles/(.*)$",
"^@/app/(.*)$",
"",
"^[./]"
],
"importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"],
"plugins": ["@ianvs/prettier-plugin-sort-imports"]
}
}
]
}
54 changes: 54 additions & 0 deletions web/app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Metadata } from "next";

import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";

import { metadata as siteMetadata, title } from "../metadata";

export const metadata: Metadata = {
title: "About | " + title,
openGraph: {
...siteMetadata.openGraph,
title: "About | " + title,
},
twitter: {
...siteMetadata.twitter,
title: "About | " + title,
},
};

export default function About() {
return (
<div className="grid gap-4 md:gap-8 lg:grid-cols-2 xl:grid-cols-3">
<Card className="col-span-full w-full" x-chunk="dashboard-01-chunk-4">
<CardContent className="space-y-4 p-6 !pt-6">
<p>
{
"FilterLists is the independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances."
}
</p>
<p>
{
"FilterLists helps to protect your privacy and security when using the internet. It provides a comprehensive directory of subscription lists to block advertisements, malware, trackers, and other general annoyances. First, install one of the software tools that supports these lists. Then you can subscribe to a set of these lists inside of that software."
}
</p>
<p>
{
"Using a software firewall or adblocker has become a key tool in protecting one's privacy online. While the current business model of the \"free\" internet relies upon advertising revenue, publishers have become too flippant about tracking users without their consent. Advertising networks track users' browsing habits around the internet building lucrative profiles to exploit for targeted marketing or big data research. Until internet publishers develop more transparency or a new business model, we must continue to take the protection of our privacy into our hands."
}
</p>
<p>
{
"Typical adblockers run as an extension in popular web browsers. As we browse the internet, they compare HTTP requests to their list of hosts and filters to selectively block advertisements, trackers, and malware. This filtering helps to protect the surfer's privacy, prevents malvertising attacks, and reduces bandwidth requirements. Thousands of contributors work hard to maintain these FilterLists for anyone to use. Locating and selecting these lists, however, has not historically been very easy. This project was launched in 2015 to solve that problem."
}
</p>
</CardContent>
</Card>
</div>
);
}
Loading