mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 04:59:02 +08:00
improve filecode performance
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
"eslint-plugin-svelte3": "^3.4.1",
|
||||
"eslint-plugin-vue": "^8.6.0",
|
||||
"husky": "^7.0.4",
|
||||
"lint-staged": "^12.3.7",
|
||||
"lint-staged": "^12.3.8",
|
||||
"lodash.kebabcase": "^4.1.1",
|
||||
"pkg-dir": "^6.0.1",
|
||||
"postcss": "^8.4.12",
|
||||
|
||||
90
pnpm-lock.yaml
generated
90
pnpm-lock.yaml
generated
@@ -19,7 +19,7 @@ specifiers:
|
||||
eslint-plugin-svelte3: ^3.4.1
|
||||
eslint-plugin-vue: ^8.6.0
|
||||
husky: ^7.0.4
|
||||
lint-staged: ^12.3.7
|
||||
lint-staged: ^12.3.8
|
||||
lodash.kebabcase: ^4.1.1
|
||||
pkg-dir: ^6.0.1
|
||||
postcss: ^8.4.12
|
||||
@@ -51,7 +51,7 @@ devDependencies:
|
||||
eslint-plugin-svelte3: 3.4.1_eslint@8.13.0+svelte@3.47.0
|
||||
eslint-plugin-vue: 8.6.0_eslint@8.13.0
|
||||
husky: 7.0.4
|
||||
lint-staged: 12.3.7
|
||||
lint-staged: 12.3.8
|
||||
lodash.kebabcase: 4.1.1
|
||||
pkg-dir: 6.0.1
|
||||
postcss: 8.4.12
|
||||
@@ -179,7 +179,7 @@ packages:
|
||||
mdast-util-to-string: 3.1.0
|
||||
micromark-extension-mdx-expression: 1.0.3
|
||||
micromark-extension-mdx-jsx: 1.0.3
|
||||
prismjs: 1.27.0
|
||||
prismjs: 1.28.0
|
||||
rehype-raw: 6.1.1
|
||||
rehype-slug: 5.0.1
|
||||
rehype-stringify: 9.0.3
|
||||
@@ -407,7 +407,7 @@ packages:
|
||||
resolution: {integrity: sha512-WxYHHUWF2uZ7Hp1K+D1xQgbgkGUfA+5UPOegEXGt2Y5SMog/rYCVaifLZDbw8UkNXozEqqrZTy6bglL7xTaCOw==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
core-js-pure: 3.21.1
|
||||
core-js-pure: 3.22.0
|
||||
regenerator-runtime: 0.13.9
|
||||
dev: true
|
||||
|
||||
@@ -1034,7 +1034,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
get-intrinsic: 1.1.1
|
||||
is-string: 1.0.7
|
||||
@@ -1054,7 +1054,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
es-shim-unscopables: 1.0.0
|
||||
dev: true
|
||||
@@ -1125,12 +1125,12 @@ packages:
|
||||
postcss: 8.4.12
|
||||
postcss-load-config: 3.1.4_postcss@8.4.12
|
||||
preferred-pm: 3.0.3
|
||||
prismjs: 1.27.0
|
||||
prismjs: 1.28.0
|
||||
prompts: 2.4.2
|
||||
recast: 0.20.5
|
||||
rehype-slug: 5.0.1
|
||||
resolve: 1.22.0
|
||||
rollup: 2.70.1
|
||||
rollup: 2.70.2
|
||||
semver: 7.3.7
|
||||
serialize-javascript: 6.0.0
|
||||
shiki: 0.10.1
|
||||
@@ -1238,7 +1238,7 @@ packages:
|
||||
hasBin: true
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001332
|
||||
electron-to-chromium: 1.4.107
|
||||
electron-to-chromium: 1.4.111
|
||||
escalade: 3.1.1
|
||||
node-releases: 2.0.3
|
||||
picocolors: 1.0.0
|
||||
@@ -1440,8 +1440,8 @@ packages:
|
||||
safe-buffer: 5.1.2
|
||||
dev: true
|
||||
|
||||
/core-js-pure/3.21.1:
|
||||
resolution: {integrity: sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==}
|
||||
/core-js-pure/3.22.0:
|
||||
resolution: {integrity: sha512-ylOC9nVy0ak1N+fPIZj00umoZHgUVqmucklP5RT5N+vJof38klKn8Ze6KGyvchdClvEBr6LcQqJpI216LUMqYA==}
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
||||
@@ -1510,10 +1510,11 @@ packages:
|
||||
clone: 1.0.4
|
||||
dev: true
|
||||
|
||||
/define-properties/1.1.3:
|
||||
resolution: {integrity: sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==}
|
||||
/define-properties/1.1.4:
|
||||
resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
has-property-descriptors: 1.0.0
|
||||
object-keys: 1.1.1
|
||||
dev: true
|
||||
|
||||
@@ -1606,8 +1607,8 @@ packages:
|
||||
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
|
||||
dev: true
|
||||
|
||||
/electron-to-chromium/1.4.107:
|
||||
resolution: {integrity: sha512-Huen6taaVrUrSy8o7mGStByba8PfOWWluHNxSHGBrCgEdFVLtvdQDBr9LBCF9Uci8SYxh28QNNMO0oC17wbGAg==}
|
||||
/electron-to-chromium/1.4.111:
|
||||
resolution: {integrity: sha512-/s3+fwhKf1YK4k7btOImOzCQLpUjS6MaPf0ODTNuT4eTM1Bg4itBpLkydhOzJmpmH6Z9eXFyuuK5czsmzRzwtw==}
|
||||
dev: true
|
||||
|
||||
/emmet/2.3.6:
|
||||
@@ -2303,6 +2304,10 @@ packages:
|
||||
resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=}
|
||||
dev: true
|
||||
|
||||
/functions-have-names/1.2.2:
|
||||
resolution: {integrity: sha512-bLgc3asbWdwPbx2mNk2S49kmJCuQeu0nfmaOgbs8WIyzzkw3r4htszdIi9Q9EMezDPTYuJx2wvjZ/EwgAthpnA==}
|
||||
dev: true
|
||||
|
||||
/gensync/1.0.0-beta.2:
|
||||
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@@ -2416,6 +2421,12 @@ packages:
|
||||
'@ljharb/has-package-exports-patterns': 0.0.2
|
||||
dev: true
|
||||
|
||||
/has-property-descriptors/1.0.0:
|
||||
resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==}
|
||||
dependencies:
|
||||
get-intrinsic: 1.1.1
|
||||
dev: true
|
||||
|
||||
/has-symbols/1.0.3:
|
||||
resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -2748,7 +2759,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
dev: true
|
||||
|
||||
/is-negative-zero/2.0.2:
|
||||
@@ -2925,8 +2936,8 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/lint-staged/12.3.7:
|
||||
resolution: {integrity: sha512-/S4D726e2GIsDVWIk1XGvheCaDm1SJRQp8efamZFWJxQMVEbOwSysp7xb49Oo73KYCdy97mIWinhlxcoNqIfIQ==}
|
||||
/lint-staged/12.3.8:
|
||||
resolution: {integrity: sha512-0+UpNaqIwKRSGAFOCcpuYNIv/j5QGVC+xUVvmSdxHO+IfIGoHbFLo3XcPmV/LLnsVj5EAncNHVtlITSoY5qWGQ==}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
@@ -3599,8 +3610,8 @@ packages:
|
||||
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
|
||||
dev: true
|
||||
|
||||
/nanoid/3.3.2:
|
||||
resolution: {integrity: sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==}
|
||||
/nanoid/3.3.3:
|
||||
resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
dev: true
|
||||
@@ -3673,7 +3684,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
dev: true
|
||||
|
||||
/object-keys/1.1.1:
|
||||
@@ -3686,7 +3697,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
has-symbols: 1.0.3
|
||||
object-keys: 1.1.1
|
||||
dev: true
|
||||
@@ -3696,7 +3707,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
dev: true
|
||||
|
||||
@@ -3705,14 +3716,14 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
dev: true
|
||||
|
||||
/object.hasown/1.1.0:
|
||||
resolution: {integrity: sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==}
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
dev: true
|
||||
|
||||
@@ -3721,7 +3732,7 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
dev: true
|
||||
|
||||
@@ -3994,7 +4005,7 @@ packages:
|
||||
resolution: {integrity: sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
dependencies:
|
||||
nanoid: 3.3.2
|
||||
nanoid: 3.3.3
|
||||
picocolors: 1.0.0
|
||||
source-map-js: 1.0.2
|
||||
dev: true
|
||||
@@ -4037,8 +4048,8 @@ packages:
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/prismjs/1.27.0:
|
||||
resolution: {integrity: sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==}
|
||||
/prismjs/1.28.0:
|
||||
resolution: {integrity: sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==}
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
@@ -4124,12 +4135,13 @@ packages:
|
||||
resolution: {integrity: sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==}
|
||||
dev: true
|
||||
|
||||
/regexp.prototype.flags/1.4.2:
|
||||
resolution: {integrity: sha512-Ynz8fTQW5/1elh+jWU2EDDzeoNbD0OQ0R+D1VJU5ATOkUaro4A9YEkdN2ODQl/8UQFPPpZNw91fOcLFamM7Pww==}
|
||||
/regexp.prototype.flags/1.4.3:
|
||||
resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
functions-have-names: 1.2.2
|
||||
dev: true
|
||||
|
||||
/regexpp/3.2.0:
|
||||
@@ -4299,8 +4311,8 @@ packages:
|
||||
glob: 7.2.0
|
||||
dev: true
|
||||
|
||||
/rollup/2.70.1:
|
||||
resolution: {integrity: sha512-CRYsI5EuzLbXdxC6RnYhOuRdtz4bhejPMSWjsFLfVM/7w/85n2szZv6yExqUXsBdz5KT8eoubeyDUDjhLHEslA==}
|
||||
/rollup/2.70.2:
|
||||
resolution: {integrity: sha512-EitogNZnfku65I1DD5Mxe8JYRUCy0hkK5X84IlDtUs+O6JRMpRciXTzyCUuX11b5L5pvjH+OmFXiQ3XjabcXgg==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
hasBin: true
|
||||
optionalDependencies:
|
||||
@@ -4528,12 +4540,12 @@ packages:
|
||||
resolution: {integrity: sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
es-abstract: 1.19.5
|
||||
get-intrinsic: 1.1.1
|
||||
has-symbols: 1.0.3
|
||||
internal-slot: 1.0.3
|
||||
regexp.prototype.flags: 1.4.2
|
||||
regexp.prototype.flags: 1.4.3
|
||||
side-channel: 1.0.4
|
||||
dev: true
|
||||
|
||||
@@ -4541,14 +4553,14 @@ packages:
|
||||
resolution: {integrity: sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
dev: true
|
||||
|
||||
/string.prototype.trimstart/1.0.4:
|
||||
resolution: {integrity: sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==}
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
define-properties: 1.1.3
|
||||
define-properties: 1.1.4
|
||||
dev: true
|
||||
|
||||
/string_decoder/1.3.0:
|
||||
@@ -5051,7 +5063,7 @@ packages:
|
||||
esbuild: 0.14.36
|
||||
postcss: 8.4.12
|
||||
resolve: 1.22.0
|
||||
rollup: 2.70.1
|
||||
rollup: 2.70.2
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 250 250" style="enable-background:new 0 0 250 250;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#DD0031;}
|
||||
|
||||
|
Before Width: | Height: | Size: 883 B After Width: | Height: | Size: 870 B |
@@ -1 +1 @@
|
||||
<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 20.46348"><title>logo</title><path d="M18.91 6.633q-.367-.126-.74-.234.062-.252.115-.506c.56-2.72.194-4.912-1.058-5.634-1.2-.692-3.162.03-5.144 1.755q-.293.255-.572.525-.187-.18-.38-.352C9.053.344 6.97-.432 5.72.29 4.523.984 4.168 3.045 4.67 5.623q.077.383.17.762c-.293.084-.578.173-.85.268-2.435.85-3.99 2.18-3.99 3.56 0 1.425 1.67 2.855 4.206 3.72q.308.106.622.196-.102.407-.18.82c-.482 2.533-.106 4.545 1.09 5.235 1.234.712 3.306-.02 5.325-1.784q.24-.208.48-.442.302.293.62.568c1.956 1.682 3.886 2.36 5.08 1.67 1.235-.715 1.636-2.876 1.115-5.505q-.06-.3-.138-.614.218-.064.428-.133C21.285 13.07 23 11.657 23 10.213c0-1.386-1.605-2.725-4.09-3.58zM12.73 2.756c1.698-1.478 3.285-2.06 4.01-1.644.77.444 1.068 2.235.584 4.584q-.047.23-.103.457a23.538 23.538 0 0 0-3.076-.486A23.08 23.08 0 0 0 12.2 3.24q.258-.248.528-.484zM6.79 11.39q.313.604.653 1.19.347.6.722 1.183a20.922 20.922 0 0 1-2.12-.34c.204-.657.454-1.34.746-2.032zm0-2.31c-.286-.678-.53-1.345-.73-1.99.655-.147 1.355-.267 2.084-.358q-.366.57-.705 1.16-.34.586-.65 1.188zm.522 1.156q.454-.945.98-1.854.522-.91 1.114-1.775c.684-.052 1.385-.08 2.094-.08.712 0 1.414.028 2.098.08q.585.865 1.108 1.77.526.906.992 1.845-.46.948-.988 1.862-.523.908-1.104 1.78c-.682.05-1.387.074-2.106.074-.716 0-1.412-.022-2.082-.066q-.596-.87-1.124-1.783-.526-.91-.982-1.854zm8.25 2.34q.346-.603.666-1.22A20.867 20.867 0 0 1 17 13.38a20.852 20.852 0 0 1-2.145.365q.364-.578.706-1.17zm.656-3.495q-.318-.604-.66-1.196-.338-.582-.7-1.15c.733.093 1.436.216 2.097.367a20.96 20.96 0 0 1-.737 1.98zM11.51 3.945a21.013 21.013 0 0 1 1.354 1.634q-1.358-.065-2.718 0c.447-.59.905-1.138 1.365-1.634zM6.214 1.14c.77-.445 2.47.19 4.264 1.783.115.102.23.208.345.318a23.545 23.545 0 0 0-1.96 2.426 24.008 24.008 0 0 0-3.068.477q-.088-.352-.158-.71v.002c-.433-2.21-.146-3.876.577-4.294zM5.09 13.183q-.285-.082-.566-.177A8.324 8.324 0 0 1 1.84 11.58a2.03 2.03 0 0 1-.857-1.368c0-.837 1.248-1.905 3.33-2.63q.393-.138.792-.25a23.565 23.565 0 0 0 1.12 2.904 23.922 23.922 0 0 0-1.134 2.946zm5.326 4.48a8.322 8.322 0 0 1-2.575 1.61 2.03 2.03 0 0 1-1.612.062c-.725-.42-1.027-2.034-.616-4.2q.074-.385.168-.764a23.104 23.104 0 0 0 3.1.448 23.91 23.91 0 0 0 1.974 2.44q-.214.207-.438.403zm1.122-1.112c-.466-.502-.93-1.058-1.384-1.656q.66.026 1.346.026.703 0 1.388-.03a20.894 20.894 0 0 1-1.35 1.66zm5.967 1.367a2.03 2.03 0 0 1-.753 1.428c-.725.42-2.275-.126-3.947-1.564q-.287-.246-.578-.526a23.09 23.09 0 0 0 1.928-2.448 22.936 22.936 0 0 0 3.115-.48q.07.284.124.556a8.32 8.32 0 0 1 .11 3.035zm.834-4.907c-.127.042-.256.082-.388.12a23.06 23.06 0 0 0-1.164-2.913 23.05 23.05 0 0 0 1.12-2.87c.234.067.463.14.683.215 2.13.732 3.428 1.816 3.428 2.65 0 .89-1.403 2.044-3.68 2.798z" fill="#61dafb"/><path d="M11.5 8.159a2.054 2.054 0 1 1-2.054 2.052A2.054 2.054 0 0 1 11.5 8.16" fill="#61dafb"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 20.46348"><title>logo</title><path d="M18.91 6.633q-.367-.126-.74-.234.062-.252.115-.506c.56-2.72.194-4.912-1.058-5.634-1.2-.692-3.162.03-5.144 1.755q-.293.255-.572.525-.187-.18-.38-.352C9.053.344 6.97-.432 5.72.29 4.523.984 4.168 3.045 4.67 5.623q.077.383.17.762c-.293.084-.578.173-.85.268-2.435.85-3.99 2.18-3.99 3.56 0 1.425 1.67 2.855 4.206 3.72q.308.106.622.196-.102.407-.18.82c-.482 2.533-.106 4.545 1.09 5.235 1.234.712 3.306-.02 5.325-1.784q.24-.208.48-.442.302.293.62.568c1.956 1.682 3.886 2.36 5.08 1.67 1.235-.715 1.636-2.876 1.115-5.505q-.06-.3-.138-.614.218-.064.428-.133C21.285 13.07 23 11.657 23 10.213c0-1.386-1.605-2.725-4.09-3.58zM12.73 2.756c1.698-1.478 3.285-2.06 4.01-1.644.77.444 1.068 2.235.584 4.584q-.047.23-.103.457a23.538 23.538 0 0 0-3.076-.486A23.08 23.08 0 0 0 12.2 3.24q.258-.248.528-.484zM6.79 11.39q.313.604.653 1.19.347.6.722 1.183a20.922 20.922 0 0 1-2.12-.34c.204-.657.454-1.34.746-2.032zm0-2.31c-.286-.678-.53-1.345-.73-1.99.655-.147 1.355-.267 2.084-.358q-.366.57-.705 1.16-.34.586-.65 1.188zm.522 1.156q.454-.945.98-1.854.522-.91 1.114-1.775c.684-.052 1.385-.08 2.094-.08.712 0 1.414.028 2.098.08q.585.865 1.108 1.77.526.906.992 1.845-.46.948-.988 1.862-.523.908-1.104 1.78c-.682.05-1.387.074-2.106.074-.716 0-1.412-.022-2.082-.066q-.596-.87-1.124-1.783-.526-.91-.982-1.854zm8.25 2.34q.346-.603.666-1.22A20.867 20.867 0 0 1 17 13.38a20.852 20.852 0 0 1-2.145.365q.364-.578.706-1.17zm.656-3.495q-.318-.604-.66-1.196-.338-.582-.7-1.15c.733.093 1.436.216 2.097.367a20.96 20.96 0 0 1-.737 1.98zM11.51 3.945a21.013 21.013 0 0 1 1.354 1.634q-1.358-.065-2.718 0c.447-.59.905-1.138 1.365-1.634zM6.214 1.14c.77-.445 2.47.19 4.264 1.783.115.102.23.208.345.318a23.545 23.545 0 0 0-1.96 2.426 24.008 24.008 0 0 0-3.068.477q-.088-.352-.158-.71v.002c-.433-2.21-.146-3.876.577-4.294zM5.09 13.183q-.285-.082-.566-.177A8.324 8.324 0 0 1 1.84 11.58a2.03 2.03 0 0 1-.857-1.368c0-.837 1.248-1.905 3.33-2.63q.393-.138.792-.25a23.565 23.565 0 0 0 1.12 2.904 23.922 23.922 0 0 0-1.134 2.946zm5.326 4.48a8.322 8.322 0 0 1-2.575 1.61 2.03 2.03 0 0 1-1.612.062c-.725-.42-1.027-2.034-.616-4.2q.074-.385.168-.764a23.104 23.104 0 0 0 3.1.448 23.91 23.91 0 0 0 1.974 2.44q-.214.207-.438.403zm1.122-1.112c-.466-.502-.93-1.058-1.384-1.656q.66.026 1.346.026.703 0 1.388-.03a20.894 20.894 0 0 1-1.35 1.66zm5.967 1.367a2.03 2.03 0 0 1-.753 1.428c-.725.42-2.275-.126-3.947-1.564q-.287-.246-.578-.526a23.09 23.09 0 0 0 1.928-2.448 22.936 22.936 0 0 0 3.115-.48q.07.284.124.556a8.32 8.32 0 0 1 .11 3.035zm.834-4.907c-.127.042-.256.082-.388.12a23.06 23.06 0 0 0-1.164-2.913 23.05 23.05 0 0 0 1.12-2.87c.234.067.463.14.683.215 2.13.732 3.428 1.816 3.428 2.65 0 .89-1.403 2.044-3.68 2.798z" fill="#61dafb"/><path d="M11.5 8.159a2.054 2.054 0 1 1-2.054 2.052A2.054 2.054 0 0 1 11.5 8.16" fill="#61dafb"/></svg>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -1,3 +0,0 @@
|
||||
import createCache from '../createCache';
|
||||
const fileCodeCache = createCache();
|
||||
export default fileCodeCache;
|
||||
@@ -1,23 +1,25 @@
|
||||
---
|
||||
import fs from 'node:fs/promises';
|
||||
import nodePath from "node:path"
|
||||
import highlightCache from './CodeHighlight/cache';
|
||||
import astroHighlightCode from "./CodeHighlight/astroHighlightCode"
|
||||
import createFileMapCache from "../utils/createFileMapCache"
|
||||
|
||||
const { path, lang, theme = 'github-dark', wrap = false } = Astro.props;
|
||||
|
||||
const fileStat = await fs.stat(path)
|
||||
const cacheKey = `${path}-${fileStat.mtimeMs}`
|
||||
// check existence
|
||||
await fs.stat(path)
|
||||
|
||||
if(!highlightCache.has(cacheKey)){
|
||||
highlightCache.cleanKeyStartsWith(path)
|
||||
const fileContent = await fs.readFile(path, "utf-8")
|
||||
const fileCodeCache = await createFileMapCache("fileCodeCache");
|
||||
|
||||
let html = await fileCodeCache.get(path)
|
||||
if(!html){
|
||||
const fileExt = nodePath.parse(path).ext.split(".").pop()
|
||||
const html = await astroHighlightCode({ code: fileContent, lang: lang || fileExt, theme, wrap })
|
||||
highlightCache.set(cacheKey, html)
|
||||
const fileContent = await fs.readFile(path, "utf-8")
|
||||
html = await astroHighlightCode({ code: fileContent, lang: lang || fileExt, theme, wrap })
|
||||
fileCodeCache.set(path, html)
|
||||
}
|
||||
|
||||
const html = highlightCache.get(cacheKey)
|
||||
---
|
||||
|
||||
|
||||
---
|
||||
<Fragment set:html={html} />
|
||||
@@ -22,7 +22,7 @@ export default function createCache({ expireSec } = {}) {
|
||||
}
|
||||
|
||||
function deleteKey(key) {
|
||||
// This will remove the reference to the object on object `cache`.
|
||||
// Remove the reference to the object on object `cache`.
|
||||
// The v8 garbage collector will pick up any objects with zero references for garbage collection.
|
||||
delete cache[key];
|
||||
}
|
||||
|
||||
9
src/layouts/BaseLayout.astro
Normal file
9
src/layouts/BaseLayout.astro
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
import BaseLayout from "./BaseLayout.svelte"
|
||||
import generateContentTree from '../utils/generateContentTree';
|
||||
const tree = await generateContentTree();
|
||||
---
|
||||
|
||||
<BaseLayout tree={tree}>
|
||||
<slot/>
|
||||
</BaseLayout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import tree from '../tree.js';
|
||||
export let tree = [];
|
||||
</script>
|
||||
|
||||
<html lang="en">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import Layout from "../layouts/BaseLayout.svelte"
|
||||
import Layout from "../layouts/BaseLayout.astro"
|
||||
import fs from 'node:fs/promises';
|
||||
import Section from "../components/Section.astro"
|
||||
import { packageDirectory } from 'pkg-dir';
|
||||
|
||||
110
src/tree.js
110
src/tree.js
@@ -1,110 +0,0 @@
|
||||
export default [
|
||||
{
|
||||
id: 'reactivity',
|
||||
title: 'Reactivity',
|
||||
sections: [
|
||||
{
|
||||
id: 'declare-state',
|
||||
title: 'Declare state',
|
||||
},
|
||||
{
|
||||
id: 'update-state',
|
||||
title: 'Update state',
|
||||
},
|
||||
{
|
||||
id: 'computed-state',
|
||||
title: 'Computed state',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'templating',
|
||||
title: 'Templating',
|
||||
sections: [
|
||||
{
|
||||
id: 'minimal-template',
|
||||
title: 'Minimal template',
|
||||
},
|
||||
{
|
||||
id: 'styling',
|
||||
title: 'Styling',
|
||||
},
|
||||
{
|
||||
id: 'loop',
|
||||
title: 'Loop',
|
||||
},
|
||||
{
|
||||
id: 'event-click',
|
||||
title: 'Event click',
|
||||
},
|
||||
{
|
||||
id: 'dom-ref',
|
||||
title: 'Dom ref',
|
||||
},
|
||||
{
|
||||
id: 'conditional',
|
||||
title: 'Conditional',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'lifecycle',
|
||||
title: 'Lifecycle',
|
||||
sections: [
|
||||
{
|
||||
id: 'on-mount',
|
||||
title: 'On mount',
|
||||
},
|
||||
{
|
||||
id: 'on-unmount',
|
||||
title: 'On unmount',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'component-composition',
|
||||
title: 'Component composition',
|
||||
sections: [
|
||||
{
|
||||
id: 'props',
|
||||
title: 'Props',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'form-input',
|
||||
title: 'Form input',
|
||||
sections: [
|
||||
{
|
||||
id: 'input-text',
|
||||
title: 'Input text',
|
||||
},
|
||||
{
|
||||
id: 'checkbox',
|
||||
title: 'Checkbox',
|
||||
},
|
||||
{
|
||||
id: 'radio',
|
||||
title: 'Radio',
|
||||
},
|
||||
{
|
||||
id: 'select',
|
||||
title: 'Select',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'webapp-features',
|
||||
title: 'Webapp features',
|
||||
sections: [
|
||||
{
|
||||
id: 'routing',
|
||||
title: 'Routing',
|
||||
},
|
||||
{
|
||||
id: 'router-link',
|
||||
title: 'Router link',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
55
src/utils/createFileMapCache.js
Normal file
55
src/utils/createFileMapCache.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import createFsCache from './createFsCache';
|
||||
import crypto from 'crypto';
|
||||
|
||||
async function md5(data) {
|
||||
return crypto.createHash('md5').update(data).digest('hex');
|
||||
}
|
||||
|
||||
async function fileExist(path) {
|
||||
try {
|
||||
await fs.access(path);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export default async function createFileMapCache(name) {
|
||||
const cache = await createFsCache(name);
|
||||
|
||||
async function _getPathHash(path) {
|
||||
return md5(path);
|
||||
}
|
||||
|
||||
async function _getCacheKey(path) {
|
||||
const { mtimeMs } = await fs.stat(path);
|
||||
const pathHash = await _getPathHash(path);
|
||||
return `${pathHash}_${mtimeMs}`;
|
||||
}
|
||||
|
||||
async function set(path, data) {
|
||||
if (await fileExist(path)) {
|
||||
const pathHash = await _getPathHash(path);
|
||||
await cache.cleanKeyStartsWith(pathHash);
|
||||
const cacheKey = await _getCacheKey(path);
|
||||
await cache.set(cacheKey, data);
|
||||
}
|
||||
}
|
||||
|
||||
async function has(path) {
|
||||
const cacheKey = await _getCacheKey(path);
|
||||
return await cache.has(cacheKey);
|
||||
}
|
||||
|
||||
async function get(path) {
|
||||
const cacheKey = await _getCacheKey(path);
|
||||
return await cache.get(cacheKey);
|
||||
}
|
||||
|
||||
return {
|
||||
set,
|
||||
get,
|
||||
has,
|
||||
};
|
||||
}
|
||||
64
src/utils/createFsCache.js
Normal file
64
src/utils/createFsCache.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import { packageDirectory } from 'pkg-dir';
|
||||
|
||||
async function ensureDir(path) {
|
||||
try {
|
||||
await fs.access(path);
|
||||
} catch {
|
||||
await fs.mkdir(path);
|
||||
}
|
||||
}
|
||||
|
||||
export default async function createFsCache(name) {
|
||||
const pkgDir = await packageDirectory();
|
||||
const fsCacheDir = `${pkgDir}/node_modules/.fs-cache`;
|
||||
const cacheDir = `${fsCacheDir}/${name}`;
|
||||
await ensureDir(fsCacheDir);
|
||||
await ensureDir(cacheDir);
|
||||
|
||||
function getPath(key) {
|
||||
return `${cacheDir}/${key}`;
|
||||
}
|
||||
|
||||
async function setKey(key, data) {
|
||||
await fs.writeFile(getPath(key), data);
|
||||
}
|
||||
|
||||
async function getKey(key) {
|
||||
if (await hasKey(key)) {
|
||||
return await fs.readFile(getPath(key), 'utf8');
|
||||
}
|
||||
}
|
||||
|
||||
async function hasKey(key) {
|
||||
try {
|
||||
await fs.access(getPath(key));
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async function deleteKey(key) {
|
||||
if (await hasKey(key)) {
|
||||
return await fs.deleteFile(getPath(key));
|
||||
}
|
||||
}
|
||||
|
||||
async function cleanKeyStartsWith(keyStart, except) {
|
||||
const files = await fs.readdir(cacheDir);
|
||||
for (const file of files) {
|
||||
if (file.startsWith(keyStart) && except && key !== except) {
|
||||
deleteKey(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
set: setKey,
|
||||
get: getKey,
|
||||
has: hasKey,
|
||||
delete: deleteKey,
|
||||
cleanKeyStartsWith,
|
||||
};
|
||||
}
|
||||
41
src/utils/generateContentTree.js
Normal file
41
src/utils/generateContentTree.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
const CONTENT_DIR = path.resolve('content');
|
||||
|
||||
export default async function generateContentTree() {
|
||||
const tree = [];
|
||||
|
||||
const contentDirs = await fs.readdir(CONTENT_DIR);
|
||||
|
||||
for (const contentDir of contentDirs) {
|
||||
const sectionDir = `${CONTENT_DIR}/${contentDir}`;
|
||||
const subSectionDirs = (await fs.readdir(sectionDir)).filter((path) => !path.includes('.'));
|
||||
const contentDirTitle = dirNameToTitle(contentDir);
|
||||
const treeNode = {
|
||||
id: contentDir.split('-').splice(1).join('-'),
|
||||
title: contentDirTitle,
|
||||
sections: [],
|
||||
};
|
||||
|
||||
for (const subSectionDir of subSectionDirs) {
|
||||
const subSectionDirTitle = dirNameToTitle(subSectionDir);
|
||||
treeNode.sections.push({
|
||||
id: subSectionDir.split('-').splice(1).join('-'),
|
||||
title: subSectionDirTitle,
|
||||
});
|
||||
}
|
||||
|
||||
tree.push(treeNode);
|
||||
}
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
function dirNameToTitle(dirName) {
|
||||
return capitalize(dirName.split('-').splice(1).join(' '));
|
||||
}
|
||||
|
||||
function capitalize(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
Reference in New Issue
Block a user