@datastripes/forecast
v0.2.6
Published
WebAssembly time-series forecasting engine with drop-in components for React, Vue, Angular, and vanilla Custom Elements, shipped as one package with one subpath per framework.
Readme
@datastripes/forecast
Time-series forecasting engine with drop-in UI components for React, Vue, Angular, and vanilla Custom Elements, in one npm package.
npm install @datastripes/forecast| Import path | Contents | Needs |
|---|---|---|
| @datastripes/forecast | Core engine: executeForecast, auto column discovery, licensing client, all types | nothing |
| @datastripes/forecast/react | DatastripesForecast and companion components, useWasmForecast hook | react, react-dom ^19 |
| @datastripes/forecast/vue | DatastripesForecast and companion components, useWasmForecast composable | vue ^3.4 |
| @datastripes/forecast/angular | Standalone components (DatastripesForecastComponent, …), Angular Package Format | @angular/core, @angular/common ^18 || ^19 |
| @datastripes/forecast/elements | <datastripes-forecast-studio> and companion Custom Elements | nothing |
The UI frameworks are optional peer dependencies, so installing the package never pulls one in. Every framework entry re-exports the core API, and all entries share one copy of the core engine at runtime.
Build
npm run build (from this folder, or npm run build -w @datastripes/forecast
from the repo root) wipes dist/ and runs three steps:
build:core,tsup: the root,/react, and/elementsentries (ESM + CJS +.d.ts, with the shared engine split into a common chunk), plus a self-contained IIFE build atdist/elements/index.global.jsfor plain<script>tags.build:vue, Vite library mode with@vitejs/plugin-vueandvite-plugin-dts, intodist/vue/. The Vue sources import the core relatively; the build rewrites that import to@datastripes/forecastand keeps it external.build:angular,ng-packagronsrc/angular/ng-package.json, intodist/angular/(Ivy partial compilation, FESM2022 bundle atdist/angular/fesm2022/datastripes-forecast-angular.mjs). It imports the core as@datastripes/forecast, so it must run after step 1.
Why the Angular entry has its own package.json
ng-packagr derives an entry point's module id from where its ng-package.json
sits relative to the primary package that ng-packagr itself builds, and it
deletes and owns its primary dest. Here the primary entry is built by tsup,
not ng-packagr, so src/angular/ is set up as the ng-packagr project:
src/angular/package.json names it @datastripes/forecast/angular (private, never
published on its own) and ng-package.json writes to ../../dist/angular.
The result matches APF secondary-entry-point output, and the root
package.json's "./angular" export points at it.
Angular 18.2, ng-packagr 18.2, and TypeScript ~5.4 are pinned as dev dependencies of this package because Angular 18's compiler does not support newer TypeScript.
Checks
npm run lint:vue-tscover everything exceptsrc/angular, thentscoversrc/angularwith the Angular decorator settings.- Tests run from the repo root with
npm test(vitest).
