From fc3287f6ace89c320181e8e5b01a1a3e3267e730 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 23 Oct 2024 11:22:53 +0200 Subject: [PATCH] ci: add publint to check on package json and avoid mistakes --- .github/workflows/ci.yml | 20 +++++++++++++++++++- package.json | 3 ++- packages/form/package.json | 3 ++- packages/icons/package.json | 3 ++- packages/illustrations/package.json | 5 +++-- packages/plus/package.json | 3 ++- packages/themes/package.json | 5 +++-- packages/ui/package.json | 3 ++- turbo.json | 3 +++ 9 files changed, 38 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f46b5ecfd2..ff370ec02a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,6 +141,24 @@ jobs: pnpm install pnpm run build + publint: + runs-on: ubuntu-24.04 + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_REMOTE_ONLY: true + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4.0.0 + - name: Use Node.js + uses: actions/setup-node@v4.0.4 + with: + node-version: 20 + cache: "pnpm" + - run: | + pnpm install + pnpm build + pnpm publint + deploy: runs-on: ubuntu-24.04 env: @@ -148,7 +166,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 diff --git a/package.json b/package.json index c99648149c..8296458359 100644 --- a/package.json +++ b/package.json @@ -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)": [ diff --git a/packages/form/package.json b/packages/form/package.json index 66bbc8d0d4..e35304ba15 100644 --- a/packages/form/package.json +++ b/packages/form/package.json @@ -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": "pnpm dlx publint" }, "keywords": [ "react", diff --git a/packages/icons/package.json b/packages/icons/package.json index e7a560843c..213d94e9e5 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -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": "pnpm dlx publint" }, "keywords": [ "react", diff --git a/packages/illustrations/package.json b/packages/illustrations/package.json index 11614e51fc..6dfbddcee8 100644 --- a/packages/illustrations/package.json +++ b/packages/illustrations/package.json @@ -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": "pnpm dlx publint" }, "keywords": [ "illustrations", @@ -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", diff --git a/packages/plus/package.json b/packages/plus/package.json index 245b1f6a11..4414e29e77 100644 --- a/packages/plus/package.json +++ b/packages/plus/package.json @@ -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": "pnpm dlx publint" }, "keywords": [ "react", diff --git a/packages/themes/package.json b/packages/themes/package.json index 6b54dd6e58..bad2827044 100644 --- a/packages/themes/package.json +++ b/packages/themes/package.json @@ -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": "pnpm dlx publint" }, "keywords": [ "themes", @@ -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", diff --git a/packages/ui/package.json b/packages/ui/package.json index ea328616cc..d183b94a7c 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -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": "pnpm dlx publint" }, "keywords": [ "react", diff --git a/turbo.json b/turbo.json index d6adc47145..b9596c811f 100644 --- a/turbo.json +++ b/turbo.json @@ -29,6 +29,9 @@ "storybook-static/**" ] }, + "publint": { + "dependsOn": [] + }, "size": { "dependsOn": ["build"] },