Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Feb 29, 2024
1 parent ca91c47 commit 8593a0c
Show file tree
Hide file tree
Showing 40 changed files with 1,494 additions and 1,028 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ lib-cov
logs
node_modules
temp
docs/.vitepress/cache
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.experimental.useFlatConfig": true
"eslint.experimental.useFlatConfig": true,
"yaml.schemas": {
"./schema/config.schema.json": "/config.yaml"
}
}
1 change: 0 additions & 1 deletion doc/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions doc/package.json

This file was deleted.

4 changes: 1 addition & 3 deletions doc/docs/.vitepress/config.js → docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import cwpkgjson from "../../../package.json";

export default {
title: "ClientWorker",
description: "一个基于规则的前端路由拦截器",
Expand All @@ -26,7 +24,7 @@ export default {
[
"script",
{
src: `https://npmm/clientworker@${cwpkgjson.version}/dist/autoupdate.js`,
src: "/autoupdate.js",
},
],
],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion static/autoupdate.js → docs/public/autoupdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
}
async function updateConfig() {
await fetch("/cw-cgi/api?type=config")
await fetch("/cw-cgi/api/config")
.then((res) => res.text())
.then((res) => {
if (res === "ok") {
Expand Down
File renamed without changes.
58 changes: 58 additions & 0 deletions docs/public/cw.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { so1ve } = require("@so1ve/eslint-config");
import { so1ve } from "@so1ve/eslint-config";

module.exports = so1ve({
export default so1ve({
yaml: {
overrides: {
"yaml/no-empty-key": "off",
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@
"access": "public"
},
"scripts": {
"build": "rimraf dist && tsup && nr build:minify",
"build": "rimraf dist && tsup && nr build:minify && nr copy-cw",
"build:minify": "tsup --minify",
"build:schema": "tsx scripts/build-schema.ts",
"copy-cw": "rm ./docs/public/cw.js && cp ./dist/with-yaml.min.js ./docs/public/cw.js",
"docs:build": "vitepress build docs",
"docs:dev": "vitepress dev docs --host 0.0.0.0",
"docs:serve": "vitepress serve docs",
"lint": "eslint . && prettier . --check",
"lint:fix": "eslint . --fix && prettier . --write",
"prepublishOnly": "nr build",
Expand All @@ -62,8 +66,8 @@
},
"devDependencies": {
"@antfu/ni": "^0.21.8",
"@so1ve/eslint-config": "^1.4.0",
"@so1ve/prettier-config": "^1.4.0",
"@so1ve/eslint-config": "^1.5.2",
"@so1ve/prettier-config": "^1.5.2",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.8.3",
"bumpp": "^9.2.0",
Expand All @@ -75,9 +79,9 @@
"ts-json-schema-generator": "^1.5.0",
"tsup": "^8.0.2",
"tsx": "^3.13.0",
"type-fest": "^4.10.3",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vitepress": "1.0.0-rc.44",
"vitest": "^0.34.6"
}
}
Loading

0 comments on commit 8593a0c

Please sign in to comment.