diff --git a/.gitignore b/.gitignore index e43b0f98..e23cfeb7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .DS_Store +node_modules +*.log +.cache diff --git a/.script/commit.bat b/.scripts/commit.bat similarity index 100% rename from .script/commit.bat rename to .scripts/commit.bat diff --git a/.script/commit.sh b/.scripts/commit.sh similarity index 100% rename from .script/commit.sh rename to .scripts/commit.sh diff --git a/.scripts/constant.ts b/.scripts/constant.ts new file mode 100644 index 00000000..90281bfd --- /dev/null +++ b/.scripts/constant.ts @@ -0,0 +1,16 @@ +import { docs } from "./docs"; + +export const DOCS_GROUP = Object.keys(docs); +export const FE_GROUP = [ + "HTML", + "CSS", + "JavaScript", + "Browser", + "Vue", + "React", + "Plugin", + "Patterns", + "Linux", + "LeetCode", +]; + diff --git a/.script/overview.ts b/.scripts/docs.ts similarity index 100% rename from .script/overview.ts rename to .scripts/docs.ts diff --git a/.scripts/overview.ts b/.scripts/overview.ts new file mode 100644 index 00000000..e69de29b diff --git a/.scripts/sync-blog.ts b/.scripts/sync-blog.ts new file mode 100644 index 00000000..3218b4e0 --- /dev/null +++ b/.scripts/sync-blog.ts @@ -0,0 +1,16 @@ +import path from "node:path"; +import { exec as aliasExec } from "node:child_process"; +import { promisify } from "node:util"; +import { DOCS_GROUP } from "./constant"; + +const exec = promisify(aliasExec); + +(async () => { + console.log("Syncing Blog..."); + for (const group of DOCS_GROUP) { + console.log("Processing", group); + const from = path.resolve(__dirname, `../${group}`); + const to = path.resolve(__dirname, `../../Blog/`); + await exec(`cp -r ${from} ${to}`); + } +})(); diff --git a/.scripts/sync-ssg.ts b/.scripts/sync-ssg.ts new file mode 100644 index 00000000..5d47a5dc --- /dev/null +++ b/.scripts/sync-ssg.ts @@ -0,0 +1,20 @@ +import path from "node:path"; +import { exec as aliasExec } from "node:child_process"; +import { promisify } from "node:util"; +import { DOCS_GROUP } from "./constant"; + +const exec = promisify(aliasExec); + +(async () => { + console.log("Syncing SSG..."); + for (const group of DOCS_GROUP) { + console.log("Processing", group); + const from = path.resolve(__dirname, `../${group}`); + const to = path.resolve(__dirname, `../../Blog-SSG/docs/zh-cn`); + await exec(`cp -r ${from} ${to}`); + } + console.log("Processing", "I18N"); + const from = path.resolve(__dirname, `../i18n/`); + const to = path.resolve(__dirname, `../../Blog-SSG/docs/en-us`); + await exec(`cp -r ${from}/* ${to}`); +})(); diff --git "a/I18N/Plugin/\345\210\235\346\216\242\345\257\214\346\226\207\346\234\254\344\271\213\347\274\226\350\276\221\345\231\250\345\274\225\346\223\216.md" "b/I18N/Plugin/\345\210\235\346\216\242\345\257\214\346\226\207\346\234\254\344\271\213\347\274\226\350\276\221\345\231\250\345\274\225\346\223\216.md" index f3c3e357..93118044 100644 --- "a/I18N/Plugin/\345\210\235\346\216\242\345\257\214\346\226\207\346\234\254\344\271\213\347\274\226\350\276\221\345\231\250\345\274\225\346\223\216.md" +++ "b/I18N/Plugin/\345\210\235\346\216\242\345\257\214\346\226\207\346\234\254\344\271\213\347\274\226\350\276\221\345\231\250\345\274\225\346\223\216.md" @@ -153,11 +153,13 @@ The **data structure** of a piece of text with emphasis is as follows. * `draft` `codesandbox` example: `https://codesandbox.io/s/github/gupta-piyush19/Draft-JS-Editor`. ## Every Day One Question + ``` https://github.com/WindrunnerMax/EveryDay ``` ## References + ``` https://github.com/hzjswlgbsj/blog https://zhuanlan.zhihu.com/p/425265438 diff --git a/README.md b/README.md index a023a0b9..64a78c9f 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ 如果觉得还不错,点个`star`吧 😁 -这是一个前端小白的学习历程,如果只学习而不记录点什么那基本就等于白学了。这个版本库的名字`EveryDay`就是希望激励我能够每天学习,下面的文章就是从`2020.02.25`开始积累的前端相关文章,都是参考众多文章归纳整理学习而写的,文章包括了`HTML`基础、`CSS`基础、`JavaScript`基础与拓展、`Browser`浏览器相关、`Vue`使用与分析、`React`使用与分析、`Plugin`插件相关、`Patterns`设计模式、`Linux`命令、`LeetCode`题解等类别,内容都是比较基础的,毕竟我也还是个小白,此外基本上每个示例都是本着能够即时运行为目标的,新建一个`HTML`文件复制之后即可在浏览器运行或者直接可以在`console`中运行。 +这是一个前端小白的学习历程,如果只学习而不记录点什么那基本就等于白学了。这个版本库的名字`EveryDay`就是希望激励我能够每天学习,下面的文章就是从`2020.02.25`开始积累的文章,都是参考众多文章归纳整理学习而写的,文章包括了`HTML`基础、`CSS`基础、`JavaScript`基础与拓展、`Browser`浏览器相关、`Vue`使用与分析、`React`使用与分析、`Plugin`插件相关、`Patterns`设计模式、`Linux`命令、`LeetCode`题解等类别,内容都是比较基础的,毕竟我也还是个小白,此外基本上每个示例都是本着能够即时运行为目标的,新建一个`HTML`文件复制之后即可在浏览器运行或者直接可以在`console`中运行。 -如果想按照前端笔记顺序进行阅读的话可以 [查看目录](./Timeline.md) ,另外如果想更条理地查看的话可以访问 [我的博客](https://blog.touchczy.top/),博客同时也是本版本库的`gh-pages`分支,是作为纯静态页面搭建在`Git Pages`上的,使用`jsdelivr`以及`cloudflare`作为缓存缓解国内访问速度问题。后期还在`gh-pages-ssg`分支上部署了`SSG`版本的 [新版博客](https://blog-ssg.touchczy.top/),并且借助`ChatGPT`提供了英文翻译版本,分支是部署在`Vercel`上来缓解国内访问速度问题。在博客中的内容就相对比较多了,除了学习笔记之外还有一些做项目时的记录以及遇到的坑等。`HXDM`如果觉得还不错,点个`star`吧,这个对我真的很重要。 +如果想按照笔记顺序进行阅读的话可以 [查看目录](./Timeline.md) ,另外如果想更条理地查看的话可以访问 [我的博客](https://blog.touchczy.top/),博客同时也是本版本库的`gh-pages`分支,是作为纯静态页面搭建在`Git Pages`上的,使用`jsdelivr`以及`cloudflare`作为缓存缓解国内访问速度问题。后期还在`gh-pages-ssg`分支上部署了`SSG`版本的 [新版博客](https://blog-ssg.touchczy.top/),并且借助`ChatGPT`提供了英文翻译版本,分支是部署在`Vercel`上来缓解国内访问速度问题。在博客中的内容就相对比较多了,除了学习笔记之外还有一些做项目时的记录以及遇到的坑等。`HXDM`如果觉得还不错,点个`star`吧,这个对我真的很重要。 ## HTML diff --git a/package.json b/package.json new file mode 100644 index 00000000..8a0fa3b3 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "scripts": { + "sync:blog": "ts-node ./.scripts/sync-blog.ts", + "sync:ssg": "ts-node ./.scripts/sync-ssg.ts", + "sync": "npm run sync:blog && npm run sync:ssg" + }, + "devDependencies": { + "@types/node": "^22.9.0", + "ts-node": "10.9.1" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..9f478f12 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,140 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +devDependencies: + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@22.9.0)(typescript@5.6.3) + +packages: + + /@cspotcode/source-map-support@0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + + /@jridgewell/resolve-uri@3.1.2: + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec@1.5.0: + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + dev: true + + /@jridgewell/trace-mapping@0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + dev: true + + /@tsconfig/node10@1.0.11: + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + dev: true + + /@tsconfig/node12@1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14@1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16@1.0.4: + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + dev: true + + /@types/node@22.9.0: + resolution: {integrity: sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==} + dependencies: + undici-types: 6.19.8 + dev: true + + /acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + dependencies: + acorn: 8.14.0 + dev: true + + /acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + + /create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + + /diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /ts-node@10.9.1(@types/node@22.9.0)(typescript@5.6.3): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.9.0 + acorn: 8.14.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.6.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + dev: true + + /v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + + /yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..5d169423 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "esModuleInterop": true + }, + "include": ["./.scripts/*"] +}