Skip to content

Commit

Permalink
fix: 完善开发文档
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 23, 2024
1 parent 1d91192 commit 51bbf7b
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 1 deletion.
48 changes: 48 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Development

## Prerequisites

```bash
pnpm install
```

## Development

serve

```bash
pnpm serve
```

dev

```bash
pnpm dev -p siyuan
# pnpm dev -p widget -t
# pnpm dev -p static
```

## Build

```bash
pnpm package
```

artifacts structure

```
├── build
├── package-widget.zip
├── package.zip
├── siyuan-plugin-publisher-1.19.1.zip
├── sy-post-publisher-chrome-1.19.1.zip
├── sy-post-publisher-edge-1.19.1.zip
├── sy-post-publisher-firefox-1.19.1.zip
└── sy-post-publisher-widget-1.19.1.zip
```

## Sync to legacy widget repo

```bash
pnpm syncWidgetRepo
```
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ If you're interested in the paid professional version, please check the paied

Please check [CHANGELOG](./CHANGELOG.MD)

## Development

Please refer to [DEVELOPMENT.md](./DEVELOPMENT.md)

## Platform List

Names not listed in order
Expand Down
4 changes: 4 additions & 0 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

请直接查看 [CHANGELOG](./CHANGELOG.md)

## 开发

请参考 [DEVELOPMENT.md](./DEVELOPMENT.md)

## 平台列表

排名不分先后
Expand Down
16 changes: 15 additions & 1 deletion scripts/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
# or visit www.terwer.space if you need additional information or have any
# questions.
import argparse
import os

import scriptutils
Expand All @@ -31,8 +32,21 @@
# Get the current working directory.
cwd = scriptutils.get_workdir()

# Parse arguments.
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--dist", required=False, help="the dist for building files")
parser.add_argument("-v", "--verbose", action="store_true", help="Enable verbose output.")
parser.add_argument("-p", "--platform", help="Build for different platforms, like siyuan, widget, static.")
parser.add_argument("-t", "--type", help="Build browser extension for publishing, like chrome, edge, firefox.")
args = parser.parse_args()

if args.verbose:
print("Verbose mode enabled.")

# 设置环境变量
os.environ['BUILD_TYPE'] = 'siyuan'
if not args.platform:
args.platform = 'siyuan'
os.environ['BUILD_TYPE'] = args.platform

os.system("zhi-build --serve --production")
os.system("vue-tsc --noEmit && vite build --watch")
1 change: 1 addition & 0 deletions scripts/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
os.environ['VITE_SIYUAN_API_URL'] = URL
os.environ['VITE_SIYUAN_AUTH_TOKEN'] = TOKEN
os.environ['VITE_SIYUAN_COOKIE'] = COOKIE
# os.environ['VITE_CJS_TRACE'] = 'true'

os.system("vite")

0 comments on commit 51bbf7b

Please sign in to comment.