tona-vite 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/index.cjs +94 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +27 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +69 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +62 -0
- package/public/css/atom-one-dark.css +96 -0
- package/public/css/atom-one-light.css +96 -0
- package/public/css/blog-common.min.css +5049 -0
- package/public/css/font-awesome-5.css +4586 -0
- package/public/css/mobile-common.min.css +226 -0
- package/public/images/1-20210309211744338-647771178.jpg +0 -0
- package/public/images/20.png +0 -0
- package/public/images/avatar-default.svg +1 -0
- package/public/images/bannerbar-aws-bg.png +0 -0
- package/public/images/cnblogs.png +0 -0
- package/public/images/default-avatar.png +0 -0
- package/public/images/downdown.gif +0 -0
- package/public/images/favicon.png +0 -0
- package/public/images/icon_addcomment.gif +0 -0
- package/public/images/icon_form.gif +0 -0
- package/public/images/icon_voice.gif +0 -0
- package/public/images/icon_weibo_24.png +0 -0
- package/public/images/lite-mode-check.svg +1 -0
- package/public/images/logo.gif +0 -0
- package/public/images/logo.svg +1 -0
- package/public/images/message.svg +4 -0
- package/public/images/myblog.svg +4 -0
- package/public/images/newpost.svg +4 -0
- package/public/images/search.svg +1 -0
- package/public/images/upup.gif +0 -0
- package/public/images/wechat.png +0 -0
- package/public/index.html +168 -0
- package/public/js/blog.common.min.js +15934 -0
- package/public/js/highlight.min.js +1488 -0
- package/public/js/highlightjs-line-numbers.min.js +134 -0
- package/public/js/jquery.min.js +4119 -0
- package/public/js/mockAPI.js +3 -0
- package/public/templates/catalog.html +842 -0
- package/public/templates/category.html +903 -0
- package/public/templates/home.html +962 -0
- package/public/templates/photos.html +898 -0
- package/public/templates/photoview.html +814 -0
- package/public/templates/post-markdown.html +2722 -0
- package/public/templates/post-tinymce.html +1891 -0
- package/public/templates/post-tinymce5.html +2304 -0
- package/public/templates/postarchive.html +1127 -0
- package/public/templates/tags.html +2281 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# vite-plugin-tona
|
|
2
|
+
|
|
3
|
+
Vite plugin for Tona themes - combines dynamic script extension and shared assets serving.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install tona-vite
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import tona from 'tona-vite'
|
|
15
|
+
import { defineConfig } from 'vite'
|
|
16
|
+
|
|
17
|
+
export default defineConfig({
|
|
18
|
+
plugins: [
|
|
19
|
+
tona()
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- Automatically detects main.ts or main.js files and replaces script src in HTML
|
|
27
|
+
- Serves shared assets from public directory during development
|
|
28
|
+
- Works in both development and build modes
|
|
29
|
+
|
|
30
|
+
## Options
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
interface TonaPluginOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Default script source path when neither main.ts nor main.js exists
|
|
36
|
+
* @default '/src/main.js'
|
|
37
|
+
*/
|
|
38
|
+
defaultScriptSrc?: string
|
|
39
|
+
/**
|
|
40
|
+
* Base directory to resolve main files from
|
|
41
|
+
* @default process.cwd()
|
|
42
|
+
*/
|
|
43
|
+
baseDir?: string
|
|
44
|
+
/**
|
|
45
|
+
* The path to the shared assets directory
|
|
46
|
+
* @default path.join(__dirname, '..', 'public')
|
|
47
|
+
*/
|
|
48
|
+
sharedAssetsPath?: string
|
|
49
|
+
}
|
|
50
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
let node_fs = require("node:fs");
|
|
25
|
+
node_fs = __toESM(node_fs);
|
|
26
|
+
let node_path = require("node:path");
|
|
27
|
+
node_path = __toESM(node_path);
|
|
28
|
+
let node_process = require("node:process");
|
|
29
|
+
node_process = __toESM(node_process);
|
|
30
|
+
let node_url = require("node:url");
|
|
31
|
+
|
|
32
|
+
//#region src/index.ts
|
|
33
|
+
const __dirname$1 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
34
|
+
/**
|
|
35
|
+
* Vite plugin for Tona themes - combines dynamic script extension and shared assets serving
|
|
36
|
+
*/
|
|
37
|
+
function tona(options = {}) {
|
|
38
|
+
const { defaultScriptSrc = "/src/main.js", baseDir = node_process.default.cwd(), sharedAssetsPath } = options;
|
|
39
|
+
const assetsPath = sharedAssetsPath || node_path.default.join(__dirname$1, "..", "public");
|
|
40
|
+
return {
|
|
41
|
+
name: "vite-plugin-tona",
|
|
42
|
+
transformIndexHtml(html) {
|
|
43
|
+
const jsPath = node_path.default.resolve(baseDir, "src/main.js");
|
|
44
|
+
const tsPath = node_path.default.resolve(baseDir, "src/main.ts");
|
|
45
|
+
let scriptSrc = defaultScriptSrc;
|
|
46
|
+
if (node_fs.default.existsSync(tsPath)) scriptSrc = "/src/main.ts";
|
|
47
|
+
else if (node_fs.default.existsSync(jsPath)) scriptSrc = "/src/main.js";
|
|
48
|
+
return html.replace(/<script type="module" src="[^"]*"><\/script>/, `<script type="module" src="${scriptSrc}"><\/script>`);
|
|
49
|
+
},
|
|
50
|
+
configureServer(server) {
|
|
51
|
+
server.middlewares.use((req, res, next) => {
|
|
52
|
+
let filePath = null;
|
|
53
|
+
if (req.url?.startsWith("/public/")) {
|
|
54
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
55
|
+
filePath = node_path.default.join(assetsPath, urlWithoutQuery.replace("/public/", ""));
|
|
56
|
+
} else if (req.url?.startsWith("/templates/")) {
|
|
57
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
58
|
+
filePath = node_path.default.join(assetsPath, "templates", urlWithoutQuery.replace("/templates/", ""));
|
|
59
|
+
} else if (req.url?.startsWith("/js/")) {
|
|
60
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
61
|
+
filePath = node_path.default.join(assetsPath, "js", urlWithoutQuery.replace("/js/", ""));
|
|
62
|
+
} else if (req.url?.startsWith("/css/")) {
|
|
63
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
64
|
+
filePath = node_path.default.join(assetsPath, "css", urlWithoutQuery.replace("/css/", ""));
|
|
65
|
+
} else if (req.url?.startsWith("/images/")) {
|
|
66
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
67
|
+
filePath = node_path.default.join(assetsPath, "images", urlWithoutQuery.replace("/images/", ""));
|
|
68
|
+
} else if (req.url === "/" || req.url?.startsWith("/?") || req.url === "/index.html" || req.url?.startsWith("/index.html?")) filePath = node_path.default.join(assetsPath, "index.html");
|
|
69
|
+
if (filePath && node_fs.default.existsSync(filePath)) {
|
|
70
|
+
const ext = node_path.default.extname(filePath).toLowerCase();
|
|
71
|
+
const contentType = {
|
|
72
|
+
".html": "text/html",
|
|
73
|
+
".css": "text/css",
|
|
74
|
+
".js": "application/javascript",
|
|
75
|
+
".json": "application/json",
|
|
76
|
+
".png": "image/png",
|
|
77
|
+
".jpg": "image/jpeg",
|
|
78
|
+
".jpeg": "image/jpeg",
|
|
79
|
+
".gif": "image/gif",
|
|
80
|
+
".svg": "image/svg+xml",
|
|
81
|
+
".ico": "image/x-icon"
|
|
82
|
+
}[ext] || "application/octet-stream";
|
|
83
|
+
res.setHeader("Content-Type", contentType);
|
|
84
|
+
node_fs.default.createReadStream(filePath).pipe(res);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
next();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
module.exports = tona;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
interface TonaPluginOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Default script source path when neither main.ts nor main.js exists
|
|
7
|
+
* @default '/src/main.js'
|
|
8
|
+
*/
|
|
9
|
+
defaultScriptSrc?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Base directory to resolve main files from
|
|
12
|
+
* @default process.cwd()
|
|
13
|
+
*/
|
|
14
|
+
baseDir?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The path to the shared assets directory
|
|
17
|
+
* @default path.join(__dirname, '..', 'public')
|
|
18
|
+
*/
|
|
19
|
+
sharedAssetsPath?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Vite plugin for Tona themes - combines dynamic script extension and shared assets serving
|
|
23
|
+
*/
|
|
24
|
+
declare function tona(options?: TonaPluginOptions): Plugin;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { TonaPluginOptions, tona as default };
|
|
27
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;UAYiB,iBAAA;;AAAjB;AAgBC;;;;;;;;;;;;;;;;;iBAKuB,IAAA,WAAc,oBAAyB"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
interface TonaPluginOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Default script source path when neither main.ts nor main.js exists
|
|
7
|
+
* @default '/src/main.js'
|
|
8
|
+
*/
|
|
9
|
+
defaultScriptSrc?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Base directory to resolve main files from
|
|
12
|
+
* @default process.cwd()
|
|
13
|
+
*/
|
|
14
|
+
baseDir?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The path to the shared assets directory
|
|
17
|
+
* @default path.join(__dirname, '..', 'public')
|
|
18
|
+
*/
|
|
19
|
+
sharedAssetsPath?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Vite plugin for Tona themes - combines dynamic script extension and shared assets serving
|
|
23
|
+
*/
|
|
24
|
+
declare function tona(options?: TonaPluginOptions): Plugin;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { TonaPluginOptions, tona as default };
|
|
27
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;UAYiB,iBAAA;;AAAjB;AAgBC;;;;;;;;;;;;;;;;;iBAKuB,IAAA,WAAc,oBAAyB"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
/**
|
|
9
|
+
* Vite plugin for Tona themes - combines dynamic script extension and shared assets serving
|
|
10
|
+
*/
|
|
11
|
+
function tona(options = {}) {
|
|
12
|
+
const { defaultScriptSrc = "/src/main.js", baseDir = process.cwd(), sharedAssetsPath } = options;
|
|
13
|
+
const assetsPath = sharedAssetsPath || path.join(__dirname, "..", "public");
|
|
14
|
+
return {
|
|
15
|
+
name: "vite-plugin-tona",
|
|
16
|
+
transformIndexHtml(html) {
|
|
17
|
+
const jsPath = path.resolve(baseDir, "src/main.js");
|
|
18
|
+
const tsPath = path.resolve(baseDir, "src/main.ts");
|
|
19
|
+
let scriptSrc = defaultScriptSrc;
|
|
20
|
+
if (fs.existsSync(tsPath)) scriptSrc = "/src/main.ts";
|
|
21
|
+
else if (fs.existsSync(jsPath)) scriptSrc = "/src/main.js";
|
|
22
|
+
return html.replace(/<script type="module" src="[^"]*"><\/script>/, `<script type="module" src="${scriptSrc}"><\/script>`);
|
|
23
|
+
},
|
|
24
|
+
configureServer(server) {
|
|
25
|
+
server.middlewares.use((req, res, next) => {
|
|
26
|
+
let filePath = null;
|
|
27
|
+
if (req.url?.startsWith("/public/")) {
|
|
28
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
29
|
+
filePath = path.join(assetsPath, urlWithoutQuery.replace("/public/", ""));
|
|
30
|
+
} else if (req.url?.startsWith("/templates/")) {
|
|
31
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
32
|
+
filePath = path.join(assetsPath, "templates", urlWithoutQuery.replace("/templates/", ""));
|
|
33
|
+
} else if (req.url?.startsWith("/js/")) {
|
|
34
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
35
|
+
filePath = path.join(assetsPath, "js", urlWithoutQuery.replace("/js/", ""));
|
|
36
|
+
} else if (req.url?.startsWith("/css/")) {
|
|
37
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
38
|
+
filePath = path.join(assetsPath, "css", urlWithoutQuery.replace("/css/", ""));
|
|
39
|
+
} else if (req.url?.startsWith("/images/")) {
|
|
40
|
+
const urlWithoutQuery = req.url.split("?")[0];
|
|
41
|
+
filePath = path.join(assetsPath, "images", urlWithoutQuery.replace("/images/", ""));
|
|
42
|
+
} else if (req.url === "/" || req.url?.startsWith("/?") || req.url === "/index.html" || req.url?.startsWith("/index.html?")) filePath = path.join(assetsPath, "index.html");
|
|
43
|
+
if (filePath && fs.existsSync(filePath)) {
|
|
44
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
45
|
+
const contentType = {
|
|
46
|
+
".html": "text/html",
|
|
47
|
+
".css": "text/css",
|
|
48
|
+
".js": "application/javascript",
|
|
49
|
+
".json": "application/json",
|
|
50
|
+
".png": "image/png",
|
|
51
|
+
".jpg": "image/jpeg",
|
|
52
|
+
".jpeg": "image/jpeg",
|
|
53
|
+
".gif": "image/gif",
|
|
54
|
+
".svg": "image/svg+xml",
|
|
55
|
+
".ico": "image/x-icon"
|
|
56
|
+
}[ext] || "application/octet-stream";
|
|
57
|
+
res.setHeader("Content-Type", contentType);
|
|
58
|
+
fs.createReadStream(filePath).pipe(res);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
next();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { tona as default };
|
|
69
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["filePath: string | null"],"sources":["../src/index.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { fileURLToPath } from 'node:url'\nimport type { Plugin, ViteDevServer } from 'vite'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\ninterface MimeTypes {\n [key: string]: string\n}\n\nexport interface TonaPluginOptions {\n /**\n * Default script source path when neither main.ts nor main.js exists\n * @default '/src/main.js'\n */\n defaultScriptSrc?: string\n /**\n * Base directory to resolve main files from\n * @default process.cwd()\n */\n baseDir?: string\n /**\n * The path to the shared assets directory\n * @default path.join(__dirname, '..', 'public')\n */\n sharedAssetsPath?: string\n}\n\n/**\n * Vite plugin for Tona themes - combines dynamic script extension and shared assets serving\n */\nexport default function tona(options: TonaPluginOptions = {}): Plugin {\n const {\n defaultScriptSrc = '/src/main.js',\n baseDir = process.cwd(),\n sharedAssetsPath,\n } = options\n\n // Default path to shared assets\n const assetsPath = sharedAssetsPath || path.join(__dirname, '..', 'public')\n\n return {\n name: 'vite-plugin-tona',\n\n transformIndexHtml(html) {\n // Dynamic script extension: check main.ts or main.js exists\n const jsPath = path.resolve(baseDir, 'src/main.js')\n const tsPath = path.resolve(baseDir, 'src/main.ts')\n let scriptSrc = defaultScriptSrc\n\n if (fs.existsSync(tsPath)) {\n scriptSrc = '/src/main.ts'\n } else if (fs.existsSync(jsPath)) {\n scriptSrc = '/src/main.js'\n }\n\n // Replace script src in HTML\n return html.replace(\n /<script type=\"module\" src=\"[^\"]*\"><\\/script>/,\n `<script type=\"module\" src=\"${scriptSrc}\"></script>`,\n )\n },\n\n configureServer(server: ViteDevServer) {\n // Serve static files from shared-assets/public directory\n server.middlewares.use((req, res, next) => {\n let filePath: string | null = null\n\n // Check if the request is for a file in /public (which will be served from shared-assets)\n if (req.url?.startsWith('/public/')) {\n const urlWithoutQuery = req.url.split('?')[0]\n filePath = path.join(\n assetsPath,\n urlWithoutQuery!.replace('/public/', ''),\n )\n } else if (req.url?.startsWith('/templates/')) {\n const urlWithoutQuery = req.url.split('?')[0]\n filePath = path.join(\n assetsPath,\n 'templates',\n urlWithoutQuery!.replace('/templates/', ''),\n )\n } else if (req.url?.startsWith('/js/')) {\n const urlWithoutQuery = req.url.split('?')[0]\n filePath = path.join(\n assetsPath,\n 'js',\n urlWithoutQuery!.replace('/js/', ''),\n )\n } else if (req.url?.startsWith('/css/')) {\n const urlWithoutQuery = req.url.split('?')[0]\n filePath = path.join(\n assetsPath,\n 'css',\n urlWithoutQuery!.replace('/css/', ''),\n )\n } else if (req.url?.startsWith('/images/')) {\n const urlWithoutQuery = req.url.split('?')[0]\n filePath = path.join(\n assetsPath,\n 'images',\n urlWithoutQuery!.replace('/images/', ''),\n )\n } else if (\n req.url === '/' ||\n req.url?.startsWith('/?') ||\n req.url === '/index.html' ||\n req.url?.startsWith('/index.html?')\n ) {\n filePath = path.join(assetsPath, 'index.html')\n }\n\n // Check if file exists\n if (filePath && fs.existsSync(filePath)) {\n // Set appropriate content type\n const ext = path.extname(filePath).toLowerCase()\n const mimeTypes: MimeTypes = {\n '.html': 'text/html',\n '.css': 'text/css',\n '.js': 'application/javascript',\n '.json': 'application/json',\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.ico': 'image/x-icon',\n }\n\n const contentType = mimeTypes[ext] || 'application/octet-stream'\n res.setHeader('Content-Type', contentType)\n\n // Read and serve the file\n const fileStream = fs.createReadStream(filePath)\n fileStream.pipe(res)\n return\n }\n\n // If not handled, pass to next middleware\n next()\n })\n },\n }\n}\n"],"mappings":";;;;;;AAMA,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;;;;AA2B9D,SAAwB,KAAK,UAA6B,EAAE,EAAU;CACpE,MAAM,EACJ,mBAAmB,gBACnB,UAAU,QAAQ,KAAK,EACvB,qBACE;CAGJ,MAAM,aAAa,oBAAoB,KAAK,KAAK,WAAW,MAAM,SAAS;AAE3E,QAAO;EACL,MAAM;EAEN,mBAAmB,MAAM;GAEvB,MAAM,SAAS,KAAK,QAAQ,SAAS,cAAc;GACnD,MAAM,SAAS,KAAK,QAAQ,SAAS,cAAc;GACnD,IAAI,YAAY;AAEhB,OAAI,GAAG,WAAW,OAAO,CACvB,aAAY;YACH,GAAG,WAAW,OAAO,CAC9B,aAAY;AAId,UAAO,KAAK,QACV,gDACA,8BAA8B,UAAU,cACzC;;EAGH,gBAAgB,QAAuB;AAErC,UAAO,YAAY,KAAK,KAAK,KAAK,SAAS;IACzC,IAAIA,WAA0B;AAG9B,QAAI,IAAI,KAAK,WAAW,WAAW,EAAE;KACnC,MAAM,kBAAkB,IAAI,IAAI,MAAM,IAAI,CAAC;AAC3C,gBAAW,KAAK,KACd,YACA,gBAAiB,QAAQ,YAAY,GAAG,CACzC;eACQ,IAAI,KAAK,WAAW,cAAc,EAAE;KAC7C,MAAM,kBAAkB,IAAI,IAAI,MAAM,IAAI,CAAC;AAC3C,gBAAW,KAAK,KACd,YACA,aACA,gBAAiB,QAAQ,eAAe,GAAG,CAC5C;eACQ,IAAI,KAAK,WAAW,OAAO,EAAE;KACtC,MAAM,kBAAkB,IAAI,IAAI,MAAM,IAAI,CAAC;AAC3C,gBAAW,KAAK,KACd,YACA,MACA,gBAAiB,QAAQ,QAAQ,GAAG,CACrC;eACQ,IAAI,KAAK,WAAW,QAAQ,EAAE;KACvC,MAAM,kBAAkB,IAAI,IAAI,MAAM,IAAI,CAAC;AAC3C,gBAAW,KAAK,KACd,YACA,OACA,gBAAiB,QAAQ,SAAS,GAAG,CACtC;eACQ,IAAI,KAAK,WAAW,WAAW,EAAE;KAC1C,MAAM,kBAAkB,IAAI,IAAI,MAAM,IAAI,CAAC;AAC3C,gBAAW,KAAK,KACd,YACA,UACA,gBAAiB,QAAQ,YAAY,GAAG,CACzC;eAED,IAAI,QAAQ,OACZ,IAAI,KAAK,WAAW,KAAK,IACzB,IAAI,QAAQ,iBACZ,IAAI,KAAK,WAAW,eAAe,CAEnC,YAAW,KAAK,KAAK,YAAY,aAAa;AAIhD,QAAI,YAAY,GAAG,WAAW,SAAS,EAAE;KAEvC,MAAM,MAAM,KAAK,QAAQ,SAAS,CAAC,aAAa;KAchD,MAAM,cAbuB;MAC3B,SAAS;MACT,QAAQ;MACR,OAAO;MACP,SAAS;MACT,QAAQ;MACR,QAAQ;MACR,SAAS;MACT,QAAQ;MACR,QAAQ;MACR,QAAQ;MACT,CAE6B,QAAQ;AACtC,SAAI,UAAU,gBAAgB,YAAY;AAI1C,KADmB,GAAG,iBAAiB,SAAS,CACrC,KAAK,IAAI;AACpB;;AAIF,UAAM;KACN;;EAEL"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tona-vite",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "Vite plugin for Tona themes - combines dynamic script extension and shared assets serving",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "guangzan",
|
|
8
|
+
"url": "https://www.cnblogs.com/guangzan",
|
|
9
|
+
"email": "guangzan1999@outlook.com"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"homepage": "https://github.com/cnbloglabs",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/cnbloglabs/tona.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/cnbloglabs/tona/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"vite",
|
|
22
|
+
"plugin",
|
|
23
|
+
"dynamic-script",
|
|
24
|
+
"shared-assets",
|
|
25
|
+
"博客园"
|
|
26
|
+
],
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"import": "./dist/index.mjs",
|
|
32
|
+
"require": "./dist/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"main": "./dist/index.cjs",
|
|
36
|
+
"module": "./dist/index.mjs",
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
|
+
"typesVersions": {
|
|
39
|
+
"*": {
|
|
40
|
+
"*": [
|
|
41
|
+
"./dist/*",
|
|
42
|
+
"./dist/index.d.mts"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"public"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"dev": "tsdown --watch",
|
|
52
|
+
"build": "tsdown"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"vite": "catalog:"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "catalog:",
|
|
59
|
+
"tsdown": "catalog:",
|
|
60
|
+
"vitest": "catalog:"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
Atom One Dark by Daniel Gamage
|
|
4
|
+
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
|
|
5
|
+
|
|
6
|
+
base: #282c34
|
|
7
|
+
mono-1: #abb2bf
|
|
8
|
+
mono-2: #818896
|
|
9
|
+
mono-3: #5c6370
|
|
10
|
+
hue-1: #56b6c2
|
|
11
|
+
hue-2: #61aeee
|
|
12
|
+
hue-3: #c678dd
|
|
13
|
+
hue-4: #98c379
|
|
14
|
+
hue-5: #e06c75
|
|
15
|
+
hue-5-2: #be5046
|
|
16
|
+
hue-6: #d19a66
|
|
17
|
+
hue-6-2: #e6c07b
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
.hljs {
|
|
22
|
+
display: block;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
padding: 0.5em;
|
|
25
|
+
color: #abb2bf;
|
|
26
|
+
background: #282c34;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.hljs-comment,
|
|
30
|
+
.hljs-quote {
|
|
31
|
+
color: #5c6370;
|
|
32
|
+
font-style: italic;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.hljs-doctag,
|
|
36
|
+
.hljs-keyword,
|
|
37
|
+
.hljs-formula {
|
|
38
|
+
color: #c678dd;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.hljs-section,
|
|
42
|
+
.hljs-name,
|
|
43
|
+
.hljs-selector-tag,
|
|
44
|
+
.hljs-deletion,
|
|
45
|
+
.hljs-subst {
|
|
46
|
+
color: #e06c75;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.hljs-literal {
|
|
50
|
+
color: #56b6c2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.hljs-string,
|
|
54
|
+
.hljs-regexp,
|
|
55
|
+
.hljs-addition,
|
|
56
|
+
.hljs-attribute,
|
|
57
|
+
.hljs-meta-string {
|
|
58
|
+
color: #98c379;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.hljs-built_in,
|
|
62
|
+
.hljs-class .hljs-title {
|
|
63
|
+
color: #e6c07b;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.hljs-attr,
|
|
67
|
+
.hljs-variable,
|
|
68
|
+
.hljs-template-variable,
|
|
69
|
+
.hljs-type,
|
|
70
|
+
.hljs-selector-class,
|
|
71
|
+
.hljs-selector-attr,
|
|
72
|
+
.hljs-selector-pseudo,
|
|
73
|
+
.hljs-number {
|
|
74
|
+
color: #d19a66;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.hljs-symbol,
|
|
78
|
+
.hljs-bullet,
|
|
79
|
+
.hljs-link,
|
|
80
|
+
.hljs-meta,
|
|
81
|
+
.hljs-selector-id,
|
|
82
|
+
.hljs-title {
|
|
83
|
+
color: #61aeee;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.hljs-emphasis {
|
|
87
|
+
font-style: italic;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.hljs-strong {
|
|
91
|
+
font-weight: bold;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.hljs-link {
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
Atom One Light by Daniel Gamage
|
|
4
|
+
Original One Light Syntax theme from https://github.com/atom/one-light-syntax
|
|
5
|
+
|
|
6
|
+
base: #fafafa
|
|
7
|
+
mono-1: #383a42
|
|
8
|
+
mono-2: #686b77
|
|
9
|
+
mono-3: #a0a1a7
|
|
10
|
+
hue-1: #0184bb
|
|
11
|
+
hue-2: #4078f2
|
|
12
|
+
hue-3: #a626a4
|
|
13
|
+
hue-4: #50a14f
|
|
14
|
+
hue-5: #e45649
|
|
15
|
+
hue-5-2: #c91243
|
|
16
|
+
hue-6: #986801
|
|
17
|
+
hue-6-2: #c18401
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
.hljs {
|
|
22
|
+
display: block;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
padding: 0.5em;
|
|
25
|
+
color: #383a42;
|
|
26
|
+
background: #fafafa;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.hljs-comment,
|
|
30
|
+
.hljs-quote {
|
|
31
|
+
color: #a0a1a7;
|
|
32
|
+
font-style: italic;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.hljs-doctag,
|
|
36
|
+
.hljs-keyword,
|
|
37
|
+
.hljs-formula {
|
|
38
|
+
color: #a626a4;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.hljs-section,
|
|
42
|
+
.hljs-name,
|
|
43
|
+
.hljs-selector-tag,
|
|
44
|
+
.hljs-deletion,
|
|
45
|
+
.hljs-subst {
|
|
46
|
+
color: #e45649;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.hljs-literal {
|
|
50
|
+
color: #0184bb;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.hljs-string,
|
|
54
|
+
.hljs-regexp,
|
|
55
|
+
.hljs-addition,
|
|
56
|
+
.hljs-attribute,
|
|
57
|
+
.hljs-meta-string {
|
|
58
|
+
color: #50a14f;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.hljs-built_in,
|
|
62
|
+
.hljs-class .hljs-title {
|
|
63
|
+
color: #c18401;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.hljs-attr,
|
|
67
|
+
.hljs-variable,
|
|
68
|
+
.hljs-template-variable,
|
|
69
|
+
.hljs-type,
|
|
70
|
+
.hljs-selector-class,
|
|
71
|
+
.hljs-selector-attr,
|
|
72
|
+
.hljs-selector-pseudo,
|
|
73
|
+
.hljs-number {
|
|
74
|
+
color: #986801;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.hljs-symbol,
|
|
78
|
+
.hljs-bullet,
|
|
79
|
+
.hljs-link,
|
|
80
|
+
.hljs-meta,
|
|
81
|
+
.hljs-selector-id,
|
|
82
|
+
.hljs-title {
|
|
83
|
+
color: #4078f2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.hljs-emphasis {
|
|
87
|
+
font-style: italic;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.hljs-strong {
|
|
91
|
+
font-weight: bold;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.hljs-link {
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
}
|