Skip to content

Commit 769fe00

Browse files
authored
v1.0.0 (beta) (#622)
* refinement * mark as wip * mark as wip * update env * update env * add tests * chore licens * chore * add playwright * fmt * int:text * chore component emits * feat: unhandled props * feat: unhandled props * feat: slot * feat * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement * refinement
1 parent 329b466 commit 769fe00

4,463 files changed

Lines changed: 235222 additions & 92072 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/contributing.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ First, let's talk about the top-level directories:
1616
```sh
1717
book # Contains materials related to the online book
1818

19-
packages # Contains the latest source code of chibivue. Not directly related to the online book.
19+
impl # Contains the latest source code of chibivue packages (runtime-core, runtime-dom, reactivity, compiler-core, compiler-dom, compiler-sfc, compiler-vapor, runtime-vapor, server-renderer, etc.)
2020

2121
examples # Contains sample code using the packages. Not directly related to the online book.
2222

@@ -48,32 +48,85 @@ You can choose any name for the repository. Feel free to set other information a
4848

4949
#### Installing the necessary tools
5050

51-
- [Node.js](https://nodejs.org/en) (v22.x)
52-
- [pnpm](https://pnpm.io/) (v9.x)
51+
- [Node.js](https://nodejs.org/en) (v24+)
52+
- [pnpm](https://pnpm.io/) (v10+)
5353
- [@antfu/ni](https://github.com/antfu/ni)
5454
ni is a great package manager wrapper created by [Anthony Fu](https://github.com/antfu). We assume the use of ni in the chibivue documentation.
5555

56-
### Starting the playground
56+
### Getting Started
5757

58-
First, install the dependencies.
58+
First, install the dependencies and set up the playground.
5959

6060
```sh
61-
ni
61+
ni && nr setup
6262
```
6363

64-
Then, run the following command to start the development server for the online book.
64+
Then, you can start the development server.
6565

6666
```sh
67-
nr book:dev
67+
nr dev
6868
```
6969

70+
### Available Scripts
71+
72+
| Script | Description |
73+
|--------|-------------|
74+
| **Setup** | |
75+
| `setup` | Install dependencies and generate playground |
76+
| `setup:dev` | Generate playground files to examples/playground |
77+
| `setup:vue` | Set up Vue.js core comparison environment |
78+
| `setup:book` | Generate chibivue implementation for book readers |
79+
| **Development** | |
80+
| `dev` | Start playground dev server |
81+
| `dev:app` | Start app example dev server |
82+
| `dev:vapor` | Start vapor mode example dev server |
83+
| `dev:vue` | Start Vue.js core dev server for comparison |
84+
| **Build & Quality** | |
85+
| `build` | Build all packages |
86+
| `clean` | Remove all dist folders |
87+
| `typecheck` | Run type checking (tsgo) |
88+
| `lint` | Run linter (oxlint) |
89+
| `lint:fix` | Run linter with auto-fix |
90+
| `fmt` | Format code (oxfmt) |
91+
| `fmt:check` | Check code formatting |
92+
| `test` | Run tests once |
93+
| `test:watch` | Run tests in watch mode |
94+
| `check` | Run all checks (lint, fmt, typecheck, build, test) |
95+
| **Book** | |
96+
| `dev` | Start online book dev server |
97+
| `build` | Build online book |
98+
| `preview` | Preview built online book |
99+
| `lint:text` | Lint book text |
100+
101+
### Running book chapter implementations
102+
70103
If you want to run the source code for each chapter, you can do so with the following command.
71104

72105
```sh
73106
cd book/impls/${section-name}/${chapter-name}
74107
nr dev
75108
```
76109

110+
### Book Playground
111+
112+
The project includes a WebContainer-based playground (`book/playground`) that allows readers to try each chapter's implementation directly in the browser.
113+
114+
To start the playground:
115+
116+
```sh
117+
nr play:generate # Generate chapter data from book/impls
118+
nr play # Start the playground dev server
119+
```
120+
121+
The playground supports:
122+
- Selecting different chapters to explore
123+
- Editing code with Monaco editor
124+
- Running the development server in the browser
125+
- Persisting edits to localStorage
126+
- Resetting files to their original state
127+
128+
If you modify chapter implementations in `book/impls/`, run `nr play:generate` to update the playground data.
129+
77130
#### Creating a branch (start making changes)
78131

79132
Clone the forked repository and create a branch.
@@ -125,6 +178,6 @@ Basically, all PRs are managed by @ubugeeei, so please contact @ubugeeei for any
125178

126179
This is a guide to the changes you make. Here are a few points to keep in mind.
127180

128-
- When making changes to the online book, please make sure that the content is consistent in both the Japanese and English versions.
181+
- When making changes to the online book, please make sure that the content is consistent across all language versions (English, Japanese, Simplified Chinese, Traditional Chinese).
129182
- When making changes to the source code of each chapter, please appropriately incorporate those changes into the source code of subsequent chapters.
130183
- When including images, figures, or text from other sources, please make sure to provide proper attribution.

.github/workflows/check.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '**'
77

88
permissions:
9-
contents: read # to fetch code (actions/checkout)
9+
contents: read
1010

1111
jobs:
1212
check:
@@ -16,39 +16,50 @@ jobs:
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19+
1920
- name: Setup Node
2021
uses: actions/setup-node@v4
2122
with:
22-
node-version: 22
23-
- uses: pnpm/action-setup@v2
23+
node-version-file: 'package.json'
24+
25+
- uses: pnpm/action-setup@v4
2426
name: Install pnpm
25-
with:
26-
version: 9
27-
run_install: false
27+
2828
- name: Get pnpm store directory
2929
shell: bash
30-
run: |
31-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
30+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
31+
3232
- uses: actions/cache@v4
3333
name: Setup pnpm cache
3434
with:
3535
path: ${{ env.STORE_PATH }}
3636
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3737
restore-keys: |
3838
${{ runner.os }}-pnpm-store-
39+
3940
- name: Install dependencies
4041
run: pnpm install
42+
43+
- name: Install Playwright browsers
44+
run: pnpm exec playwright install --with-deps chromium
45+
4146
- name: Check fmt
4247
run: pnpm fmt:check
48+
4349
- name: Check lint
4450
run: pnpm lint
51+
4552
- name: Check lint text
4653
run: pnpm lint:text
54+
4755
- name: Check types
48-
run: pnpm tsc --noEmit
49-
- name: Check building
50-
run: pnpm build
51-
- name: Check test (e2e)
56+
run: pnpm check
57+
58+
- name: Check impl building
59+
run: pnpm impl:build
60+
61+
- name: Check test
5262
run: pnpm test
63+
5364
- name: Build book
54-
run: pnpm run book:build
65+
run: pnpm build

.github/workflows/deploy.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
26+
2627
- name: Check if it's the original repo and the main branch
2728
run: |
2829
if [[ "${{ github.repository }}" == "ubugeeei/chibivue" && "${{ github.ref }}" == "refs/heads/main" ]]; then
@@ -31,32 +32,36 @@ jobs:
3132
echo "This is a fork or a different branch, skipping the workflow."
3233
exit 0
3334
fi
35+
3436
- name: Setup Node
3537
uses: actions/setup-node@v4
3638
with:
37-
node-version: 22
38-
- uses: pnpm/action-setup@v2
39+
node-version-file: 'package.json'
40+
41+
- uses: pnpm/action-setup@v4
3942
name: Install pnpm
40-
with:
41-
version: 9
42-
run_install: false
43+
4344
- name: Get pnpm store directory
4445
shell: bash
45-
run: |
46-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
46+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
47+
4748
- uses: actions/cache@v4
4849
name: Setup pnpm cache
4950
with:
5051
path: ${{ env.STORE_PATH }}
5152
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
5253
restore-keys: |
5354
${{ runner.os }}-pnpm-store-
55+
5456
- name: Setup Pages
5557
uses: actions/configure-pages@v5
58+
5659
- name: Install dependencies
5760
run: pnpm install
61+
5862
- name: Build with VitePress
59-
run: pnpm run book:build
63+
run: pnpm build
64+
6065
- name: Upload artifact
6166
uses: actions/upload-pages-artifact@v3
6267
with:
@@ -69,11 +74,3 @@ jobs:
6974
- name: Deploy to GitHub Pages
7075
id: deployment
7176
uses: actions/deploy-pages@v4
72-
73-
notify:
74-
runs-on: ubuntu-latest
75-
needs: deploy
76-
steps:
77-
- name: notify
78-
run: |
79-
curl -H 'Content-Type:application/json' "${{secrets.DISCORD_WEBHOOK_URL}}" -d '{"content": "Deployed Online Book!\n ${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}"}'

.oxlintrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/oxc-project/oxlint/main/npm/oxlint/configuration_schema.json",
3+
"ignorePatterns": ["examples/vuejs-core"],
4+
"rules": {
5+
"no-unused-vars": "off",
6+
"no-unused-expressions": "off",
7+
"no-useless-escape": "off",
8+
"no-this-alias": "off",
9+
"no-async-promise-executor": "off",
10+
"only-used-in-recursion": "off",
11+
"no-non-null-asserted-optional-chain": "off",
12+
"no-wrapper-object-types": "off",
13+
"unicorn/no-new-array": "off",
14+
"unicorn/no-useless-spread": "off",
15+
"unicorn/no-useless-fallback-in-spread": "off"
16+
}
17+
}

.prettierignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"oxc.oxc-vscode"
4+
]
5+
}

.vscode/settings.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
"lightningcss",
1919
"nocheck",
2020
"onwarn",
21+
"oxfmt",
22+
"oxlint",
2123
"paren",
2224
"Parens",
2325
"RAWTEXT",
2426
"RCDATA",
2527
"resetsix",
28+
"rolldown",
2629
"textlint",
2730
"tokei",
28-
"tseslint",
2931
"unref",
3032
"vdom",
3133
"vitepress",
@@ -40,5 +42,11 @@
4042
"vuejs-core": "vue",
4143
"@extensions": "lib"
4244
},
43-
"material-icon-theme.files.associations": {}
45+
"material-icon-theme.files.associations": {},
46+
"editor.formatOnSave": true,
47+
"editor.defaultFormatter": "oxc.oxc-vscode",
48+
"editor.codeActionsOnSave": {
49+
"source.fixAll.oxc": "explicit"
50+
},
51+
"oxc.enable": true
4452
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023-present ubugeeei
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)