Compare commits

...
1 Commits
Author SHA1 Message Date
kingchenc 1aa7df1c97 fix(node): commit npm/<platform>/ templates + optionalDependencies
`napi create-npm-dir` failed in CI with both invocations we tried:
positional arg form (`-t <triple> .`) was rejected as extraneous,
and the no-arg form crashed with "path must be a string, received
undefined". The fix used by every napi-rs reference project: commit
the four platform package.json templates directly under
bindings/node/npm/<target>/ instead of generating them at publish time.

- bindings/node/npm/{linux-x64-gnu,darwin-x64,darwin-arm64,win32-x64-msvc}/
  each contain a static package.json with the correct os / cpu / libc
  filters so npm only installs the right binary per platform.
- Main package.json gains optionalDependencies referencing all four
  platform packages by version, so `npm install wickra` pulls the
  matching binary on each user's machine.
- Release workflow drops the broken `create-npm-dir` loop. The
  `napi artifacts` step now just copies the .node files from the
  build artefacts into the existing npm/ directories before publish.

Bump every version to 0.1.2; cargo / pypi / wickra-wasm jobs are
idempotent so they accept the 0.1.1 they already published while still
emitting the new 0.1.2.
2026-05-21 21:16:33 +02:00
9 changed files with 118 additions and 17 deletions
+3 -7
View File
@@ -181,13 +181,9 @@ jobs:
path: bindings/node/artifacts path: bindings/node/artifacts
pattern: bindings-* pattern: bindings-*
- name: Create npm/<platform>/ scaffolding (one per target) # The npm/<platform>/package.json templates are committed to the
working-directory: bindings/node # repo (see bindings/node/npm/), so `napi artifacts` only needs to
run: | # drop the freshly built .node binary into the matching directory.
for t in x86_64-unknown-linux-gnu x86_64-apple-darwin aarch64-apple-darwin x86_64-pc-windows-msvc; do
npx napi create-npm-dir -t "$t" .
done
- name: Move binaries into platform package layout - name: Move binaries into platform package layout
working-directory: bindings/node working-directory: bindings/node
run: npx napi artifacts --dir artifacts run: npx napi artifacts --dir artifacts
Generated
+6 -6
View File
@@ -1883,7 +1883,7 @@ dependencies = [
[[package]] [[package]]
name = "wickra" name = "wickra"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"approx", "approx",
"criterion", "criterion",
@@ -1894,7 +1894,7 @@ dependencies = [
[[package]] [[package]]
name = "wickra-core" name = "wickra-core"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"approx", "approx",
"proptest", "proptest",
@@ -1904,7 +1904,7 @@ dependencies = [
[[package]] [[package]]
name = "wickra-data" name = "wickra-data"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"approx", "approx",
"csv", "csv",
@@ -1922,7 +1922,7 @@ dependencies = [
[[package]] [[package]]
name = "wickra-node" name = "wickra-node"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"napi", "napi",
"napi-build", "napi-build",
@@ -1932,7 +1932,7 @@ dependencies = [
[[package]] [[package]]
name = "wickra-python" name = "wickra-python"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"numpy", "numpy",
"pyo3", "pyo3",
@@ -1941,7 +1941,7 @@ dependencies = [
[[package]] [[package]]
name = "wickra-wasm" name = "wickra-wasm"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"console_error_panic_hook", "console_error_panic_hook",
"js-sys", "js-sys",
+2 -2
View File
@@ -11,7 +11,7 @@ members = [
exclude = [] exclude = []
[workspace.package] [workspace.package]
version = "0.1.1" version = "0.1.2"
authors = ["Wickra Contributors"] authors = ["Wickra Contributors"]
edition = "2021" edition = "2021"
rust-version = "1.75" rust-version = "1.75"
@@ -23,7 +23,7 @@ keywords = ["finance", "trading", "indicators", "technical-analysis", "ta"]
categories = ["finance", "mathematics", "science"] categories = ["finance", "mathematics", "science"]
[workspace.dependencies] [workspace.dependencies]
wickra-core = { path = "crates/wickra-core", version = "0.1.1" } wickra-core = { path = "crates/wickra-core", version = "0.1.2" }
thiserror = "2" thiserror = "2"
rayon = "1.10" rayon = "1.10"
@@ -0,0 +1,24 @@
{
"name": "wickra-darwin-arm64",
"version": "0.1.2",
"description": "Native binding for wickra (macOS Apple Silicon). Installed automatically as an optional dependency of wickra on matching platforms.",
"main": "wickra.darwin-arm64.node",
"files": [
"wickra.darwin-arm64.node"
],
"license": "SEE LICENSE IN LICENSE",
"engines": {
"node": ">= 16"
},
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"repository": {
"type": "git",
"url": "https://github.com/kingchenc/wickra"
},
"homepage": "https://github.com/kingchenc/wickra"
}
+24
View File
@@ -0,0 +1,24 @@
{
"name": "wickra-darwin-x64",
"version": "0.1.2",
"description": "Native binding for wickra (macOS Intel). Installed automatically as an optional dependency of wickra on matching platforms.",
"main": "wickra.darwin-x64.node",
"files": [
"wickra.darwin-x64.node"
],
"license": "SEE LICENSE IN LICENSE",
"engines": {
"node": ">= 16"
},
"os": [
"darwin"
],
"cpu": [
"x64"
],
"repository": {
"type": "git",
"url": "https://github.com/kingchenc/wickra"
},
"homepage": "https://github.com/kingchenc/wickra"
}
@@ -0,0 +1,27 @@
{
"name": "wickra-linux-x64-gnu",
"version": "0.1.2",
"description": "Native binding for wickra (linux x64 GNU). Installed automatically as an optional dependency of wickra on matching platforms.",
"main": "wickra.linux-x64-gnu.node",
"files": [
"wickra.linux-x64-gnu.node"
],
"license": "SEE LICENSE IN LICENSE",
"engines": {
"node": ">= 16"
},
"os": [
"linux"
],
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"repository": {
"type": "git",
"url": "https://github.com/kingchenc/wickra"
},
"homepage": "https://github.com/kingchenc/wickra"
}
@@ -0,0 +1,24 @@
{
"name": "wickra-win32-x64-msvc",
"version": "0.1.2",
"description": "Native binding for wickra (Windows x64 MSVC). Installed automatically as an optional dependency of wickra on matching platforms.",
"main": "wickra.win32-x64-msvc.node",
"files": [
"wickra.win32-x64-msvc.node"
],
"license": "SEE LICENSE IN LICENSE",
"engines": {
"node": ">= 16"
},
"os": [
"win32"
],
"cpu": [
"x64"
],
"repository": {
"type": "git",
"url": "https://github.com/kingchenc/wickra"
},
"homepage": "https://github.com/kingchenc/wickra"
}
+7 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "wickra", "name": "wickra",
"version": "0.1.1", "version": "0.1.2",
"description": "Streaming-first technical indicators: incremental, fast, install-free. Node bindings powered by Rust.", "description": "Streaming-first technical indicators: incremental, fast, install-free. Node bindings powered by Rust.",
"author": "kingchenc <kingchencp@gmail.com>", "author": "kingchenc <kingchencp@gmail.com>",
"main": "index.js", "main": "index.js",
@@ -44,6 +44,12 @@
"engines": { "engines": {
"node": ">= 16" "node": ">= 16"
}, },
"optionalDependencies": {
"wickra-linux-x64-gnu": "0.1.2",
"wickra-darwin-x64": "0.1.2",
"wickra-darwin-arm64": "0.1.2",
"wickra-win32-x64-msvc": "0.1.2"
},
"scripts": { "scripts": {
"build": "napi build --platform --release", "build": "napi build --platform --release",
"build:debug": "napi build --platform", "build:debug": "napi build --platform",
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "maturin"
[project] [project]
name = "wickra" name = "wickra"
version = "0.1.1" version = "0.1.2"
description = "Streaming-first technical indicators: incremental, fast, install-free." description = "Streaming-first technical indicators: incremental, fast, install-free."
readme = "README.md" readme = "README.md"
license = { text = "PolyForm-Noncommercial-1.0.0" } license = { text = "PolyForm-Noncommercial-1.0.0" }