mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 21:16:21 +00:00
make ci also run on windows, re-add css minification
This commit is contained in:
parent
9a0f20012a
commit
429f331c21
3 changed files with 18 additions and 7 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
@ -7,7 +7,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: [windows-latest, macos-13, ubuntu-22.04]
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { intro, isCancel, outro, select, text } from "@clack/prompts"
|
||||||
import { rimraf } from "rimraf"
|
import { rimraf } from "rimraf"
|
||||||
import prettyBytes from "pretty-bytes"
|
import prettyBytes from "pretty-bytes"
|
||||||
import { spawnSync } from "child_process"
|
import { spawnSync } from "child_process"
|
||||||
import { transform } from "lightningcss"
|
import { transform as cssTransform } from "lightningcss"
|
||||||
|
|
||||||
const UPSTREAM_NAME = "upstream"
|
const UPSTREAM_NAME = "upstream"
|
||||||
const QUARTZ_SOURCE_BRANCH = "v4-alpha"
|
const QUARTZ_SOURCE_BRANCH = "v4-alpha"
|
||||||
|
@ -115,6 +115,7 @@ async function stashContentFolder(contentFolder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function popContentFolder(contentFolder) {
|
async function popContentFolder(contentFolder) {
|
||||||
|
await fs.promises.rm(contentFolder, { force: true, recursive: true })
|
||||||
await fs.promises.cp(contentCacheFolder, contentFolder, {
|
await fs.promises.cp(contentCacheFolder, contentFolder, {
|
||||||
force: true,
|
force: true,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
|
@ -304,6 +305,14 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started.
|
||||||
sassPlugin({
|
sassPlugin({
|
||||||
type: "css-text",
|
type: "css-text",
|
||||||
cssImports: true,
|
cssImports: true,
|
||||||
|
async transform(css) {
|
||||||
|
const { code } = cssTransform({
|
||||||
|
filename: "style.css",
|
||||||
|
code: Buffer.from(css),
|
||||||
|
minify: true,
|
||||||
|
})
|
||||||
|
return code.toString()
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: "inline-script-loader",
|
name: "inline-script-loader",
|
||||||
|
|
|
@ -42,11 +42,13 @@ async function buildQuartz(argv: Argv, version: string) {
|
||||||
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)
|
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)
|
||||||
|
|
||||||
perf.addEvent("glob")
|
perf.addEvent("glob")
|
||||||
const fps = (await globby("**/*.md", {
|
const fps = (
|
||||||
cwd: argv.directory,
|
await globby("**/*.md", {
|
||||||
ignore: cfg.configuration.ignorePatterns,
|
cwd: argv.directory,
|
||||||
gitignore: true,
|
ignore: cfg.configuration.ignorePatterns,
|
||||||
})).map(fp => fp.split(path.sep).join(path.posix.sep))
|
gitignore: true,
|
||||||
|
})
|
||||||
|
).map((fp) => fp.split(path.sep).join(path.posix.sep))
|
||||||
console.log(
|
console.log(
|
||||||
`Found ${fps.length} input files from \`${argv.directory}\` in ${perf.timeSince("glob")}`,
|
`Found ${fps.length} input files from \`${argv.directory}\` in ${perf.timeSince("glob")}`,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue