From 1fd3360c16b6df2cfed89aa8cccc8a42397ec3f2 Mon Sep 17 00:00:00 2001 From: ice breaker <1324318532@qq.com> Date: Fri, 16 Oct 2026 15:47:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A0=E5=85=A5=20weapp-sqlite=20?= =?UTF-8?q?=E6=98=9F=E7=90=83=E5=B9=B6=E5=90=8C=E6=AD=A5=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=A0=87=E5=BF=97=E4=B8=8E=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/weak-turtles-nail.md | 5 + .impeccable/surfaces/apple-product.md | 2 +- .impeccable/surfaces/weapp-cli.md | 4 +- DESIGN.md | 4 +- PRODUCT.md | 2 +- apps/open-source/DESIGN.md | 2 +- apps/open-source/src/components/Header.astro | 4 +- .../src/components/ProjectProofPanel.astro | 2 +- .../src/components/ProjectSelector.astro | 7 +- .../src/components/QuickStartPanel.astro | 6 +- apps/open-source/src/i18n/ui.ts | 12 +- apps/open-source/src/lib/seo.test.ts | 14 ++- .../src/lib/site-resources.test.ts | 29 ++++- apps/open-source/src/lib/toolchain.test.ts | 107 ++++++++++-------- apps/open-source/src/lib/toolchain.ts | 5 +- apps/open-source/tests/e2e/hero-fallback.ts | 2 +- .../open-source/tests/e2e/hero-layout.spec.ts | 2 +- .../tests/e2e/hero-planets.spec.ts | 18 ++- apps/open-source/tests/e2e/home-demos.spec.ts | 12 +- .../open-source/tests/e2e/open-source.spec.ts | 7 +- .../tests/e2e/pages-subpath.spec.ts | 12 +- apps/open-source/tests/e2e/projects.spec.ts | 57 ++++++---- apps/open-source/tests/e2e/site.spec.ts | 25 ++-- apps/web/src/components/Header.astro | 4 +- .../src/components/ProjectProofPanel.astro | 2 +- apps/web/src/components/QuickStartPanel.astro | 6 +- apps/web/src/i18n/ui.ts | 12 +- apps/web/src/lib/seo.test.ts | 2 +- apps/web/src/lib/site-resources.test.ts | 29 ++++- apps/web/src/lib/toolchain.test.ts | 107 ++++++++++-------- apps/web/src/lib/toolchain.ts | 5 +- apps/web/tests/e2e/hero-fallback.ts | 2 +- apps/web/tests/e2e/hero-layout.spec.ts | 2 +- apps/web/tests/e2e/hero-planets.spec.ts | 18 ++- apps/web/tests/e2e/home-demos.spec.ts | 12 +- apps/web/tests/e2e/projects.spec.ts | 57 ++++++---- apps/web/tests/e2e/services.spec.ts | 2 +- apps/web/tests/e2e/site.spec.ts | 10 ++ docs/architecture/homepage.md | 2 + docs/design/weapp-sqlite-cli-lab.webp | Bin 0 -> 64934 bytes .../weapp-sqlite-open-source-desktop.webp | Bin 0 -> 78702 bytes .../weapp-sqlite-open-source-mobile.webp | Bin 0 -> 22056 bytes .../weapp-sqlite-open-source-narrow.webp | Bin 0 -> 18352 bytes .../weapp-sqlite-open-source-setup-en.webp | Bin 0 -> 17140 bytes .../weapp-sqlite-open-source-setup-zh-CN.webp | Bin 0 -> 15846 bytes .../weapp-sqlite-open-source-short.webp | Bin 0 -> 45100 bytes docs/design/weapp-sqlite-web-desktop.webp | Bin 0 -> 77614 bytes docs/design/weapp-sqlite-web-mobile.webp | Bin 0 -> 22148 bytes docs/design/weapp-sqlite-web-narrow.webp | Bin 0 -> 18200 bytes docs/design/weapp-sqlite-web-setup-en.webp | Bin 0 -> 17140 bytes docs/design/weapp-sqlite-web-setup-zh-CN.webp | Bin 0 -> 15846 bytes docs/design/weapp-sqlite-web-short.webp | Bin 0 -> 44698 bytes docs/weapp-sqlite-validation-2026-10-16.md | 72 ++++++++++++ .../project-catalog/public/brands/README.md | 11 +- .../public/brands/weapp-sqlite.svg | 6 + packages/project-catalog/src/content.test.ts | 24 +++- .../src/content/projects/weapp-sqlite.json | 100 ++++++++++------ .../src/data/project-metrics.fallback.json | 7 ++ .../project-catalog/src/lib/metrics.test.ts | 2 +- .../components/home/demos/SQLiteDemo.astro | 8 +- .../src/components/home/demos/sqlite.ts | 16 ++- packages/site-ui/src/styles/hero.css | 5 + packages/weapp/README.md | 56 ++++----- packages/weapp/lab/app.ts | 13 ++- packages/weapp/lab/logos/ATTRIBUTION.md | 6 +- packages/weapp/lab/logos/miniprogram.svg | 3 - packages/weapp/lab/project-logos.ts | 4 +- packages/weapp/scripts/artifact-smoke.ts | 23 +++- packages/weapp/scripts/browser-test.ts | 53 ++++++++- packages/weapp/test/catalog.test.ts | 31 ++++- packages/weapp/test/lab.test.ts | 7 +- packages/weapp/test/terminal.test.ts | 33 +++++- packages/weapp/test/tools.test.ts | 9 +- packages/weapp/test/weapp.test.ts | 5 +- 74 files changed, 756 insertions(+), 350 deletions(-) create mode 100644 .changeset/weak-turtles-nail.md create mode 100644 docs/design/weapp-sqlite-cli-lab.webp create mode 100644 docs/design/weapp-sqlite-open-source-desktop.webp create mode 100644 docs/design/weapp-sqlite-open-source-mobile.webp create mode 100644 docs/design/weapp-sqlite-open-source-narrow.webp create mode 100644 docs/design/weapp-sqlite-open-source-setup-en.webp create mode 100644 docs/design/weapp-sqlite-open-source-setup-zh-CN.webp create mode 100644 docs/design/weapp-sqlite-open-source-short.webp create mode 100644 docs/design/weapp-sqlite-web-desktop.webp create mode 100644 docs/design/weapp-sqlite-web-mobile.webp create mode 100644 docs/design/weapp-sqlite-web-narrow.webp create mode 100644 docs/design/weapp-sqlite-web-setup-en.webp create mode 100644 docs/design/weapp-sqlite-web-setup-zh-CN.webp create mode 100644 docs/design/weapp-sqlite-web-short.webp create mode 100644 docs/weapp-sqlite-validation-2026-10-16.md create mode 100644 packages/project-catalog/public/brands/weapp-sqlite.svg delete mode 100644 packages/weapp/lab/logos/miniprogram.svg diff --git a/.changeset/weak-turtles-nail.md b/.changeset/weak-turtles-nail.md new file mode 100644 index 00000000..cecd0681 --- /dev/null +++ b/.changeset/weak-turtles-nail.md @@ -0,0 +1,5 @@ +--- +"weapp": patch +--- + +更新 weapp-sqlite 测试版资料、官方标识和安装指引 diff --git a/.impeccable/surfaces/apple-product.md b/.impeccable/surfaces/apple-product.md index 3e4df71a..ea596f09 100644 --- a/.impeccable/surfaces/apple-product.md +++ b/.impeccable/surfaces/apple-product.md @@ -10,7 +10,7 @@ 轨道星尘由固定种子沿椭圆弧长等距锚定,法向抖动不超过 2px;宽度 ≥1024px/640–1023px/<640px 分别使用 960/384/256 个点。复用既有翡翠、冰蓝、香槟与珍珠色,以珍珠色为主;每个点按 6–12 秒错相周期独立闪烁,亮度变化限制在起点 ±25%,整圈不脉动。可选星尘层与原粒子共享 WebGL canvas、活跃时钟、ready 门禁、320ms 淡入和 60/30/10fps 调度,暂停、重播与重连沿用同一生命周期;私有 program 与 VAO 随断开及初始化失败释放,测试探针分别统计两类资源。仅星尘初始化失败时保留 CSS 核心与原粒子渲染器;既有静态 Logo 与星空降级保持不变。 -独立星球控制器从 ready(2200ms)且首屏可见起等待 3 秒后选中第一个项目,保持 4 秒,再间隔 3 秒按现有十个星球顺序轮换;每次只凸显一个,自动凸显、悬停和键盘聚焦期间轨道继续运行,粒子仍流动。键盘聚焦优先于悬停,悬停优先于自动选择;结束交互后等待 3 秒继续公平轮换,手动选中不改变自动顺序。首屏右下角统一控制全部首屏动画,按钮至少 44px,双语操作名称为“暂停首屏动画/继续首屏动画”与“Pause hero animation/Resume hero animation”,按下状态及暂停/播放图标同步。手机显示 44px 图标按钮,保留完整无障碍名称。手动暂停冻结粒子相位和轨道、保留当前自动选择与重连后的暂停状态;继续时清除自动选择并重新计时。轮换不移动键盘焦点、不自动播报。 +独立星球控制器从 ready(2200ms)且首屏可见起等待 3 秒后选中第一个项目,保持 4 秒,再间隔 3 秒按目录中的十一个星球顺序轮换;每次只凸显一个,自动凸显、悬停和键盘聚焦期间轨道继续运行,粒子仍流动。键盘聚焦优先于悬停,悬停优先于自动选择;结束交互后等待 3 秒继续公平轮换,手动选中不改变自动顺序。首屏右下角统一控制全部首屏动画,按钮至少 44px,双语操作名称为“暂停首屏动画/继续首屏动画”与“Pause hero animation/Resume hero animation”,按下状态及暂停/播放图标同步。手机显示 44px 图标按钮,保留完整无障碍名称。手动暂停冻结粒子相位和轨道、保留当前自动选择与重连后的暂停状态;继续时清除自动选择并重新计时。轮换不移动键盘焦点、不自动播报。 星球控制器订阅共享首屏阶段,ready 前隐藏星球、名称、轨道与说明,链接 inert 且不进入辅助技术树;停止轨道与自动计时。暂停按钮在加载期间独立可用。离屏、后台、减少动态效果或离开桌面断点时清除自动选择与计时,恢复后从完整 3 秒延迟开始,不补跑。粒子聚合与星球淡入共享活跃时钟及调度器;暂停、离屏和后台冻结全部相位,重连不重播。减少动画、WebGL 失败、字体失败/超时和无 JS 时,中央显示静态粒子 Logo 与星空,轨道链接继续隐藏且 inert,下方原生项目入口仍可用。减少动画解除后成功绘制才恢复保存相位。手机/平板保留 44px/52px 星球尺寸,不显示自动聚焦或说明,不引入动画依赖。 diff --git a/.impeccable/surfaces/weapp-cli.md b/.impeccable/surfaces/weapp-cli.md index 86b0660d..4526ab06 100644 --- a/.impeccable/surfaces/weapp-cli.md +++ b/.impeccable/surfaces/weapp-cli.md @@ -2,12 +2,12 @@ Terminal tools use Operate mode; the lab uses Experience mode. Mini-app developers start by creating weapp-vite or inspecting the weapp ecosystem. Preserve the green brand, shared particle Logo, authentic project marks, factual maturity and the independent open-source identity. -The six primary projects come from `ecosystem=weapp`, including Varo and explicitly planned SQLite. All eleven remain searchable and machine-readable. Selection drives the palette, visual focus and project facts. Games remain an explicit command, outside the hall and general help. +The six primary projects come from `ecosystem=weapp`, including Varo and Beta SQLite. All eleven remain searchable and machine-readable. Selection drives the palette, visual focus and project facts. Games remain an explicit command, outside the hall and general help. The first terminal frame presents usable actions beside assembling particles. The first Enter opens creation, and C is a creation shortcut only in the hall. The default entry is Create weapp-vite with the official default template. Directory, template and summary belong to the same state machine. A deterministic directory-name seed drives a personal star chart, and the five templates rearrange its orbital structure over about 250ms. Wide terminals have action/stage columns; ordinary terminals stack them; narrow terminals preserve actions and status. Reading regions remain stable. Successful manifest verification immediately shows a project badge and next commands, with decorative motion that never gates interaction. One session owns raw mode, screen, keys, resize and cleanup, caps all output at 20 FPS, diffs lines and respects backpressure. Scaffolds borrow input and restore the original page and focus. No-motion freezes the same composition; monochrome retains contrast hierarchy. Only a validated creation directory starts version prefetch, overlapping template selection and summary review. Query and execution share the target parent's npm configuration. Progress reports real phases and elapsed time, with no invented download percentage. Esc cancels a pending creation without closing the hall. The upstream process exclusively owns input and output while executing. Lightweight commands load only their modules and data; toolkit Node 18 support remains distinct from each creator's own Node requirement. -The browser opens on the six-project galaxy, with weapp-vite selected. Real offline marks, near/far scale, orbit trails and selection focus carry the stage. A morphing particle scene and pointer flow remain available. Capability details and official actions follow selection; commands are copied only. Planned SQLite never offers install/create actions. Controls stay below the canvas, with accessible project navigation, licensed Syne/Geist typography and mobile reflow. Replay preserves selection and settings, resetting time and dragging. Reduced motion, background pause and Canvas fallback keep project information usable. +The browser opens on the six-project galaxy, with weapp-vite selected. Real offline marks, near/far scale, orbit trails and selection focus carry the stage. A morphing particle scene and pointer flow remain available. Capability details and official actions follow selection; commands are copied only. SQLite offers its published @weapp-sqlite/weapp-vite installation command for copying; creation remains limited to the existing scaffold adapters. Controls stay below the canvas, with accessible project navigation, licensed Syne/Geist typography and mobile reflow. Replay preserves selection and settings, resetting time and dragging. Reduced motion, background pause and Canvas fallback keep project information usable. Ship a self-contained package using neutral public catalog and asset exports. Verify terminal restoration, all fixed-route assets, external tarball operation, desktop/mobile interaction and genuine OIDC exchange. Capture desktop/mobile together, apply one batch of material fixes, and confirm once. diff --git a/DESIGN.md b/DESIGN.md index e077f0c3..97a5b181 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -259,7 +259,7 @@ At desktop widths of at least 1024px, planet visuals are 80px, reducing to 72px The halo's fixed-seed star-dust points follow equal arc-length positions on the ellipse, with no more than 2px of normal jitter. Their budgets are 960 points at widths of at least 1024px, 384 at 640–1023px, and 256 below 640px. They reuse the existing jade, ice-blue, champagne, and pearl palette, predominantly pearl. Each anchored point twinkles independently over 6–12 seconds within ±25% of its base brightness; the ellipse does not pulse as a whole or react to selection. The optional dust layer uses the existing WebGL canvas, active clock, ready gate, 320ms reveal, and 60/30/10fps scheduler. Pause, offscreen, and background states freeze the same clock; replay resets its phase and reveal with the existing intro, and reconnect restores the saved phase. Its private program and VAO are disposed with the renderer, including partially initialized resources. If halo initialization alone fails, the CSS core and original particle renderer continue. The test probe reports program and VAO counts separately so resource cleanup can be verified. -The independent shared planet controller starts a desktop spotlight 3 seconds after the wordmark is assembled and the hero is visible, holds it for 4 seconds, then waits another 3 seconds before advancing through the existing ten-project order. Only one planet is selected at a time. Automatic spotlight, hover, and keyboard focus keep the orbit moving while particle flow continues. The controller owns a single native Web Animations timeline on the constellation, with a 240-second linear turn of the inherited `--orbit-turn`; planets and their names share that phase without per-frame layout reads, a second animation loop, or deferred measurements. Pause and play occur only when the orbit's running state changes. Disconnect pauses the native animation, saves its current time, and cancels that owned resource; reconnect creates one timeline at the saved phase. This avoids the automatic cancellation and lost current time of a detached CSS animation. Keyboard focus takes priority over hover, followed by automatic selection. Ending manual interaction restarts the 3-second delay without changing the fair automatic order. The lower-right controls contain two 44px circular icon buttons on desktop and mobile. Pause/resume uses the localized accessible name and title “暂停首屏动画” / “继续首屏动画” or “Pause hero animation” / “Resume hero animation”, a pressed state, and a matching pause/play icon; its visually hidden label updates with the same state. Replay uses “重播首屏动画” or “Replay hero animation” for both its accessible name and title. User pause freezes particle phase and orbit, holds the current automatic selection, and survives component reconnection; resume clears automatic selection and restarts its delay. Automatic selection never moves focus or announces caption changes. +The independent shared planet controller starts a desktop spotlight 3 seconds after the wordmark is assembled and the hero is visible, holds it for 4 seconds, then waits another 3 seconds before advancing through the catalog’s eleven-project order. Only one planet is selected at a time. Automatic spotlight, hover, and keyboard focus keep the orbit moving while particle flow continues. The controller owns a single native Web Animations timeline on the constellation, with a 240-second linear turn of the inherited `--orbit-turn`; planets and their names share that phase without per-frame layout reads, a second animation loop, or deferred measurements. Pause and play occur only when the orbit's running state changes. Disconnect pauses the native animation, saves its current time, and cancels that owned resource; reconnect creates one timeline at the saved phase. This avoids the automatic cancellation and lost current time of a detached CSS animation. Keyboard focus takes priority over hover, followed by automatic selection. Ending manual interaction restarts the 3-second delay without changing the fair automatic order. The lower-right controls contain two 44px circular icon buttons on desktop and mobile. Pause/resume uses the localized accessible name and title “暂停首屏动画” / “继续首屏动画” or “Pause hero animation” / “Resume hero animation”, a pressed state, and a matching pause/play icon; its visually hidden label updates with the same state. Replay uses “重播首屏动画” or “Replay hero animation” for both its accessible name and title. User pause freezes particle phase and orbit, holds the current automatic selection, and survives component reconnection; resume clears automatic selection and restarts its delay. Automatic selection never moves focus or announces caption changes. Replay restores the particle Logo immediately, clears the completed-wordmark and planet-reveal state, and unpauses the hero. It resets the particle active clock and pointer response, seeks the existing shared native orbit animation to zero, clears automatic and manual planet selection, and restarts the fair catalog order from the first project. The same 700ms Logo hold, 1500ms morph, and 320ms reveal run again; spotlight timing remains gated until ready and then waits the full 3 seconds. Requests persist as a scope-local `data-hero-replay-version` and notify subscribers within that hero. Each renderer deduplicates the version independently, so a disconnected component honors a newer request when reconnecting without resetting an unrelated hero or replaying an unchanged request. A new request also clears the saved orbital time. Replay during font startup retains its loading and failure rules, and hidden or offscreen time still does not advance the active clock. @@ -281,7 +281,7 @@ Content remains visible before observers run. The optional chapter entrance is a ### CLI workbench and visual lab -The CLI translates the shared particle Logo and project orbit into a Braille stage beside stable terminal actions and facts. Its local visual lab keeps the green action family, neutral dark canvas, self-hosted Syne wordmark and Geist reading typography. The canvas leads; native project selectors, a flat project information rail and pill controls supply the task boundary. Actual project marks sit on pale faces with their original colors, and the planned SQLite project explicitly identifies its shared mini-program fallback. Selection connects the visual focus with the same project's facts and official actions. Desktop details use three columns, then stack on phones; controls and official links retain 44px targets with amber keyboard focus. Reduced motion keeps a static, selectable composition. Lab-specific surface tones, compact field corners and responsive dimensions remain local component choices. See `.impeccable/surfaces/weapp-cli.md` and `docs/weapp-0.2-validation.md` for this surface's state and evidence contract. +The CLI translates the shared particle Logo and project orbit into a Braille stage beside stable terminal actions and facts. Its local visual lab keeps the green action family, neutral dark canvas, self-hosted Syne wordmark and Geist reading typography. The canvas leads; native project selectors, a flat project information rail and pill controls supply the task boundary. Actual project marks sit on pale faces with their original colors, and SQLite uses the transparent interlocking data-block symbol from its upstream repository redesign and retains its Beta support boundary. Selection connects the visual focus with the same project's facts and official actions. Desktop details use three columns, then stack on phones; controls and official links retain 44px targets with amber keyboard focus. Reduced motion keeps a static, selectable composition. Lab-specific surface tones, compact field corners and responsive dimensions remain local component choices. See `.impeccable/surfaces/weapp-cli.md` and `docs/weapp-0.2-validation.md` for this surface's state and evidence contract. ## Do's and Don'ts diff --git a/PRODUCT.md b/PRODUCT.md index f1191efe..61473cae 100644 --- a/PRODUCT.md +++ b/PRODUCT.md @@ -22,7 +22,7 @@ This monorepo contains two independent bilingual Astro applications. weapp.dev s ## Product truth -The catalog retains eleven projects and their actual maintainers, repositories, documentation URLs, and maturity. weapp-sqlite remains planned. Documentation domains including tw.weapp.dev, vite.weapp.dev, and varo.weapp.dev are unchanged. Only weapp-vite and weapp-tailwindcss currently have confirmed migration/training coverage; other projects need assessment. +The catalog retains eleven projects and their actual maintainers, repositories, documentation URLs, and maturity. weapp-sqlite is listed as Beta with partial data: its recommended package is @weapp-sqlite/weapp-vite, Web and real WeChat DevTools pass automated acceptance, and WeChat devices await verification. Documentation domains including tw.weapp.dev, vite.weapp.dev, and varo.weapp.dev are unchanged. Only weapp-vite and weapp-tailwindcss currently have confirmed migration/training coverage; other projects need assessment. Commercial prices, sponsorship recognition, and the 60/25/15 fund allocation remain as published. Planned cloud builds, templates, and private registries are not purchasable products. Do not invent customers, metrics, partnerships, launch dates, or support promises. diff --git a/apps/open-source/DESIGN.md b/apps/open-source/DESIGN.md index 018ed43f..78c8d299 100644 --- a/apps/open-source/DESIGN.md +++ b/apps/open-source/DESIGN.md @@ -8,7 +8,7 @@ SSR 粒子 Logo 与星空、粒子字标和聚合后淡入的项目星球保留 ## 页面与所有权 -本应用拥有布局、导航、首页组合、双语文案、路由、SEO、隐私说明、本地交互和样式组合。首页依次呈现字标/星球与项目导航、定位与选型、工程、组件与数据、独立样式章节、Taro 迁移、Runtime 选型、uni-app 生态、工具链、发布和贡献入口。目录和详情保留十一个项目的真实维护者、文档、源码、成熟度及指标,weapp-sqlite 继续明确为规划中。 +本应用拥有布局、导航、首页组合、双语文案、路由、SEO、隐私说明、本地交互和样式组合。首页依次呈现字标/星球与项目导航、定位与选型、工程、组件与数据、独立样式章节、Taro 迁移、Runtime 选型、uni-app 生态、工具链、发布和贡献入口。目录和详情保留十一个项目的真实维护者、文档、源码、成熟度及指标,weapp-sqlite 以测试版呈现,注明 Web 与微信开发者工具已验收、微信真机待验证的范围。 packages/project-catalog 提供中立事实、素材与指标,packages/site-ui 提供显式传入内容的中立视觉与演示组件。本应用不导入 apps/web,不以部署变量切换身份;共享外观不意味着共享商业定位。源码和发布资产不包含商业报价、募资、联系方式二维码或指向商业主域的服务导流。历史报价/赞助/贡献者资助 URL 保留同语种站内项目目录的 noindex 静态跳转。 diff --git a/apps/open-source/src/components/Header.astro b/apps/open-source/src/components/Header.astro index f5ed2d32..2adcf101 100644 --- a/apps/open-source/src/components/Header.astro +++ b/apps/open-source/src/components/Header.astro @@ -43,7 +43,7 @@ const siteGithubUrl = profile.organizationUrl {projects.map(project => ( - + {project.data.locales[locale].name} @@ -79,7 +79,7 @@ const siteGithubUrl = profile.organizationUrl {locale === 'zh-CN' ? '查看全部项目' : 'View all projects'} {projects.map(project => ( - + {project.data.locales[locale].name} ))} diff --git a/apps/open-source/src/components/ProjectProofPanel.astro b/apps/open-source/src/components/ProjectProofPanel.astro index 2ddcbd44..62ec9adb 100644 --- a/apps/open-source/src/components/ProjectProofPanel.astro +++ b/apps/open-source/src/components/ProjectProofPanel.astro @@ -9,7 +9,7 @@ const proof = { 'weapp-vite': { zh: '单目标构建边界', en: 'Single-target build boundary', file: 'vite.config.ts', code: `weapp({\n buildScope: 'wechat',\n platforms: ['wechat'],\n})` }, 'weapp-tailwindcss': { zh: '小程序样式接入', en: 'Mini-app style integration', file: 'app.css', code: `@import 'tailwindcss';\n\n/* classes stay in your templates */\n` }, varo: { zh: 'Registry 安装命令', en: 'Registry install command', file: 'terminal', code: `pnpm dlx @varo-ui/cli add \\\n --target weapp \\\n button input card` }, - 'weapp-sqlite': { zh: '本地数据能力(规划中)', en: 'Local data capability (planned)', file: 'planning.md', code: `status: planned\napi: to be confirmed\nplatforms: to be confirmed\n\n# no production API is promised yet` }, + 'weapp-sqlite': { zh: 'SQLite 本地数据边界', en: 'SQLite local data boundary', file: 'sqlite.ts', code: `import { openSqlite } from '@weapp-sqlite/weapp-vite/runtime'\n\nconst db = await openSqlite({ name: 'app.sqlite' })\ntry {\n const result = await db.query('SELECT ? AS message', ['hello'])\n console.log(result.rows)\n}\nfinally {\n await db.close()\n}` }, 'vite-plugin-taro': { zh: 'Taro + Vite 迁移', en: 'Taro + Vite migration', file: 'package.json', code: `npm create vite-taro@latest my-app\n\n# keep React + Taro APIs\n# move the build pipeline to Vite` }, }[project.id] const plannedProof = locale === 'zh-CN' diff --git a/apps/open-source/src/components/ProjectSelector.astro b/apps/open-source/src/components/ProjectSelector.astro index b9894216..64282a2e 100644 --- a/apps/open-source/src/components/ProjectSelector.astro +++ b/apps/open-source/src/components/ProjectSelector.astro @@ -13,7 +13,7 @@ const copy = locale === 'zh-CN' ? { { title: '新建小程序工程', body: '从现代 Vite 工程开始,再按需要叠加样式和组件。', ids: ['weapp-vite', 'weapp-tailwindcss', 'varo'] }, { title: '已有小程序项目', body: '先把样式工作流接进现有项目,不要求重写页面。', ids: ['weapp-tailwindcss'] }, { title: '需要组件源码和业务 Blocks', body: '从 Varo Registry 安装可编辑源码,再按业务需要组合组件与 Blocks。', ids: ['varo'] }, - { title: '需要本地数据', body: '评估结构化本地存储和离线能力,关注 weapp-sqlite 的规划进展。', ids: ['weapp-sqlite'] }, + { title: '需要本地数据', body: '使用测试版 SQLite 处理本地数据;Web 与微信开发者工具已验收,微信真机仍待验证。', ids: ['weapp-sqlite'] }, { title: '已有 Taro / React 项目', body: '保留 Taro 组件和 API,把开发构建链路切换到 Vite。', ids: ['vite-plugin-taro'] }, ], } : { @@ -23,14 +23,14 @@ const copy = locale === 'zh-CN' ? { { title: 'Starting a new mini-app', body: 'Begin with a modern Vite project, then add styling and components as needed.', ids: ['weapp-vite', 'weapp-tailwindcss', 'varo'] }, { title: 'Working in an existing mini-app', body: 'Bring the styling workflow into the current project without rewriting pages.', ids: ['weapp-tailwindcss'] }, { title: 'Choosing component source and Blocks', body: 'Install editable source from the Varo Registry, then compose components and Blocks for your product.', ids: ['varo'] }, - { title: 'Planning local data', body: 'Evaluate structured storage and offline needs while weapp-sqlite is being planned.', ids: ['weapp-sqlite'] }, + { title: 'Working with local data', body: 'Try the Beta SQLite layer. Web and WeChat DevTools pass acceptance; WeChat devices await verification.', ids: ['weapp-sqlite'] }, { title: 'Already on Taro / React', body: 'Keep Taro components and APIs while moving the development pipeline to Vite.', ids: ['vite-plugin-taro'] }, ], } ---

{copy.eyebrow}

{copy.title}

-
{copy.paths.map((path, index) => { const firstProject = byId.get(path.ids[0]); const commandId = `selector-command-${index}`; const statusId = `selector-status-${index}`; const planned = firstProject && (firstProject.data.status === 'planned' || !firstProject.data.installCommand); const describedBy = planned ? `path-description-${index} ${statusId}` : firstProject?.data.installCommand ? `path-description-${index} ${commandId}` : `path-description-${index}`; return
{String(index + 1).padStart(2, '0')}

{path.title}

{path.body}

{path.ids.map(id => { const project = byId.get(id); if (!project) return null; return {project.data.locales[locale].name} })}
{firstProject && (planned ?

{copy.planned}

:
{locale === 'zh-CN' ? '第一步' : 'First step'}{firstProject.data.installCommand}
)}
{copy.action}{firstProject && {copy.docs}}
})}
+
{copy.paths.map((path, index) => { const firstProject = byId.get(path.ids[0]); const commandId = `selector-command-${index}`; const statusId = `selector-status-${index}`; const planned = firstProject && (firstProject.data.status === 'planned' || !firstProject.data.installCommand); const describedBy = planned ? `path-description-${index} ${statusId}` : firstProject?.data.installCommand ? `path-description-${index} ${commandId}` : `path-description-${index}`; return
{String(index + 1).padStart(2, '0')}

{path.title}

{path.body}

{path.ids.map(id => { const project = byId.get(id); if (!project) return null; return {project.data.locales[locale].name} })}
{firstProject && (planned ?

{copy.planned}

:
{locale === 'zh-CN' ? '第一步' : 'First step'}{firstProject.data.installCommand}
)}
{copy.action}{firstProject && {copy.docs}}
})}
{locale === 'zh-CN' ? '浏览全部项目' : 'Browse all projects'}