Fix copyfiles step so storybook serves correctly (#1299)

confirmed this still works on Windows
This commit is contained in:
Evan Simkowitz 2024-11-15 13:19:20 -08:00 committed by GitHub
parent 3b117805fe
commit 4a330a4842
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 8 deletions

View File

@ -63,12 +63,13 @@ tasks:
desc: Build the full docsite.
cmds:
- cd docs && yarn build
- task: copyfiles:'storybook-static/':'docs/build/storybook'
- task: copyfiles:'storybook-static':'docs/build/storybook'
sources:
- "docs/*"
- "docs/src/**/*"
- "docs/docs/**/*"
- "docs/static/**/*"
- storybook-static/**/*
generates:
- "docs/build/**/*"
deps:
@ -86,7 +87,7 @@ tasks:
- "docsite/**/*"
cmds:
- cd docs && yarn build-embedded
- task: copyfiles:'docs/build/':'../docsite'
- task: copyfiles:'docs/build':'../docsite'
deps:
- yarn
@ -322,8 +323,6 @@ tasks:
cmd: go mod tidy
copyfiles:*:*:
desc: Recursively copy directory contents to a new directory, creating the directory if needed.
desc: Recursively copy directory and its contents.
internal: true
cmds:
- '{{if eq OS "windows"}}powershell New-Item -Path "." -Force -Name "{{index .MATCH 1}}" -ItemType "directory"{{else}}mkdir -p {{index .MATCH 1}}{{end}}'
- '{{if eq OS "windows"}}powershell Copy-Item -Recurse -Force -Path {{index .MATCH 0}} -Destination {{index .MATCH 1}}{{else}}cp -r {{index .MATCH 0}} {{index .MATCH 1}}{{end}}'
cmd: '{{if eq OS "windows"}}powershell Copy-Item -Recurse -Force -Path {{index .MATCH 0}} -Destination {{index .MATCH 1}}{{else}}cp -r {{index .MATCH 0}} {{index .MATCH 1}}{{end}}'

View File

@ -93,7 +93,7 @@ const config: Config = {
? [
{
position: "left",
href: "https://docs.waveterm.dev/storybook/",
href: "https://docs.waveterm.dev/storybook",
label: "Storybook",
},
{
@ -174,7 +174,7 @@ const config: Config = {
},
].filter((v) => v),
stylesheets: [`${baseUrl}fontawesome/css/fontawesome.min.css`, `${baseUrl}fontawesome/css/sharp-regular.min.css`],
staticDirectories: ["static"],
staticDirectories: ["static", "storybook"],
};
export default config;