Skip to content

Commit

Permalink
ci: add publint to check on package json and avoid mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthprost committed Oct 23, 2024
1 parent 1ade043 commit bc4e1db
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 12 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ jobs:
- run: |
pnpm install
pnpm exec manypkg check
publint:
runs-on: ubuntu-24.04
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: true
steps:
- uses: actions/checkout@v4
- uses: pnpm/[email protected]
- name: Use Node.js
uses: actions/[email protected]
with:
node-version: 20
cache: "pnpm"
- run: |
pnpm install
pnpm publint
typecheck:
runs-on: ubuntu-24.04
env:
Expand Down Expand Up @@ -82,7 +98,7 @@ jobs:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: true
needs: [typecheck, format]
needs: [publint, typecheck, format]
strategy:
matrix:
node: ["20"]
Expand Down Expand Up @@ -129,7 +145,7 @@ jobs:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: true
needs: [typecheck, format]
needs: [publint, typecheck, format]
steps:
- uses: actions/checkout@v4 # v4.1.4
- uses: pnpm/[email protected]
Expand All @@ -148,7 +164,7 @@ jobs:
DEPLOYMENT_NAME: "storybook"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: true
needs: [typecheck, build]
needs: [publint, typecheck, build]
steps:
- uses: actions/checkout@v4
- name: Inject slug/short variables
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"release": "pnpm build && pnpm changeset publish",
"svg": "npx svgo --pretty --multipass",
"svg:all": "pnpm run svg -r -f .",
"illustrations:update": "BUCKET_NAME=ultraviolet BUCKET_REGION=fr-par node utils/illustrations/uploadIllustrations.js && pnpm format packages/illustrations/src/"
"illustrations:update": "BUCKET_NAME=ultraviolet BUCKET_REGION=fr-par node utils/illustrations/uploadIllustrations.js && pnpm format packages/illustrations/src/",
"publint": "turbo publint"
},
"lint-staged": {
"*.(j|t|mj)s?(x)": [
Expand Down
3 changes: 2 additions & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"type:generate": "tsc --declaration -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"watch:build": "vite build --config vite.config.ts --watch",
"watch": "pnpm run '/^watch:.*/'"
"watch": "pnpm run '/^watch:.*/'",
"publint": "npx publint"
},
"keywords": [
"react",
Expand Down
3 changes: 2 additions & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"build": "vite build --config vite.config.ts && pnpm run type:generate",
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts",
"typecheck": "tsc --noEmit",
"size": "size-limit"
"size": "size-limit",
"publint": "npx publint"
},
"keywords": [
"react",
Expand Down
5 changes: 3 additions & 2 deletions packages/illustrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"typecheck": "tsc --noEmit",
"size": "size-limit",
"test:unit": "LC_ALL=en_US.UTF-8 pnpm vitest --run --config vite.config.ts",
"test:unit:coverage": "pnpm test:unit --coverage"
"test:unit:coverage": "pnpm test:unit --coverage",
"publint": "npx publint"
},
"keywords": [
"illustrations",
Expand Down Expand Up @@ -68,7 +69,7 @@
"./various": {
"types": "./dist/assets/various/index.d.ts",
"require": "./dist/assets/various/index.cjs",
"default": "./dist/various/index.js"
"default": "./dist/assets/various/index.js"
},
"./components": {
"types": "./dist/components/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/plus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"typecheck": "tsc --noEmit",
"size": "size-limit",
"test:unit": "LC_ALL=en_US.UTF-8 pnpm vitest --run --config vite.config.ts",
"test:unit:coverage": "pnpm test:unit --coverage"
"test:unit:coverage": "pnpm test:unit --coverage",
"publint": "npx publint"
},
"keywords": [
"react",
Expand Down
5 changes: 3 additions & 2 deletions packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"watch:build": "vite build --config vite.config.ts --watch",
"build": "vite build --config vite.config.ts && pnpm run type:generate",
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"publint": "npx publint"
},
"keywords": [
"themes",
Expand All @@ -41,13 +42,13 @@
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"exports": {
"./*.css": "./dist/style/*.css",
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"./*.css": "./dist/style/*.css",
"./console/*": {
"types": "./dist/themes/console/*/index.d.ts",
"require": "./dist/themes/console/*/index.cjs",
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"typecheck": "tsc --noEmit",
"size": "size-limit",
"test:unit": "LC_ALL=en_US.UTF-8 pnpm vitest --run --config vite.config.ts",
"test:unit:coverage": "pnpm test:unit --coverage"
"test:unit:coverage": "pnpm test:unit --coverage",
"publint": "npx publint"
},
"keywords": [
"react",
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"storybook-static/**"
]
},
"publint": {
"dependsOn": []
},
"size": {
"dependsOn": ["build"]
},
Expand Down

0 comments on commit bc4e1db

Please sign in to comment.