Skip to content

Commit

Permalink
Merge pull request #167 from penumbra-zone/monorepo
Browse files Browse the repository at this point in the history
Reorg Project (monorepo, `pnpm`, `turbo`)
  • Loading branch information
ejmg authored Aug 8, 2024
2 parents 2c33fc6 + f42085b commit 25e360d
Show file tree
Hide file tree
Showing 133 changed files with 1,630 additions and 14,176 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@
!*.js
!*.json
!pnpm-lock.yaml
!pnpm-workspace.yaml


# nextjs files
!apps/*/src/
!apps/*/public/
!apps/*/.next/
!apps/*/*.ts
!apps/*/*.js
!apps/*/*.json

!public/
!src/
!.next/

# this is for the new docker file...
!.gitignore

53 changes: 26 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
# Dependencies
node_modules
.pnp
.pnp.js

# testing
/coverage
# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# next.js
/.next/
/out/
# Testing
coverage

# production
/build
# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
dist

# misc
.DS_Store
*.pem

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

# local env files
.env*.local
.envrc

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.env
# Misc
.DS_Store
*.pem
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

59 changes: 0 additions & 59 deletions Containerfile

This file was deleted.

7 changes: 6 additions & 1 deletion .eslintrc.json → apps/web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"],
"project": true,
"ecmaVersion": "latest",
"sourceType": "module"
},
Expand All @@ -28,6 +28,11 @@
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": {
"project": "./"
}
}
}
}
38 changes: 38 additions & 0 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local
.envrc

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.env
.turbo
64 changes: 64 additions & 0 deletions apps/web/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# slimmest image. only for running the container.
FROM docker.io/library/node:20-alpine AS alpine
LABEL maintainer="[email protected]"

# provide pnpm globally for dep installing and building
FROM alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
RUN pnpm install turbo --global

# prune package structure + code into out/
FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN turbo prune --scope=cuiloa-app --docker

# Install and build app
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# Disable build time telemetry.
ENV NEXT_TELEMETRY_DISABLED 1

# grab dependencies
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install --frozen-lockfile

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

RUN turbo run build --filter=cuiloa-app

# Run container
FROM alpine AS runner
WORKDIR /app

# Disable telemetry.
ENV NEXT_TELEMETRY_DISABLED 1

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

CMD node apps/web/server.js
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");

/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
experimental: {
outputFileTracingRoot: path.join(__dirname, "../../"),
},
};

module.exports = nextConfig;
70 changes: 70 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "cuiloa-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint",
"check-types": "tsc --noEmit"
},
"dependencies": {
"@buf/cometbft_cometbft.bufbuild_es": "^1.8.0-20240312114316-c0d3497e35d6.2",
"@buf/cosmos_ibc.bufbuild_es": "^1.9.0-20240327103030-e2006674271c.1",
"@buf/penumbra-zone_penumbra.bufbuild_es": "^1.9.0-20240520205529-36b404d2dbac.1",
"@buf/penumbra-zone_penumbra.connectrpc_es": "^1.4.0-20240520205529-36b404d2dbac.2",
"@buf/penumbra-zone_penumbra.connectrpc_query-es": "^1.4.1-20240528180215-8fe1c79485f8.1",
"@bufbuild/protobuf": "^1.9.0",
"@connectrpc/connect": "^1.4.0",
"@connectrpc/connect-query": "^1.4.1",
"@connectrpc/connect-web": "^1.4.0",
"@penumbra-zone/getters": "^4.0.0",
"@penumbra-zone/types": "^5.0.0",
"@pgtyped/runtime": "^2.3.0",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@tanstack/react-query": "^5.49.2",
"@tanstack/react-table": "^8.10.6",
"@types/pg": "^8.11.6",
"axios": "^1.5.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.0",
"install": "^0.13.0",
"lucide-react": "^0.284.0",
"next": "^14.2.5",
"next-themes": "^0.3.0",
"npm": "^10.8.0",
"pg": "^8.11.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-json-view-lite": "^1.4.0",
"sharp": "^0.33.4",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^2.9.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.2.3",
"@pgtyped/cli": "^2.3.0",
"@stylistic/eslint-plugin": "^2.1.0",
"@tanstack/react-query-devtools": "^5.51.1",
"@types/eslint": "^8.56.10",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"autoprefixer": "^10",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-react": "^7.34.1",
"postcss": "^8",
"tailwindcss": "^3",
"typescript": "^5.4.5"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tsconfig.json → apps/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@/*": ["./src/*"],
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["next.config.js", "next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 25e360d

Please sign in to comment.