@deltares/fews-web-oc-composables

中文文档
0.4.0发布于 2026/11/02AGPLTypeScriptES Module零依赖构建来源已验证近 30 天下载 2659

Composable utilities for FEWS Web OC

原始使用文档

@deltares/fews-web-oc-composables

Overview

These Vue composables help applications work with FEWS data, including PI locations, WMS layers and legends, and coordinated refreshes. They are intended for use by WebOC itself, WebOC micro-frontends, and standalone Vue applications.

In WebOC, the host application can provide shared webservice configuration, refresh signals, and notifications to micro-frontends. Micro-frontends can then use the corresponding useHost* composables without configuring those services individually.

Standalone Vue applications can use data-fetching composables without a WebOC host by passing explicit webservice options (and an explicit system tick when using onSystemTick refreshes). The provideHost* functions are only needed when the application uses the host-context composables or relies on host-provided defaults; call them before mounting consumers that need those contexts.

API availability and stability

Not all composables currently used by WebOC are available in this package yet. We will gradually migrate existing composables from WebOC into this repository so they can also be used by WebOC micro-frontends and standalone Vue applications. The API reference below lists what is available now.

Beta APIs are functional but may change before they are considered stable.

Alpha APIs may be incomplete or not fully functional, and may change before they are considered stable.

版本与发布记录

@deltares/fews-web-oc-composables 共发布 11 个版本,首次发布于 2026/08/03;过去 12 个月发布了 11 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.0latest2026/11/0210 天前
0.3.12026/10/081 个月前
0.3.02026/10/031 个月前
0.3.0-alpha.9alpha2026/10/021 个月前
0.3.0-alpha.82026/10/021 个月前
0.3.0-alpha.72026/10/021 个月前

关于 @deltares/fews-web-oc-composables 的常见问题

@deltares/fews-web-oc-composables 是什么?

Composable utilities for FEWS Web OC

如何安装 @deltares/fews-web-oc-composables?

在项目目录运行 npm install @deltares/fews-web-oc-composables,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、@vueuse/core(^14.0.0 || ^15.0.0)、@deltares/fews-pi-requests(^3.5.0)、@deltares/fews-wms-requests(^4.3.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@deltares/fews-web-oc-composables 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@deltares/fews-web-oc-composables 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@deltares/fews-web-oc-composables 可以商用吗?

@deltares/fews-web-oc-composables 使用 AGPL 许可。声明的许可为 AGPL,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@deltares/fews-web-oc-composables 的下载量有多少?

根据 npm 官方下载统计,@deltares/fews-web-oc-composables 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,659 次,日均约 89 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@deltares/fews-web-oc-composables 还在维护吗?

最新版本 0.4.0 发布于 2026/11/02(10 天前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/08/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。