Skip to content

Commit

Permalink
Scalable Codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
a0v0 authored Jul 18, 2024
1 parent 6660970 commit 0b947bd
Show file tree
Hide file tree
Showing 338 changed files with 28,119 additions and 18,631 deletions.
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "cz-conventional-changelog"
}
44 changes: 44 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM mcr.microsoft.com/playwright:v1.44.1-jammy

# Install homebrew
RUN apt-get update && \
apt-get install -y -q --allow-unauthenticated \
git \
sudo \
build-essential
RUN useradd -m -s /bin/zsh linuxbrew && \
usermod -aG sudo linuxbrew && \
mkdir -p /home/linuxbrew/.linuxbrew && \
chown -R linuxbrew: /home/linuxbrew/.linuxbrew
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
USER root
RUN chown -R $CONTAINER_USER: /home/linuxbrew/.linuxbrew
ENV PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
RUN git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew
USER linuxbrew

# Install deps
RUN brew install go-task
RUN brew install node@22 pnpm

# Reset user
USER root

# Set environment variables
RUN echo 'export PATH=$PATH:.fvm/flutter_sdk/bin' >> ~/.profile
RUN echo 'export PATH=$PATH:~/.pub-cache/bin' >> ~/.profile


# Playwright dependencies
RUN apt-get install -y xvfb
RUN apt-get install -qqy x11-apps

# chromium dependencies
RUN apt-get install -y libnss3 \
libxss1 \
libasound2 \
fonts-noto-color-emoji

# additional actions related to your project
ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/xvfb-run -a $@", ""]
20 changes: 20 additions & 0 deletions .devcontainer/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 3

tasks:
default:
cmds:
- task -l

setup:
desc: Install dependencies
silent: true
cmds:
- git config --global --add safe.directory /workspaces/avtoolz
- curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install > ~/install
- fish ~/install --noninteractive
- fish -c "set -U fish_greeting"
- fish -c "omf install randomrussel"
- fish -c "omf install foreign-env"
- echo 'fenv source ~/.profile' > ~/.config/fish/config.fish
- npx playwright install chromium --with-deps
# FIXME: add headed browser support for playwright
71 changes: 71 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "aVtoolz",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {},
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "task -t .devcontainer/Taskfile.yml setup && task install",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ibm.output-colorizer",
"infeng.vscode-react-typescript",
"jeroen-meijer.pubspec-assist",
"yoavbls.pretty-ts-errors",
"jock.svg",
"gruntfuggly.todo-tree",
"task.vscode-task",
"ms-azuretools.vscode-docker",
"dbaeumer.vscode-eslint",
"mikestead.dotenv",
"csstools.postcss",
"bradlc.vscode-tailwindcss",
"vitest.explorer",
"humao.rest-client",
"ms-playwright.playwright",
"github.vscode-github-actions",
"lokalise.i18n-ally",
"IBM.output-colorizer",
"mhutchie.git-graph",
"ms-vscode.vscode-typescript-next",
"hoovercj.vscode-power-mode",
"esbenp.prettier-vscode",
"YoavBls.pretty-ts-errors",
"Gruntfuggly.todo-tree",
"redhat.vscode-yaml",
"vivaxy.vscode-conventional-commits"
]
}
},
"runArgs": [
// Uncomment for USB Debugging suport
"--privileged",
"--mount",
"source=/dev/bus/usb,target=/dev/bus/usb,type=bind",
// Uncomment for Android Emulator passthrough support (Work in Progress)
"--device",
"/dev/kvm",
"--device",
"/dev/dri:/dev/dri",
"-v",
"/tmp/.X11-unix:/tmp/.X11-unix",
"-e",
"DISPLAY"
],
"containerEnv": {
"DISPLAY": "host.docker.internal:0.0"
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
30 changes: 30 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# FIXME: Configure environment variables for your project

# For security reason, don't push secret key in your git repo.
# Append .local to the environment files to prevent your secret key from being commited to Git.

# Hosting
# Replace by your domain name, only for production
# NEXT_PUBLIC_APP_URL=https://example.com

# Database
# Please use a working DATABASE_URL. Otherwise, Next.js build will timeout and you will get the following error: "because it took more than 60 seconds"
# DATABASE_URL=libsql://[RANDOM-CHARS]-[DB-NAME]-[ORG-NAME].turso.io
DATABASE_URL=file:next-js-boilerplate.db

# Clerk authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_b3Blbi1zdGlua2J1Zy04LmNsZXJrLmFjY291bnRzLmRldiQ

NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in

######## [BEGIN] SENSITIVE DATA ######## For security reason, don't update the following variables (secret key) directly in this file.
######## Please create a new file named `.env.local`, all environment files ending with `.local` won't be tracked by Git.
######## After creating the file, you can add the following variables.
CLERK_SECRET_KEY=your_clerk_secret_key

# DATABASE_AUTH_TOKEN=

# LOGTAIL_SOURCE_TOKEN=
######## [END] SENSITIVE DATA

NEXT_TELEMETRY_DISABLED=1
15 changes: 0 additions & 15 deletions .env.example

This file was deleted.

24 changes: 2 additions & 22 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
.now/*
.next/*
*.css
.changeset
dist
esm/*
public/*
tests/*
scripts/*
*.config.js
.DS_Store
node_modules
coverage
.next
build
out
!.storybook
/**/.storybook/**
!.commitlintrc.cjs
!.lintstagedrc.cjs
!jest.config.js
!plopfile.js
!react-shim.js
!tsup.config.ts
apps/docs/next-redirect.js
.pnpm-store
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
}
}
16 changes: 3 additions & 13 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# These are supported funding model platforms

github: a0v0
patreon: # Replace with a single Patreon username
open_collective:
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt:
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
github: ixartz
custom:
["https://donate.stripe.com/7sI5m5146ehfddm7tj", "https://nextlessjs.com"]
19 changes: 0 additions & 19 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
94 changes: 94 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
node_version:
# - 18
- 20
# - 22
architecture:
- x64
name: E2E tests with node@${{ matrix.node_version }} on ${{ matrix.os }} - ${{ matrix.architecture }}
steps:
- name: Checkout
uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# name: Install pnpm
# with:
# version: 9
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: ${{ matrix.node_version }}
pnpm-version: 9
# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node_version }}
# architecture: ${{ matrix.architecture }}
# cache: "pnpm"
- name: Install dependencies
run: pnpm install
# - name: Get pnpm store directory
# shell: bash
# run: |
# echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

# - uses: actions/cache@v4
# name: Setup pnpm cache
# with:
# path: ${{ env.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-

# - name: Set SENTRY_AUTH_TOKEN env if secret exists
# run: |
# if [[ -n "${{ secrets.SENTRY_AUTH_TOKEN }}" ]]; then
# echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> $GITHUB_ENV
# fi

- name: Build Next.js for E2E tests
run: pnpm build

# TODO: Add commitlint to PRs
# - if: github.event_name == 'pull_request'
# name: Validate all commits from PR
# run: pnpx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

# - name: Linter
# run: pnpm lint

# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Install Playwright (used for Storybook and E2E tests)
run: npx playwright install --with-deps

# - name: Run storybook tests
# run: pnpm run test-storybook:ci
- name: Run E2E tests
run: pnpm run test:e2e
# env:
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: test-results/
retention-days: 30
Loading

0 comments on commit 0b947bd

Please sign in to comment.