Skip to content

Commit

Permalink
Merge pull request #145 from bilibili/feat/pnpm
Browse files Browse the repository at this point in the history
Feat/pnpm
  • Loading branch information
hughfenghen authored Jun 23, 2024
2 parents 7ed9f62 + 50d196f commit 6a56928
Show file tree
Hide file tree
Showing 23 changed files with 21,053 additions and 22,096 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [["@webav/*"]],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
14 changes: 5 additions & 9 deletions .github/workflows/deploy-doc-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,18 @@ jobs:
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18 # 或者您需要的 Node.js 版本
node-version: 20

- name: Install packages dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Build:api
run: yarn build && yarn build:api

- name: Install doc-site dependencies
run: yarn install --frozen-lockfile
working-directory: ./doc-site
run: pnpm build && pnpm build:api

- name: Build doc-site
run: yarn build
run: pnpm build
working-directory: ./doc-site

- name: Setup Pages
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request
uses: changesets/action@v1
with:
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
version: pnpm upver
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
dist
yarn.lock
.yarn
.dumi
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ recorder.start(); // => ReadableStream
### Running the Project

1. Clone the current project locally
2. Execute `yarn install && yarn build` in the root directory
3. Change directory to the specific package (e.g., av-cliper) and run `yarn dev`
2. Execute `pnpm install && pnpm build` in the root directory
3. Change directory to the specific package (e.g., av-cliper) and run `pnpm dev`
4. The path is the filename in the DEMO directory, such as `concat-media.html`
5. Open the DEMO URL in the browser, such as `http://localhost:6066/concat-media.html`
6. Run unit tests for the package with `yarn test`
6. Run unit tests for the package with `pnpm test`

### Running the WebAV Site

1. Clone the current project locally
2. Execute `yarn install && yarn build` in the root directory
3. Change directory to `doc-site` and run `yarn dev`
2. Execute `pnpm install && pnpm build` in the root directory
3. Change directory to `doc-site` and run `pnpm dev`
4. Follow the terminal prompts to visit the specified URL

If you are a beginner in the field of web audio and video, you can start by learning the basics:
Expand Down
10 changes: 5 additions & 5 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ recorder.start(); // => ReadableStream
### 运行项目

1. clone 当前项目到本地
2. 在根目录下执行 `yarn install && yarn build`
3. cd 跳转到特定 package (假设为 av-cliper),运行 `yarn dev`
2. 在根目录下执行 `pnpm install && pnpm build`
3. cd 跳转到特定 package (假设为 av-cliper),运行 `pnpm dev`
4. path 为 DEMO 目录下的文件名,如 `concat-media.html`
5. 在浏览器中打开 DEMO URL,如 `http://localhost:6066/concat-media.html`
6. `yarn test` 运行该 package 的单元测试
6. `pnpm test` 运行该 package 的单元测试

### 运行 WebAV 站点

1. clone 当前项目到本地
2. 在根目录下执行 `yarn install && yarn build`
3. cd 跳转到 `doc-site` 目录,执行 `yarn dev`
2. 在根目录下执行 `pnpm install && pnpm build`
3. cd 跳转到 `doc-site` 目录,执行 `pnpm dev`
4. 根据终端提示,访问指定 URL

如果你是 Web 音视频领域的初学者,可以先了解入门知识
Expand Down
6 changes: 3 additions & 3 deletions doc-site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ A static site base on [dumi](https://d.umijs.org).

```bash
# install dependencies
$ yarn install
$ pnpm install

# start dev server
$ yarn start
$ pnpm start

# build docs
$ yarn run build
$ pnpm run build
```
8 changes: 4 additions & 4 deletions doc-site/docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ npm install @webav/av-cliper

# or

yarn add @webav/av-cliper
pnpm add @webav/av-cliper
```

## API
Expand All @@ -44,11 +44,11 @@ WebAV 项目包含三个模块,使用 TypeDoc 生成 API 文档

若你对 WebAV 感兴趣,可以尝试在本地启动项目

1. 安装依赖:在根目录执行 `yarn install`
2. 构建所有 packages:在根目录执行 `yarn build`
1. 安装依赖:在根目录执行 `pnpm install`
2. 构建所有 packages:在根目录执行 `pnpm build`
3. 运行 DEMO
1. cd 到特定的 package 目录,比如 `cd packages/av-cliper`
2. 执行 `yarn dev`
2. 执行 `pnpm dev`
4. 访问 DEMO
1. 复制控制台中打印的 baseUrl,类似 `http://localhost:6066/`
2. 确定对应 DEMO 的 path,是 `packages/av-cliper/demo` 目录下的文件名,如 `concat-media.html`
Expand Down
2 changes: 1 addition & 1 deletion doc-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "WebAV-Doc-Site",
"version": "0.0.1",
"description": "WebAV-Doc-Site",
"private": true,
"scripts": {
"start": "npm run dev",
"dev": "dumi dev",
"build": "dumi build"
},
Expand Down
Loading

0 comments on commit 6a56928

Please sign in to comment.