Skip to content

Commit

Permalink
Merge pull request #19 from SkidGod4444/feature/app
Browse files Browse the repository at this point in the history
add scripts
  • Loading branch information
SkidGod4444 authored Nov 7, 2024
2 parents ed8fb5a + e8ed8cf commit 584ad2b
Show file tree
Hide file tree
Showing 11 changed files with 2,211 additions and 84 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/format-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,19 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Format code with Prettier
run: pnpm format
- name: Check formatting with Prettier
id: format_check
run: |
if pnpm format:check; then
echo "Formatting is correct"
else
echo "Formatting required"
echo "formatting_required=true" >> $GITHUB_ENV
fi
- name: Format code with Prettier if needed
if: env.formatting_required == 'true'
run: pnpm format:write

- name: Check for changes and push if needed
run: |
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@ jobs:
- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Lint web code
run: cd ./apps/www && pnpm lint && cd ../..
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Lint api code
run: cd ./apps/api && pnpm lint && cd ../..
- name: Install dependencies
run: pnpm install --shamefully-hoist

# - name: Lint turbo
# run: pnpm lint
- name: Run Lint
run: pnpm lint

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,8 +69,5 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Test api code
run: cd ./apps/api && pnpm test && cd ../..

# - name: Run tests
# run: pnpm test
- name: Run tests
run: pnpm test
9 changes: 3 additions & 6 deletions .github/workflows/test-multiple-node-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Test api code
run: cd ./apps/api && pnpm test && cd ../..

# - name: Run tests
# run: pnpm test

- name: Run tests
run: pnpm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public-hoist-pattern[]=*
15 changes: 10 additions & 5 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{
"name": "api",
"name": "plura-api",
"scripts": {
"dev": "next dev",
"dev": "next dev -p 3001 --turbopack",
"build": "next build",
"start": "next start",
"start": "next start -p 5555",
"preview": "next build && next start -p 5555",
"lint": "next lint",
"test": "vitest",
"db:generate": "prisma generate"
"lint:fix": "next lint --fix",
"test": "vitest --run",
"db:generate": "prisma generate",
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
},
"dependencies": {
"@repo/db": "workspace:*",
"contentlayer2": "^0.5.3",
"hono": "^4.6.9",
"next": "15.0.2",
"react": "19.0.0-rc-02c0e824-20241028",
Expand Down
23 changes: 14 additions & 9 deletions apps/app/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
{
"name": "app",
"name": "plura-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev -p 3002 --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
"start": "next start -p 4444",
"preview": "next build && next start -p 4444",
"lint": "next lint",
"lint:fix": "next lint --fix",
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
},
"dependencies": {
"contentlayer2": "^0.5.3",
"next": "15.0.2",
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"next": "15.0.2"
"react-dom": "19.0.0-rc-02c0e824-20241028"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "15.0.2",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"eslint": "^8",
"eslint-config-next": "15.0.2"
"typescript": "^5"
}
}
12 changes: 8 additions & 4 deletions apps/www/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"name": "www",
"name": "plura-www",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev -p 3003 --turbopack",
"build": "next build",
"start": "next start",
"start": "next start -p 3333",
"preview": "next build && next start -p 3333",
"lint": "next lint",
"test": "vitest"
"lint:fix": "next lint --fix",
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
},
"dependencies": {
"@radix-ui/react-avatar": "^1.1.1",
Expand All @@ -18,6 +21,7 @@
"@radix-ui/react-tooltip": "^1.1.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"contentlayer2": "^0.5.3",
"framer-motion": "^11.11.11",
"geist": "^1.3.1",
"lucide-react": "^0.454.0",
Expand Down
29 changes: 22 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
{
"name": "plura",
"private": true,
"author": {
"name": "saidevdhal",
"url": "https://twitter.com/SaidevDhal"
},
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"test": "turbo run test",
"test:watch": "turbo run test:watch",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"plura-api": "cd ./apps/api && pnpm run start",
"plura-web": "cd ./apps/www && pnpm run start"
"build:www": "turbo --filter=plura-www build",
"build:app": "turbo --filter=plura-app build",
"build:api": "turbo --filter=plura-api build",
"dev": "turbo run dev --parallel",
"dev:www": "turbo --filter=plura-www dev",
"dev:app": "turbo --filter=plura-app dev",
"dev:api": "turbo --filter=plura-api dev",
"lint": "turbo run lint --force",
"lint:fix": "turbo run lint:fix",
"test": "turbo run test --force",
"typecheck": "turbo run typecheck",
"format:write": "turbo run format:write",
"format:check": "turbo run format:check"
},
"devDependencies": {
"@types/node": "^22.9.0",
Expand Down Expand Up @@ -37,6 +51,7 @@
"supertest": "^7.0.0",
"tailwindcss": "^3.4.1",
"typescript": "^5",
"vite-tsconfig-paths": "^5.1.0",
"vitest": "^2.1.4"
}
}
Loading

0 comments on commit 584ad2b

Please sign in to comment.