Skip to content

Commit

Permalink
build: improve monorepo package confs (#475)
Browse files Browse the repository at this point in the history
* chore: remove uncessary ignore `eslint` comment

* build: make it node 16

* build: add postinstall command

* build: improve the post install script

* chore: format

* build: add `syncpack`

* chore: add new deps format

* ci: add deps check job

* fix: catalog removal issues

* build: update `lock`
  • Loading branch information
ashgw authored Jan 23, 2025
1 parent 52098b4 commit 44fb56c
Show file tree
Hide file tree
Showing 19 changed files with 2,199 additions and 2,355 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
uses: ./.github/workflows/format.yml
secrets: inherit

dependencies-check:
uses: ./.github/workflows/dependencies-check.yml
secrets: inherit

lint:
uses: ./.github/workflows/lint.yml
secrets: inherit
Expand All @@ -54,6 +58,7 @@ jobs:
- test
- secrets-leaks
- build
- dependencies-check
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/dependencies-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on:
workflow_dispatch:
workflow_call:

jobs:
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pnpm-install
- name: check dependencies
# if it errors out, u need to run `pnpm deps:format && pnpm deps:fix` locally before u push
run: pnpm deps:check
66 changes: 66 additions & 0 deletions .syncpackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"dependencyTypes": [
"prod",
"dev"
],
"source": [
"package.json",
"packages/*/package.json",
"apps/*/package.json",
"tooling/*/package.json"
],
"semverGroups": [
{
"label": "use exact versions for production dependencies",
"dependencyTypes": [
"prod"
],
"dependencies": [
"**"
],
"range": ""
},
{
"label": "use caret ranges for development dependencies",
"dependencyTypes": [
"dev"
],
"dependencies": [
"**"
],
"range": "^"
}
],
"versionGroups": [
{
"label": "ensure react packages are in sync",
"dependencies": [
"react",
"react-dom",
"@types/react",
"@types/react-dom"
],
"packages": [
"**"
],
"dependencyTypes": [
"prod",
"dev",
"peer"
],
"pinVersion": "catalog:react18"
}
],
"sortFirst": [
"name",
"version",
"private",
"scripts"
],
"sortAz": [
"dependencies",
"devDependencies",
"peerDependencies",
"scripts"
]
}
94 changes: 47 additions & 47 deletions apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,65 @@
"name": "@ashgw/blog",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "pnpm next build",
"dev": "pnpm next dev",
"build:vercel": "pnpm vercel build --yes",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"deploy:vercel-preview": "pnpm vercel deploy --prebuilt",
"deploy:vercel-prod": "pnpm vercel deploy --prod --prebuilt",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"dev": "pnpm next dev",
"format": "prettier . --write",
"format-check": "prettier --check .",
"lint": "pnpm run lint:ts ",
"lint-all": "pnpm run lint:ts && pnpm run lint:md && pnpm run format && pnpm run lint:knip && pnpm run lint:spelling",
"lint:knip": "knip --production --strict --exclude exports,nsExports,types,nsTypes",
"lint:ts": "tsc --noEmit; eslint .",
"postbuild": "echo 'next-sitemap'",
"start": "pnpm next start",
"test": "pnpm test:unit-integration; pnpm test:e2e",
"test:unit-integration": "vitest run --config=vitest.config.ts",
"test:e2e": "cd test/e2e && npx playwright test",
"lint": "pnpm run lint:ts ",
"lint-all": "pnpm run lint:ts && pnpm run lint:md && pnpm run format && pnpm run lint:knip && pnpm run lint:spelling",
"lint:ts": "tsc --noEmit; eslint .",
"lint:knip": "knip --production --strict --exclude exports,nsExports,types,nsTypes",
"format": "prettier . --write",
"format-check": "prettier --check ."
"test:unit-integration": "vitest run --config=vitest.config.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@ashgw/css": "workspace:*",
"@ashgw/env": "workspace:*",
"@ashgw/ui": "workspace:*",
"@gsap/react": "2.1.0",
"@next/third-parties": "15.0.2",
"@nextui-org/react": "2.2.9",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-separator": "1.0.3",
"@radix-ui/react-slot": "1.1.0",
"class-variance-authority": "0.7.0",
"clsx": "2.1.1",
"framer-motion": "10.17.4",
"front-matter": "4.0.2",
"gsap": "3.12.5",
"loading-points": "1.1.0",
"lucide-react": "0.309.0",
"next": "catalog:",
"next-mdx-remote": "4.4.1",
"next-themes": "0.3.0",
"react": "catalog:react18",
"react-dom": "catalog:react18",
"react-syntax-highlighter": "15.5.0",
"react-use": "17.5.0",
"sass": "1.69.7",
"sharp": "0.33.2",
"sonner": "1.5.0",
"tailwind-merge": "2.5.4",
"tailwindcss-animate": "1.0.7",
"typed.js": "2.1.0"
},
"devDependencies": {
"@ashgw/vitest-config": "workspace:*",
"@ashgw/eslint-config": "workspace:*",
"@ashgw/next-config": "workspace:*",
"@ashgw/playwright-config": "workspace:*",
"@ashgw/prettier-config": "workspace:*",
"@ashgw/tailwind-config": "workspace:*",
"@ashgw/next-config": "workspace:*",
"@ashgw/tsconfig": "workspace:*",
"@ashgw/playwright-config": "workspace:*",
"@ashgw/vitest-config": "workspace:*",
"@playwright/test": "catalog:",
"@tailwindcss/typography": "^0.5.10",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand All @@ -43,7 +71,6 @@
"@types/react-dom": "catalog:react18",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@vitest/ui": "catalog:",
"vitest": "catalog:",
"autoprefixer": "^10.0.1",
"eslint": "catalog:",
"jiti": "catalog:",
Expand All @@ -53,37 +80,10 @@
"ts-node": "^10.9.2",
"ts-roids": "^1.34.0",
"typescript": "catalog:",
"vitest": "catalog:",
"webpack": "^5.96.1"
},
"dependencies": {
"@ashgw/ui": "workspace:*",
"@ashgw/css": "workspace:*",
"@ashgw/env": "workspace:*",
"@gsap/react": "^2.1.0",
"@next/third-parties": "^15.0.2",
"@nextui-org/react": "^2.2.9",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^10.17.4",
"front-matter": "^4.0.2",
"gsap": "^3.12.5",
"loading-points": "^1.1.0",
"lucide-react": "^0.309.0",
"next": "catalog:",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "catalog:react18",
"react-dom": "catalog:react18",
"react-syntax-highlighter": "^15.5.0",
"react-use": "^17.5.0",
"sass": "^1.69.7",
"sharp": "^0.33.2",
"sonner": "^1.3.1",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"typed.js": "^2.1.0"
}
"keywords": [],
"license": "ISC",
"type": "module"
}
11 changes: 9 additions & 2 deletions apps/blog/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
}
}
},
"module": "esnext",
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"]
}
86 changes: 43 additions & 43 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,60 @@
"name": "@ashgw/www",
"version": "1.84.0",
"private": true,
"type": "module",
"scripts": {
"build": "next build",
"build:vercel": "vercel build --yes",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"deploy:vercel-preview": "vercel deploy --prebuilt",
"deploy:vercel-prod": "vercel deploy --prod --prebuilt",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"postbuild": "echo 'next-sitemap'",
"dev": "next dev",
"start": "next start",
"test": "pnpm test:unit-integration; pnpm test:e2e",
"test:unit-integration": "vitest run --config=vitest.config.ts",
"test:e2e": "cd test/e2e && npx playwright test",
"format": "prettier . --write",
"format-check": "prettier --check .",
"lint": "pnpm run lint:ts ",
"lint-all": "pnpm run lint:ts && pnpm run lint:md && pnpm run format && pnpm run lint:knip && pnpm run lint:spelling",
"lint:ts": "tsc --noEmit; eslint .",
"format": "prettier . --write",
"lint:knip": "knip --production --strict --exclude exports,nsExports,types,nsTypes",
"format-check": "prettier --check .",
"lint:md": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"lint:ts": "tsc --noEmit; eslint .",
"postbuild": "echo 'next-sitemap'",
"start": "next start",
"test": "pnpm test:unit-integration; pnpm test:e2e",
"test:e2e": "cd test/e2e && npx playwright test",
"test:unit-integration": "vitest run --config=vitest.config.ts",
"with-env": "dotenv -e ../../.env --"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@ashgw/css": "workspace:*",
"@ashgw/env": "workspace:*",
"@ashgw/ui": "workspace:*",
"@gsap/react": "2.1.0",
"@next/third-parties": "15.0.2",
"@nextui-org/react": "2.2.9",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-separator": "1.0.3",
"@radix-ui/react-slot": "1.1.0",
"class-variance-authority": "0.7.0",
"clsx": "2.1.1",
"framer-motion": "10.17.4",
"front-matter": "4.0.2",
"gsap": "3.12.5",
"loading-points": "1.1.0",
"lucide-react": "0.309.0",
"next": "catalog:",
"next-mdx-remote": "4.4.1",
"next-themes": "0.3.0",
"react": "catalog:react18",
"react-dom": "catalog:react18",
"react-syntax-highlighter": "15.5.0",
"react-use": "17.5.0",
"sass": "1.69.7",
"sharp": "0.33.2",
"sonner": "1.5.0",
"tailwind-merge": "2.5.4",
"tailwindcss-animate": "1.0.7",
"typed.js": "2.1.0"
},
"devDependencies": {
"@ashgw/eslint-config": "workspace:*",
"@ashgw/next-config": "workspace:*",
Expand Down Expand Up @@ -59,35 +87,7 @@
"vitest": "catalog:",
"webpack": "^5.96.1"
},
"dependencies": {
"@ashgw/css": "workspace:*",
"@ashgw/env": "workspace:",
"@ashgw/ui": "workspace:*",
"@gsap/react": "^2.1.0",
"@next/third-parties": "^15.0.2",
"@nextui-org/react": "^2.2.9",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^10.17.4",
"front-matter": "^4.0.2",
"gsap": "^3.12.5",
"loading-points": "^1.1.0",
"lucide-react": "^0.309.0",
"next": "catalog:",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "catalog:react18",
"react-dom": "catalog:react18",
"react-syntax-highlighter": "^15.5.0",
"react-use": "^17.5.0",
"sass": "^1.69.7",
"sharp": "^0.33.2",
"sonner": "^1.3.1",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"typed.js": "^2.1.0"
}
"keywords": [],
"license": "ISC",
"type": "module"
}
11 changes: 9 additions & 2 deletions apps/www/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
}
}
},
"module": "esnext",
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"]
}
Loading

0 comments on commit 44fb56c

Please sign in to comment.