diff --git a/.gitpod.yml b/.gitpod.yml index b99e67542..8eeda234e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -117,4 +117,5 @@ vscode: - 'redhat.vscode-yaml' - 'davidanson.vscode-markdownlint' - 'streetsidesoftware.code-spell-checker' + - 'stivo.tailwind-fold' # cSpell:enable diff --git a/.vscode/extensions.json b/.vscode/extensions.json index fba35f380..d9312886c 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,7 +8,8 @@ "voorjaar.windicss-intellisense", "Vue.volar", "redhat.vscode-yaml", - "davidanson.vscode-markdownlint" + "davidanson.vscode-markdownlint", + "stivo.tailwind-fold" ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] diff --git a/.woodpecker/docs.yaml b/.woodpecker/docs.yaml index 9bb85833b..583560aca 100644 --- a/.woodpecker/docs.yaml +++ b/.woodpecker/docs.yaml @@ -38,9 +38,12 @@ when: steps: prettier: - image: docker.io/woodpeckerci/plugin-prettier:1.0.0 + image: docker.io/woodpeckerci/plugin-prettier:next settings: version: 3.3.3 + plugins: + - 'prettier-plugin-tailwindcss' + - '@ianvs/prettier-plugin-sort-imports' when: - event: pull_request diff --git a/.woodpecker/static.yaml b/.woodpecker/static.yaml index 22b6cf064..3918b864f 100644 --- a/.woodpecker/static.yaml +++ b/.woodpecker/static.yaml @@ -19,7 +19,11 @@ steps: - tree --gitignore -I 012_columns_rename_procs_to_steps.go -I versioned_docs -I '*opensource.svg'| pnpx cspell lint --no-progress stdin - name: prettier - image: docker.io/woodpeckerci/plugin-prettier:1.0.0 + image: docker.io/woodpeckerci/plugin-prettier:next + pull: true depends_on: [] settings: version: 3.3.3 + plugins: + - 'prettier-plugin-tailwindcss' + - '@ianvs/prettier-plugin-sort-imports' diff --git a/.woodpecker/web.yaml b/.woodpecker/web.yaml index 141f4acb6..6812de3ca 100644 --- a/.woodpecker/web.yaml +++ b/.woodpecker/web.yaml @@ -24,6 +24,18 @@ 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/docs/92-development/03-ui.md b/docs/docs/92-development/03-ui.md index 6a01584c2..1416c5e4a 100644 --- a/docs/docs/92-development/03-ui.md +++ b/docs/docs/92-development/03-ui.md @@ -24,6 +24,7 @@ The following list contains some tools and frameworks used by the Woodpecker UI. - [Windicss](https://windicss.org/) (similar to Tailwind) - use Windicss classes where possible - if needed extend the Windicss config to use new classes + - classes are sorted following the [prettier tailwind sort plugin](https://tailwindcss.com/blog/automatic-class-sorting-with-prettier) - [Vite](https://vitejs.dev/) (similar to Webpack) - [Typescript](https://www.typescriptlang.org/) - avoid using `any` and `unknown` (the linter will prevent you from doing so anyways :wink:) diff --git a/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPlugin.tsx b/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPlugin.tsx index 5826ccb94..0aeaa86b1 100644 --- a/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPlugin.tsx +++ b/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPlugin.tsx @@ -7,7 +7,7 @@ import { IconContainer, IconPlugin, IconVerified, IconWebsite } from './Icons'; export function WoodpeckerPlugin({ plugin }: { plugin: WoodpeckerPluginType }) { return ( -
+
diff --git a/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPluginList.tsx b/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPluginList.tsx index e80e32b59..266236f7e 100644 --- a/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPluginList.tsx +++ b/docs/plugins/woodpecker-plugins/src/theme/WoodpeckerPluginList.tsx @@ -52,7 +52,7 @@ export function WoodpeckerPluginList({ plugins }: { plugins: WoodpeckerPlugin[] return ( -
+

Woodpecker CI plugins

diff --git a/web/.prettierrc.js b/web/.prettierrc.js index 1fb217ea6..51832a96e 100644 --- a/web/.prettierrc.js +++ b/web/.prettierrc.js @@ -5,7 +5,7 @@ const config = JSON.parse(await readFile(new URL('../.prettierrc.json', import.m export default { ...config, - plugins: ['@ianvs/prettier-plugin-sort-imports'], + plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss'], importOrder: [ '', // Imports not matched by other special words or groups. '', // Empty string will match any import not matched by other special words or groups. diff --git a/web/package.json b/web/package.json index 9bd4e7a92..343df48ed 100644 --- a/web/package.json +++ b/web/package.json @@ -29,6 +29,7 @@ "marked": "^15.0.4", "node-emoji": "^2.2.0", "pinia": "^2.3.0", + "prettier-plugin-tailwindcss": "^0.6.9", "prismjs": "^1.29.0", "semver": "^7.6.3", "simple-icons": "^14.0.0", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 7e6a89d06..9c5e6f011 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -44,6 +44,9 @@ importers: pinia: specifier: ^2.3.0 version: 2.3.0(typescript@5.7.2)(vue@3.5.13(typescript@5.7.2)) + prettier-plugin-tailwindcss: + specifier: ^0.6.9 + version: 0.6.9(@ianvs/prettier-plugin-sort-imports@4.4.0(@vue/compiler-sfc@3.5.13)(prettier@3.4.2))(prettier@3.4.2) prismjs: specifier: ^1.29.0 version: 1.29.0 @@ -2361,6 +2364,61 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier-plugin-tailwindcss@0.6.9: + resolution: {integrity: sha512-r0i3uhaZAXYP0At5xGfJH876W3HHGHDp+LCRUJrs57PBeQ6mYHMwr25KH8NPX44F2yGTvdnH7OqCshlQx183Eg==} + engines: {node: '>=14.21.3'} + peerDependencies: + '@ianvs/prettier-plugin-sort-imports': '*' + '@prettier/plugin-pug': '*' + '@shopify/prettier-plugin-liquid': '*' + '@trivago/prettier-plugin-sort-imports': '*' + '@zackad/prettier-plugin-twig-melody': '*' + prettier: ^3.0 + prettier-plugin-astro: '*' + prettier-plugin-css-order: '*' + prettier-plugin-import-sort: '*' + prettier-plugin-jsdoc: '*' + prettier-plugin-marko: '*' + prettier-plugin-multiline-arrays: '*' + prettier-plugin-organize-attributes: '*' + prettier-plugin-organize-imports: '*' + prettier-plugin-sort-imports: '*' + prettier-plugin-style-order: '*' + prettier-plugin-svelte: '*' + peerDependenciesMeta: + '@ianvs/prettier-plugin-sort-imports': + optional: true + '@prettier/plugin-pug': + optional: true + '@shopify/prettier-plugin-liquid': + optional: true + '@trivago/prettier-plugin-sort-imports': + optional: true + '@zackad/prettier-plugin-twig-melody': + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-multiline-arrays: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-sort-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + prettier@3.4.2: resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} engines: {node: '>=14'} @@ -5404,6 +5462,12 @@ snapshots: prelude-ls@1.2.1: {} + prettier-plugin-tailwindcss@0.6.9(@ianvs/prettier-plugin-sort-imports@4.4.0(@vue/compiler-sfc@3.5.13)(prettier@3.4.2))(prettier@3.4.2): + dependencies: + prettier: 3.4.2 + optionalDependencies: + '@ianvs/prettier-plugin-sort-imports': 4.4.0(@vue/compiler-sfc@3.5.13)(prettier@3.4.2) + prettier@3.4.2: {} prismjs@1.29.0: {} diff --git a/web/src/App.vue b/web/src/App.vue index 98e0ffb41..a516cbca6 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,14 +1,14 @@