Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

136 需要先切到you router #138

Merged
merged 56 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
9b815f0
first commit you_router
chen56 Apr 24, 2024
eae131a
first commit better_ui
chen56 Apr 24, 2024
bbdc32d
update pubspec.yaml deps
chen56 Apr 24, 2024
9f52144
- lines_longer_than_80_chars: false
chen56 Apr 24, 2024
767cecf
update Router config api usecase
chen56 Apr 24, 2024
ed1382e
// ignore: implementation_imports, internal import /src of the same p…
chen56 Apr 24, 2024
0d45fc3
learn_dart update
chen56 Apr 24, 2024
0de554d
gen update
chen56 Apr 24, 2024
799d633
remove all note.g.dart
chen56 Apr 24, 2024
b7599b9
note.dart > page.dart....
chen56 Apr 24, 2024
a1b75b6
note.dart > page.dart....
chen56 Apr 24, 2024
b344a7c
note.dart > page.dart....
chen56 Apr 24, 2024
07bf11e
lib/notes > lib/pages/notes
chen56 Apr 24, 2024
efef967
clean dead code
chen56 Apr 24, 2024
9550ef5
改变you_*版本为开发版:0.0.6-dev.1
chen56 Apr 24, 2024
92ed59d
fixed: gen dir
chen56 Apr 25, 2024
8417d64
gen pages.g.dart: 1. env code ok
chen56 Apr 25, 2024
9a2f64c
gen pages.g.dart: 2. recursive create page node
chen56 Apr 25, 2024
c9a4cb4
gen pages.g.dart: 2.1 recursive create page node
chen56 Apr 25, 2024
db1b3c4
gen pages.g.dart: 2.2 recursive create page node
chen56 Apr 25, 2024
287d655
gen pages.g.dart: 2.3 you_flutter/router.dart add PageBuilderAsync
chen56 Apr 25, 2024
68eca80
gen pages.g.dart: 3. 生成器已完工,待接入替换原note路由
chen56 Apr 25, 2024
ff21fe2
gen pages.g.dart: 3.1 生成器已完工,微调,异步和同步都提供
chen56 Apr 25, 2024
30d0f90
遇到布局问题,临时复习总结一下布局相关知识点和组件
chen56 Apr 26, 2024
b564ca9
gen pages.g.dart: 4.已调通一个简单的note layout 模版,左树形导航,右note page,但目前not fo…
chen56 Apr 26, 2024
0f90771
gen pages.g.dart: 6.
chen56 Apr 26, 2024
16ad32e
清理
chen56 Apr 26, 2024
7a52a71
清理
chen56 Apr 26, 2024
b8e1440
清理
chen56 Apr 26, 2024
a87f4ab
清理
chen56 Apr 26, 2024
7a539fb
清理
chen56 Apr 26, 2024
373834b
让layout左侧的树结构过滤掉没有配置pageBuilder的叶子结点
chen56 Apr 26, 2024
68064f9
clean
chen56 Apr 26, 2024
1415beb
clean,准备lib/pages 改为 lib/routes
chen56 Apr 27, 2024
107d753
clean,准备lib/pages 改为 lib/routes
chen56 Apr 27, 2024
ac1b95b
重构生成routes.g.dart的逻辑
chen56 Apr 27, 2024
f42f7e3
add To.lazy
chen56 Apr 27, 2024
a3393d3
cli gen routes.g.dart add padding
chen56 Apr 27, 2024
ab8509c
准备给To增加继承的能力,观察下是否把接口适配放在layout还是To更合适
chen56 Apr 27, 2024
88eafa3
增加了ToNote的解析器,待修正Cli的生成routes.g.dart代码
chen56 Apr 28, 2024
e65b258
整理learn_dart
chen56 Apr 28, 2024
3617ea4
整理learn_dart
chen56 Apr 28, 2024
c3ed776
整理learn_dart
chen56 Apr 28, 2024
b86f923
整理learn_dart
chen56 Apr 28, 2024
a908c5c
尝试了下,组合成code_builder根lib是可以的
chen56 Apr 28, 2024
e41a5e7
临时提交
chen56 Apr 28, 2024
c89f4ca
ToType指定扩展,已完成
chen56 Apr 28, 2024
9d9e67b
完美生成routes.g.dart sync代码,待async
chen56 Apr 29, 2024
529b1d0
完美生成routes.g.dart sync代码,待async
chen56 Apr 29, 2024
d5c8481
remove flutter assets
chen56 Apr 29, 2024
a34ba78
临时提交
chen56 Apr 30, 2024
48b6981
remove PageBuilder ToUri args
chen56 Apr 30, 2024
c1cec5d
remove To.layout
chen56 Apr 30, 2024
394e99d
debug , To的继承有点问题,继承后,layout,builder信息丢了
chen56 Apr 30, 2024
ff004bd
clean lint
chen56 Apr 30, 2024
c4f712e
clean
chen56 Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 0 additions & 30 deletions .metadata

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ you can run it local by yourself:
```bash
git clone [email protected]:chen56/note.git
./bake install
./bake flutter dev # run as local macos app
./bake flutter dev_web # run as local web app
./bake flutter_web dev # run as local macos app
./bake flutter_web dev_html # run as local web html app
```
73 changes: 45 additions & 28 deletions bake
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ cd "$_ROOT_DIR" || exit 200
source "packages/you_bake/bake.bash"

declare -A _pkgs=(
["root"]="$_ROOT_DIR"
["bake"]="$_ROOT_DIR/packages/you_bake"
["you_dart"]="$_ROOT_DIR/packages/you_dart"
["you_flutter"]="$_ROOT_DIR/packages/you_flutter"
["you_note_dart"]="$_ROOT_DIR/packages/you_note_dart"
["you_cli"]="$_ROOT_DIR/packages/you_cli"
["learn_dart"]="$_ROOT_DIR/notes/learn_dart"
["root"]="$_ROOT_DIR"
["flutter_web"]="$_ROOT_DIR/notes/flutter_web"
["qwik"]="$_ROOT_DIR/notes/qwik"
["shell"]="$_ROOT_DIR/notes/shell"
Expand Down Expand Up @@ -97,7 +98,7 @@ _run() {
local pkg=${1:?required project arg,Usage: _run_at_pkg <pkg>}
shift
local cmd="${1}"
[[ "$cmd" != "" ]] # 如果有cmd,去掉第1个cmd,剩余的是它的参数,如果没有,就类似于在控制台上打了个会车一样任他去吧
# [[ "$cmd" != "" ]] # 如果有cmd,去掉第1个cmd,剩余的是它的参数,如果没有,就类似于在控制台上打了个会车一样任他去吧

# 进入工作目录
local workdir="${_pkgs[$pkg]}"
Expand All @@ -107,9 +108,9 @@ _run() {
caller_line=$(caller 0 | awk '{print $1}')

if ! _is_cmd "$cmd" ; then
echo "$_ROOT_BAKE_PATH:$caller_line ⚪️ ▶︎${FUNCNAME[1]}() ▶︎【$workdir$ $*】"
echo "$_ROOT_BAKE_PATH:$caller_line ⚪️ ▶︎${FUNCNAME[1]}() ▶︎【$PWD$ $*】"
else
echo "$_ROOT_BAKE_PATH:$caller_line 🔵 ▶︎${FUNCNAME[1]}() ▶︎【$workdir$ $*】"
echo "$_ROOT_BAKE_PATH:$caller_line 🔵 ▶︎${FUNCNAME[1]}() ▶︎【$PWD$ $*】"
"$@"
fi
# 退出工作目录,不弄脏环境,不需要打印popd执行结果
Expand All @@ -122,7 +123,7 @@ _run() {
##########################################


ls() { for pkg in ${!_pkgs[*]} ; do echo "$pkg:${_pkgs[$pkg]}"; done; }
pkgs() { for pkg in ${!_pkgs[*]} ; do echo "$pkg:${_pkgs[$pkg]}"; done; }
run() { for pkg in ${!_pkgs[*]} ; do _run "$pkg" "$@" ; done }
install() { _run_all install; }
get() { _run_all install; }
Expand All @@ -131,17 +132,11 @@ upgrade() { _run_all upgrade; }
clean() { _run_all clean; }
test() { _run_all test; }
gen() { _run_all gen; }

dart_fix() { run dart fix $@; }

# 根项目,主要是bin/辅助工具等
root.run() { _run root "$@"; }
root.install() { _run root dart pub get; }
root.upgrade() { _run root dart pub upgrade ; }
root.test() { _run root dart test; }
root.build() { _run root dart compile exe bin/notecli.dart ; }
root.clean() { _run root rm -rf build;
_run root rm -rf .dart_tool; }
# bash。bash is1 common scri

bake.run() { _run bake "$@"; }
bake.test() { _run bake ./test.bash test; }

Expand All @@ -158,12 +153,15 @@ you_flutter.clean() { _run you_flutter flutter clean; rm -rf build; }
you_flutter.upgrade() { _run you_flutter flutter pub upgrade ; }
you_flutter.test() { _run you_flutter flutter test; }

you_cli.run() { _run you_cli "$@"; }
you_cli.test() { _run you_cli dart test; }

you_note_dart.run() { _run root_note_dart "$@"; }
you_note_dart.install() { _run root_note_dart flutter pub get; }
you_note_dart.clean() { _run root_note_dart flutter clean; rm -rf build; }
you_note_dart.upgrade() { _run root_note_dart flutter pub upgrade ; }
you_note_dart.test() { _run root_note_dart flutter test; }

you_note_dart.run() { _run you_note_dart "$@"; }
you_note_dart.install() { _run you_note_dart flutter pub get; }
you_note_dart.clean() { _run you_note_dart flutter clean; rm -rf build; }
you_note_dart.upgrade() { _run you_note_dart flutter pub upgrade ; }
you_note_dart.test() { _run you_note_dart flutter test; }

learn_dart.run() { _run learn_dart "$@"; }
learn_dart.install() { _run learn_dart dart pub get ; }
Expand All @@ -184,25 +182,25 @@ flutter_web.install() { _run flutter_web flutter pub get ; }
flutter_web.clean() { _run flutter_web flutter clean;
rm -rf build; }
flutter_web.upgrade() { _run flutter_web flutter pub upgrade ; }
flutter_web.gen() { dart run bin/notecli.dart gen --dir notes/flutter_web/; }
flutter_web.dev() { flutter_web.dev_macos "$@"; }
flutter_web.build() { flutter_web.build_html "$@" ; }
flutter_web.gen() { #_run root dart run packages/you_cli/bin/cli.dart gen all --dir notes/flutter_web/;
_run root dart run packages/you_cli/bin/cli.dart gen routes.g.dart --dir notes/flutter_web/ # --async
}
flutter_web.dev() { flutter_web.dev_html ; }
flutter_web.build() { flutter_web.build_html ;}
flutter_web.preview() { flutter_web.build_html;
flutter_web.preview_html_deno; }
flutter_web.server_deno; }

flutter_web.dev_macos() { _run flutter_web flutter run --device-id macos "$@"; }
flutter_web.dev_html() { _run flutter_web flutter run --web-port 8888 --web-renderer html --device-id chrome "$@"; }
flutter_web.dev_macos() { _run flutter_web flutter run --device-id macos "$@"; }
flutter_web.build_html() { _run flutter_web flutter build web --release --tree-shake-icons --web-renderer html --source-maps --output build/web/you/flutter_web --base-href "/you/flutter_web/" --no-web-resources-cdn "$@" ;}
flutter_web.build_macos() { _run flutter_web flutter build macos --release --tree-shake-icons "$@"; }
flutter_web.build_wasm() { _run flutter_web flutter build web --release --tree-shake-icons --wasm "$@" ;}
flutter_web.build_html() { _run flutter_web flutter build web --release --tree-shake-icons --web-renderer html --source-maps --output build/web/you/flutter_web --base-href "/you/flutter_web/" --no-web-resources-cdn "$@" ;}
flutter_web.build_web_skwasm() { _run flutter_web flutter build web --release --tree-shake-icons --web-renderer skwasm "$@" ; }
flutter_web.build_web_canvaskit() { _run flutter_web flutter build web --release --tree-shake-icons --web-renderer canvaskit "$@" ; }
flutter_web.preview_html_run() { echo "http://localhost:8080/you/flutter_web";
flutter_web.server_dhttpd() { echo "http://localhost:8080/you/flutter_web";
_run flutter_web dhttpd --path ./build/web --port 8080 '--headers=Cross-Origin-Embedder-Policy=credentialless;Cross-Origin-Opener-Policy=same-origin'; }
flutter_web.preview_html_deno() { echo "http://localhost:8080/you/flutter_web";
flutter_web.server_deno() { echo "http://localhost:8080/you/flutter_web";
_run flutter_web deno run --allow-env --allow-read --allow-sys --allow-net npm:http-server ./build/web --port 8080 -g --brotli; }
flutter_web.preview_wasm() { echo "http://localhost:8080/you/flutter_web";
_run flutter_web dhttpd '--headers=Cross-Origin-Embedder-Policy=credentialless;Cross-Origin-Opener-Policy=same-origin'; }


# github 发布时使用,参考[.github/workflows/*.yaml]
Expand All @@ -225,4 +223,23 @@ info() {
echo
}

temp(){

# 指定需要遍历的目录,例如当前目录可以使用 "."
directory="notes/flutter_web/lib"

# 遍历目录中的所有note.dart文件
for file in $(find 'notes/flutter_web/lib' -type f -name 'note.json') ; do
# echo "xxx $file"
# # 检查文件是否存在
if [ -f "$file" ]; then
# 构建新的文件名,即将note.dart替换为page.dart
new_file="${file//note.json/page.json}"
# 执行重命名操作
git mv "$file" "$new_file"
echo "mv $file to $new_file"
fi
done
}

bake.go "$@"
Loading
Loading