From fd38197b326c0ec5166c9d1dc4ab9021bdc4ad7d Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Sun, 21 Sep 2025 08:22:24 +0200 Subject: [PATCH] Fix prettier configs (#5529) --- .woodpecker/docs.yaml | 28 +++++++++++++------ .woodpecker/static.yaml | 5 +--- .woodpecker/web.yaml | 12 -------- docs/.prettierignore | 7 ++--- .../10-configuration/12-forges/11-overview.md | 2 +- docs/docs/92-development/03-ui.md | 4 +-- docs/package.json | 5 +++- docs/plugins/woodpecker-plugins/src/index.ts | 3 +- .../woodpecker-plugins/src/markdown.ts | 2 +- docs/pnpm-lock.yaml | 3 ++ docs/src/pages/migrations.md | 4 --- .../version-2.8/91-migrations.md | 3 -- .../10-configuration/12-forges/11-overview.md | 2 +- .../10-configuration/12-forges/11-overview.md | 2 +- docs/versioned_docs/version-3.9/40-cli.md | 5 ++-- docs/versions.json | 7 +---- 16 files changed, 40 insertions(+), 54 deletions(-) diff --git a/.woodpecker/docs.yaml b/.woodpecker/docs.yaml index b3b16cf32..c8fc37572 100644 --- a/.woodpecker/docs.yaml +++ b/.woodpecker/docs.yaml @@ -37,15 +37,26 @@ when: evaluate: 'TASK == "docs"' steps: - prettier: - image: docker.io/woodpeckerci/plugin-prettier:next - settings: - version: 3.3.3 - plugins: - - 'prettier-plugin-tailwindcss' - - '@ianvs/prettier-plugin-sort-imports' + install-dependencies: + image: *node_image + directory: docs/ + commands: + - corepack enable + - pnpm install --frozen-lockfile when: - - event: pull_request + - path: *when_path + event: [tag, pull_request, push] + - event: manual + + format-check: + image: *node_image + directory: docs/ + commands: + - corepack enable + - pnpm format:check + when: + - path: *when_path + event: pull_request build-cli: image: *golang_image @@ -61,7 +72,6 @@ steps: directory: docs/ commands: - corepack enable - - pnpm install --frozen-lockfile - pnpm build when: - path: *when_path diff --git a/.woodpecker/static.yaml b/.woodpecker/static.yaml index f59245a05..2ebf3582e 100644 --- a/.woodpecker/static.yaml +++ b/.woodpecker/static.yaml @@ -23,7 +23,4 @@ steps: pull: true depends_on: [] settings: - version: 3.3.3 - plugins: - - 'prettier-plugin-tailwindcss' - - '@ianvs/prettier-plugin-sort-imports' + version: 3.6.2 diff --git a/.woodpecker/web.yaml b/.woodpecker/web.yaml index 6812de3ca..141f4acb6 100644 --- a/.woodpecker/web.yaml +++ b/.woodpecker/web.yaml @@ -24,18 +24,6 @@ steps: - pnpm install --frozen-lockfile when: *when - prettier: - depends_on: - - install-dependencies - image: docker.io/woodpeckerci/plugin-prettier:next - pull: true - settings: - version: 3.3.3 - plugins: - - 'prettier-plugin-tailwindcss' - - '@ianvs/prettier-plugin-sort-imports' - when: *when - lint: depends_on: - install-dependencies diff --git a/docs/.prettierignore b/docs/.prettierignore index 2087370c5..bbf21b139 100644 --- a/docs/.prettierignore +++ b/docs/.prettierignore @@ -1,7 +1,6 @@ pnpm-lock.yaml dist -coverage/ LICENSE -components.d.ts -src/assets/locales/*.json -!src/assets/locales/en.json +openapi.json +docs/40-cli.md +build/ diff --git a/docs/docs/30-administration/10-configuration/12-forges/11-overview.md b/docs/docs/30-administration/10-configuration/12-forges/11-overview.md index ca1c79b6b..e819ea73d 100644 --- a/docs/docs/30-administration/10-configuration/12-forges/11-overview.md +++ b/docs/docs/30-administration/10-configuration/12-forges/11-overview.md @@ -10,6 +10,6 @@ | Event: Release | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | | Event: Deploy¹ | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | | [Multiple workflows](../../../20-usage/25-workflows.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| [when.path filter](../../../20-usage/20-workflow-syntax.md#path) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | +| [when.path filter](../../../20-usage/20-workflow-syntax.md#path) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | ¹ The deployment event can be triggered for all forges from Woodpecker directly. However, only GitHub can trigger them using webhooks. diff --git a/docs/docs/92-development/03-ui.md b/docs/docs/92-development/03-ui.md index 0c1ac3bc6..8186b63f3 100644 --- a/docs/docs/92-development/03-ui.md +++ b/docs/docs/92-development/03-ui.md @@ -15,12 +15,12 @@ After starting the Woodpecker server as explained in the [debugging](./01-gettin ### Usage with remote server - If you would like to test your UI changes on a "real-world" Woodpecker server which probably has more complex data than local test instances, you can run `pnpm start` with these environment variables: +If you would like to test your UI changes on a "real-world" Woodpecker server which probably has more complex data than local test instances, you can run `pnpm start` with these environment variables: - `VITE_DEV_PROXY`: your server URL, for example `https://ci.woodpecker-ci.org` - `VITE_DEV_USER_SESS_COOKIE`: the value `user_sess` cookie in your browser - Then, open the UI at `http://localhost:8010`. +Then, open the UI at `http://localhost:8010`. ## Tools and frameworks diff --git a/docs/package.json b/docs/package.json index d2c23bfaa..d4b9fc47a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,7 +11,9 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" + "write-heading-ids": "docusaurus write-heading-ids", + "format": "prettier --write .", + "format:check": "prettier -c ." }, "dependencies": { "@docusaurus/core": "^3.8.1", @@ -46,6 +48,7 @@ "@types/react": "^19.1.7", "@types/react-helmet": "^6.1.11", "@types/react-router-dom": "^5.3.3", + "prettier": "^3.6.2", "typescript": "^5.8.3" } } diff --git a/docs/plugins/woodpecker-plugins/src/index.ts b/docs/plugins/woodpecker-plugins/src/index.ts index ca4fda205..904973aed 100644 --- a/docs/plugins/woodpecker-plugins/src/index.ts +++ b/docs/plugins/woodpecker-plugins/src/index.ts @@ -4,7 +4,6 @@ import { LoadContext, Plugin, PluginContentLoadedActions } from '@docusaurus/typ import axios, { AxiosError } from 'axios'; import slugify from 'slugify'; - import * as markdown from './markdown'; import { Content, WoodpeckerPlugin, WoodpeckerPluginHeader, WoodpeckerPluginIndexEntry } from './types'; @@ -27,7 +26,7 @@ async function loadContent(): Promise { i.docs, axiosError.message, axiosError.response?.status, - axiosError.response?.statusText + axiosError.response?.statusText, ); return undefined; } diff --git a/docs/plugins/woodpecker-plugins/src/markdown.ts b/docs/plugins/woodpecker-plugins/src/markdown.ts index 9a2cf8514..50a2dbc44 100644 --- a/docs/plugins/woodpecker-plugins/src/markdown.ts +++ b/docs/plugins/woodpecker-plugins/src/markdown.ts @@ -19,7 +19,7 @@ export function getRawHeader(data: string): string { } export async function getContent(data: string): Promise { - const marked = await import('marked') + const marked = await import('marked'); const content = data.replace(regexContent, '').replace(//gm, ''); if (!content) { diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 5eca8bee7..ddeedc670 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -66,6 +66,9 @@ importers: '@types/react-router-dom': specifier: ^5.3.3 version: 5.3.3 + prettier: + specifier: ^3.6.2 + version: 3.6.2 typescript: specifier: ^5.8.3 version: 5.9.2 diff --git a/docs/src/pages/migrations.md b/docs/src/pages/migrations.md index 3c56e8478..10704d30f 100644 --- a/docs/src/pages/migrations.md +++ b/docs/src/pages/migrations.md @@ -116,7 +116,6 @@ The following restructuring was done to achieve a more consistent grouping: Additionally, the description has been updated to reflect that these filters only apply to plugins ([#4069](https://github.com/woodpecker-ci/woodpecker/pull/4069)). - SDK changes: - - The SDK fields `start_time`, `end_time`, `created_at`, `started_at`, `finished_at` and `reviewed_at` have been renamed to `started`, `finished`, `created`, `started`, `finished`, `reviewed` ([#3968](https://github.com/woodpecker-ci/woodpecker/pull/3968)) - The `trusted` field of the repo model was changed from `boolean` to `object` ([#4025](https://github.com/woodpecker-ci/woodpecker/pull/4025)) @@ -279,14 +278,12 @@ Read more about it in [#4213](https://github.com/woodpecker-ci/woodpecker/pull/4 - Dropped support for `DRONE_*` environment variables. The according `WOODPECKER_*` variables must be used instead. Additionally some alternative namings have been removed to simplify maintenance: - - `WOODPECKER_AGENT_SECRET` replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD` and `DRONE_AGENT_SECRET`. - `WOODPECKER_HOST` replaces `DRONE_HOST` and `DRONE_SERVER_HOST`. - `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`. - `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`. - Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables. - - `CI_*` prefix replaces `DRONE_*` - `CI` value is now `woodpecker` - `DRONE=true` has been removed @@ -316,7 +313,6 @@ Read more about it in [#4213](https://github.com/woodpecker-ci/woodpecker/pull/4 - Default workspace base path has moved from `/drone` to `/woodpecker` - Default SQLite database location has changed: - - `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite` - `drone.sqlite` -> `woodpecker.sqlite` diff --git a/docs/versioned_docs/version-2.8/91-migrations.md b/docs/versioned_docs/version-2.8/91-migrations.md index 455f174fd..41b64d118 100644 --- a/docs/versioned_docs/version-2.8/91-migrations.md +++ b/docs/versioned_docs/version-2.8/91-migrations.md @@ -84,14 +84,12 @@ Some versions need some changes to the server configuration or the pipeline conf - Dropped support for `DRONE_*` environment variables. The according `WOODPECKER_*` variables must be used instead. Additionally some alternative namings have been removed to simplify maintenance: - - `WOODPECKER_AGENT_SECRET` replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD` and `DRONE_AGENT_SECRET`. - `WOODPECKER_HOST` replaces `DRONE_HOST` and `DRONE_SERVER_HOST`. - `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`. - `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`. - Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables. - - `CI_*` prefix replaces `DRONE_*` - `CI` value is now `woodpecker` - `DRONE=true` has been removed @@ -121,7 +119,6 @@ Some versions need some changes to the server configuration or the pipeline conf - Default workspace base path has moved from `/drone` to `/woodpecker` - Default SQLite database location has changed: - - `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite` - `drone.sqlite` -> `woodpecker.sqlite` diff --git a/docs/versioned_docs/version-3.8/30-administration/10-configuration/12-forges/11-overview.md b/docs/versioned_docs/version-3.8/30-administration/10-configuration/12-forges/11-overview.md index ca1c79b6b..e819ea73d 100644 --- a/docs/versioned_docs/version-3.8/30-administration/10-configuration/12-forges/11-overview.md +++ b/docs/versioned_docs/version-3.8/30-administration/10-configuration/12-forges/11-overview.md @@ -10,6 +10,6 @@ | Event: Release | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | | Event: Deploy¹ | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | | [Multiple workflows](../../../20-usage/25-workflows.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| [when.path filter](../../../20-usage/20-workflow-syntax.md#path) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | +| [when.path filter](../../../20-usage/20-workflow-syntax.md#path) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | ¹ The deployment event can be triggered for all forges from Woodpecker directly. However, only GitHub can trigger them using webhooks. diff --git a/docs/versioned_docs/version-3.9/30-administration/10-configuration/12-forges/11-overview.md b/docs/versioned_docs/version-3.9/30-administration/10-configuration/12-forges/11-overview.md index ca1c79b6b..e819ea73d 100644 --- a/docs/versioned_docs/version-3.9/30-administration/10-configuration/12-forges/11-overview.md +++ b/docs/versioned_docs/version-3.9/30-administration/10-configuration/12-forges/11-overview.md @@ -10,6 +10,6 @@ | Event: Release | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | | Event: Deploy¹ | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | | [Multiple workflows](../../../20-usage/25-workflows.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| [when.path filter](../../../20-usage/20-workflow-syntax.md#path) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | +| [when.path filter](../../../20-usage/20-workflow-syntax.md#path) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | ¹ The deployment event can be triggered for all forges from Woodpecker directly. However, only GitHub can trigger them using webhooks. diff --git a/docs/versioned_docs/version-3.9/40-cli.md b/docs/versioned_docs/version-3.9/40-cli.md index 4da10c727..9bae357b4 100644 --- a/docs/versioned_docs/version-3.9/40-cli.md +++ b/docs/versioned_docs/version-3.9/40-cli.md @@ -56,7 +56,6 @@ woodpecker-cli [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...] **--token, -t**="": server auth token - # COMMANDS ## admin @@ -404,9 +403,9 @@ execute a local pipeline **--workflow-number**="": Set the metadata environment variable "CI_WORKFLOW_NUMBER". (default: 0) -**--workspace-base**="": (default: /woodpecker) +**--workspace-base**="": (default: /woodpecker) -**--workspace-path**="": (default: src) +**--workspace-path**="": (default: src) ## info diff --git a/docs/versions.json b/docs/versions.json index d3c27af73..27e7370e7 100644 --- a/docs/versions.json +++ b/docs/versions.json @@ -1,6 +1 @@ -[ - "3.9", - "3.8", - "3.7", - "2.8" -] +["3.9", "3.8", "3.7", "2.8"]