mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-15 02:45:14 +00:00
Fix syntax for dynamic docs versioning (#4708)
This commit is contained in:
parent
e13fee1733
commit
3e295f7f71
4 changed files with 42 additions and 12 deletions
|
@ -1,9 +1,6 @@
|
|||
import { readFile } from 'node:fs/promises';
|
||||
const config = require('../.prettierrc.json');
|
||||
|
||||
// eslint-disable-next-line antfu/no-top-level-await
|
||||
const config = JSON.parse(await readFile(new URL('../.prettierrc.json', import.meta.url)));
|
||||
|
||||
export default {
|
||||
module.exports = {
|
||||
...config,
|
||||
plugins: ['@ianvs/prettier-plugin-sort-imports'],
|
||||
importOrder: [
|
||||
|
|
|
@ -1,19 +1,21 @@
|
|||
import * as path from 'path';
|
||||
import type { VersionBanner, VersionOptions } from '@docusaurus/plugin-content-docs';
|
||||
import type * as Preset from '@docusaurus/preset-classic';
|
||||
import type { Config } from '@docusaurus/types';
|
||||
import { themes } from 'prism-react-renderer';
|
||||
import * as versions from './versions.json';
|
||||
|
||||
const docsVersions = {
|
||||
import versions from './versions.json';
|
||||
|
||||
const docsVersions: { [version: string]: VersionOptions } = {
|
||||
current: {
|
||||
label: 'Next 🚧',
|
||||
banner: 'unreleased',
|
||||
banner: 'unreleased' as VersionBanner,
|
||||
},
|
||||
};
|
||||
|
||||
const includeVersions = ['current', versions.default[0]];
|
||||
const includeVersions = ['current', versions[0]];
|
||||
|
||||
versions.default.forEach((v, index) => {
|
||||
versions.forEach((v, index) => {
|
||||
const version = {
|
||||
label: `${v}.x${index === 0 ? '' : ' 💀'}`,
|
||||
};
|
||||
|
@ -257,7 +259,7 @@ const config = {
|
|||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
editUrl: 'https://github.com/woodpecker-ci/woodpecker/edit/main/docs/',
|
||||
includeCurrentVersion: true,
|
||||
lastVersion: versions.default[0],
|
||||
lastVersion: versions[0],
|
||||
onlyIncludeVersions: includeVersions,
|
||||
versions: docsVersions,
|
||||
},
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"@docusaurus/module-type-aliases": "^3.7.0",
|
||||
"@docusaurus/tsconfig": "3.7.0",
|
||||
"@docusaurus/types": "^3.7.0",
|
||||
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
|
||||
"@types/node": "^22.10.5",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-helmet": "^6.1.11",
|
||||
|
|
|
@ -48,6 +48,9 @@ importers:
|
|||
'@docusaurus/types':
|
||||
specifier: ^3.7.0
|
||||
version: 3.7.0(@swc/core@1.10.4)(acorn@8.14.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||
'@ianvs/prettier-plugin-sort-imports':
|
||||
specifier: ^4.4.0
|
||||
version: 4.4.0(prettier@3.4.2)
|
||||
'@types/node':
|
||||
specifier: ^22.10.5
|
||||
version: 22.10.5
|
||||
|
@ -1254,6 +1257,15 @@ packages:
|
|||
'@hapi/topo@5.1.0':
|
||||
resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==}
|
||||
|
||||
'@ianvs/prettier-plugin-sort-imports@4.4.0':
|
||||
resolution: {integrity: sha512-f4/e+/ANGk3tHuwRW0uh2YuBR50I4h1ZjGQ+5uD8sWfinHTivQsnieR5cz24t8M6Vx4rYvZ5v/IEKZhYpzQm9Q==}
|
||||
peerDependencies:
|
||||
'@vue/compiler-sfc': 2.7.x || 3.x
|
||||
prettier: 2 || 3
|
||||
peerDependenciesMeta:
|
||||
'@vue/compiler-sfc':
|
||||
optional: true
|
||||
|
||||
'@jest/schemas@29.6.3':
|
||||
resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}
|
||||
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
|
||||
|
@ -5058,6 +5070,11 @@ packages:
|
|||
resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
prettier@3.4.2:
|
||||
resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==}
|
||||
engines: {node: '>=14'}
|
||||
hasBin: true
|
||||
|
||||
pretty-error@4.0.0:
|
||||
resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==}
|
||||
|
||||
|
@ -7981,7 +7998,7 @@ snapshots:
|
|||
|
||||
'@docusaurus/react-loadable@6.0.0(react@19.0.0)':
|
||||
dependencies:
|
||||
'@types/react': 18.3.18
|
||||
'@types/react': 19.0.4
|
||||
react: 19.0.0
|
||||
|
||||
'@docusaurus/theme-classic@3.7.0(@docusaurus/faster@3.7.0(@docusaurus/types@3.7.0(@swc/core@1.10.4)(acorn@8.14.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)))(@swc/core@1.10.4)(@types/react@19.0.4)(acorn@8.14.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3)':
|
||||
|
@ -8277,6 +8294,17 @@ snapshots:
|
|||
dependencies:
|
||||
'@hapi/hoek': 9.3.0
|
||||
|
||||
'@ianvs/prettier-plugin-sort-imports@4.4.0(prettier@3.4.2)':
|
||||
dependencies:
|
||||
'@babel/generator': 7.26.3
|
||||
'@babel/parser': 7.26.3
|
||||
'@babel/traverse': 7.26.4
|
||||
'@babel/types': 7.26.3
|
||||
prettier: 3.4.2
|
||||
semver: 7.6.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@jest/schemas@29.6.3':
|
||||
dependencies:
|
||||
'@sinclair/typebox': 0.27.8
|
||||
|
@ -12706,6 +12734,8 @@ snapshots:
|
|||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
prettier@3.4.2: {}
|
||||
|
||||
pretty-error@4.0.0:
|
||||
dependencies:
|
||||
lodash: 4.17.21
|
||||
|
|
Loading…
Reference in a new issue