[update] migrate to pnpm from npm and format the code
This commit is contained in:
22
.github/workflows/update-dependencies.yml
vendored
22
.github/workflows/update-dependencies.yml
vendored
@@ -1,8 +1,8 @@
|
||||
name: Update npm Dependencies
|
||||
name: Update pnpm Dependencies
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 4"
|
||||
- cron: "0 0 * * 1"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -13,23 +13,27 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node.js
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "20.10.0"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install latest npm
|
||||
run: npm install -g npm@latest
|
||||
- name: Install pnpm
|
||||
run: npm install -g pnpm
|
||||
|
||||
- name: Update npm dependencies
|
||||
run: npm update
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Update dependencies
|
||||
run: pnpm update
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
git add package-lock.json
|
||||
git commit -m 'chore: update npm dependencies'
|
||||
git add .
|
||||
git commit -m 'chore: update dependencies'
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@@ -1,7 +1,3 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"huacnlee.autocorrect",
|
||||
"biomejs.biome"
|
||||
]
|
||||
"recommendations": ["streetsidesoftware.code-spell-checker", "huacnlee.autocorrect", "biomejs.biome"]
|
||||
}
|
||||
|
||||
19
README-CN.MD
19
README-CN.MD
@@ -51,8 +51,7 @@
|
||||
- [感谢](#感谢)
|
||||
- [开源许可](#开源许可)
|
||||
|
||||
## <!-- /TOC -->
|
||||
|
||||
<!-- /TOC -->
|
||||
### 快速上手
|
||||
|
||||
着手本项目之前,我在此假设你已经具备以下知识水平:
|
||||
@@ -66,7 +65,7 @@
|
||||
本项目要求的运行环境如下:
|
||||
|
||||
- node.js v18+
|
||||
- npm v9+
|
||||
- pnpm v9+
|
||||
- Chromium 系浏览器(Chrome、Edge)或者 Firefox。
|
||||
|
||||
我推荐使用 Visual Studio Code 作为开发工具。
|
||||
@@ -74,7 +73,7 @@
|
||||
执行脚本以安装依赖,
|
||||
|
||||
```bash
|
||||
npm install
|
||||
pnpm install
|
||||
```
|
||||
|
||||
#### 创建博客
|
||||
@@ -84,7 +83,7 @@ npm install
|
||||
你应该使用脚本来创建帖子。
|
||||
|
||||
```bash
|
||||
npm run newpost
|
||||
pnpm run newpost
|
||||
```
|
||||
|
||||
然后程序会问你一些问题,你只需要根据问题输入你的回答,程序会自动为你创建一个新帖子文件并打开它。
|
||||
@@ -151,13 +150,13 @@ allowShare: true
|
||||
在开发环境下执行项目。
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
当然你可以使用 Turbo Build 来执行开发模式,它在项目热刷新上有良好的性能。
|
||||
|
||||
```bash
|
||||
npm run dev:turbo
|
||||
pnpm run dev:turbo
|
||||
```
|
||||
|
||||
#### 构建
|
||||
@@ -165,13 +164,13 @@ npm run dev:turbo
|
||||
构建项目,可执行
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
或者使用 Turbo Build 构建项目,以提高性能
|
||||
|
||||
```bash
|
||||
npm run build:turbo
|
||||
pnpm run build:turbo
|
||||
```
|
||||
|
||||
### 数据与配置
|
||||
@@ -186,7 +185,7 @@ npm run build:turbo
|
||||
本项目可以提供对博客文件、配置等用户数据的一键打包、还原功能,以便于项目升级时迁移或者备份、恢复数据,可以使用脚本工具
|
||||
|
||||
```bash
|
||||
npm run archive
|
||||
pnpm run archive
|
||||
```
|
||||
|
||||
来实现。运行脚本后,给你提供打包用户数据和还原用户数据两个选项:`Pack to archive the user data` 和 `Unpack and restore user data` ,分别用于打包归档用户数据和解包恢复用户数据。
|
||||
|
||||
18
README.MD
18
README.MD
@@ -28,6 +28,7 @@ It is a responsive website with good support for most different screen sizes ava
|
||||
<!-- TOC -->
|
||||
|
||||
- [NEXT.JS LEXICAL](#nextjs-lexical)
|
||||
- [](#)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Initialize Project](#initialize-project)
|
||||
- [Creating a Blog Post](#creating-a-blog-post)
|
||||
@@ -51,6 +52,7 @@ It is a responsive website with good support for most different screen sizes ava
|
||||
- [Thanks](#thanks)
|
||||
- [Open Source License](#open-source-license)
|
||||
|
||||
<!-- /TOC -->
|
||||
## <!-- /TOC -->
|
||||
|
||||
### Quick Start
|
||||
@@ -66,7 +68,7 @@ Before diving into this project, I assume you already have the following knowled
|
||||
The required runtime environment for this project is as follows:
|
||||
|
||||
- Node.js v18+
|
||||
- npm v9+
|
||||
- pnpm v9+
|
||||
- Chromium-based browser (Chrome, Edge) or Firefox.
|
||||
|
||||
I recommend using Visual Studio Code as the development tool.
|
||||
@@ -74,7 +76,7 @@ I recommend using Visual Studio Code as the development tool.
|
||||
Execute the following script to install dependencies:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
pnpm install
|
||||
```
|
||||
|
||||
#### Creating a Blog Post
|
||||
@@ -84,7 +86,7 @@ All blog files should be written in Markdown and stored in the `/data/posts` dir
|
||||
You should use a script to create the post.
|
||||
|
||||
```bash
|
||||
npm run newpost
|
||||
pnpm run newpost
|
||||
```
|
||||
|
||||
Then, the program will ask you a series of questions. Simply input your answers according to the prompts, and the program will automatically create a new post file for you and open it.
|
||||
@@ -154,13 +156,13 @@ The `summary` field is a general summary of the article, which will be displayed
|
||||
Run the project in development mode.
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
Alternatively, you can use Turbo Build for development mode, which has good performance for hot reloading.
|
||||
|
||||
```bash
|
||||
npm run dev:turbo
|
||||
pnpm run dev:turbo
|
||||
```
|
||||
|
||||
#### Build
|
||||
@@ -168,13 +170,13 @@ npm run dev:turbo
|
||||
Build the project by running:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
Or use Turbo Build for building the project to enhance performance:
|
||||
|
||||
```bash
|
||||
npm run build:turbo
|
||||
pnpm run build:turbo
|
||||
```
|
||||
|
||||
### Data and Configuration
|
||||
@@ -189,7 +191,7 @@ The blog's configuration files are located in the `./data` directory, and there
|
||||
This project offers a convenient feature for one-click packaging and restoration of user data, including blog files and configurations. This is particularly useful for data migration, backup, or restoration during project upgrades. You can use the following script tool for this purpose:
|
||||
|
||||
```bash
|
||||
npm run archive
|
||||
pnpm run archive
|
||||
```
|
||||
|
||||
When you run this script, you'll be presented with two options: `Pack to archive the user data` and `Unpack and restore user data`. These options allow you to package your blog files, configuration files, and other data into a `*.tar.gz` file for archiving or to unpack and restore your user data from an archive.
|
||||
|
||||
16619
package-lock.json
generated
16619
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -108,6 +108,5 @@
|
||||
"tar": "^7.0.1",
|
||||
"turbo": "^2.0.12",
|
||||
"webpack-obfuscator": "^3.5.1"
|
||||
},
|
||||
"packageManager": "npm@10.2.3"
|
||||
}
|
||||
}
|
||||
|
||||
9004
pnpm-lock.yaml
generated
Normal file
9004
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user