@browsersync/bslive 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml CHANGED
@@ -1,19 +1,5 @@
1
- [package]
2
- edition = "2021"
3
- name = "bslive"
4
- version = "0.0.0"
1
+ workspace.members = ["bslive"]
2
+ workspace.resolver = "2"
5
3
 
6
- [lib]
7
- crate-type = ["cdylib"]
8
-
9
- [dependencies]
10
- # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11
- napi = { version = "2.12.2", default-features = false, features = ["napi4"] }
12
- napi-derive = "2.12.2"
13
-
14
- [build-dependencies]
15
- napi-build = "2.0.1"
16
-
17
- [profile.release]
18
- lto = true
19
- strip = "symbols"
4
+ [workspace.dependencies]
5
+ tokio = { version = "1.37.0", features = ["full"] }
package/bin.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ console.log('from cli package');
3
+
4
+ const { start } = require("./index.js");
5
+ start(process.argv.slice(1)).catch(console.error);
@@ -0,0 +1,20 @@
1
+ [package]
2
+ edition = "2021"
3
+ name = "bslive"
4
+ version = "0.0.0"
5
+
6
+ [lib]
7
+ crate-type = ["cdylib"]
8
+
9
+ [dependencies]
10
+ # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11
+ napi = { version = "2.12.2", default-features = false, features = ["napi4", "tokio_rt", "tokio_full"] }
12
+ napi-derive = "2.12.2"
13
+ tokio = { workspace = true }
14
+
15
+ [build-dependencies]
16
+ napi-build = "2.0.1"
17
+
18
+ [profile.release]
19
+ lto = true
20
+ strip = "symbols"
@@ -0,0 +1,14 @@
1
+ #![deny(clippy::all)]
2
+
3
+ #[macro_use]
4
+ extern crate napi_derive;
5
+
6
+ use std::time::Duration;
7
+ use tokio::time::sleep;
8
+
9
+ #[napi]
10
+ async fn start(args: Vec<String>) -> napi::bindgen_prelude::Result<i32> {
11
+ println!("{:?}", args);
12
+ sleep(Duration::from_secs(2)).await;
13
+ Ok(32)
14
+ }
package/index.d.ts CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export function sum(a: number, b: number): number
6
+ export function start(args: Array<string>): Promise<number>
package/index.js CHANGED
@@ -310,6 +310,6 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { sum } = nativeBinding
313
+ const { start } = nativeBinding
314
314
 
315
- module.exports.sum = sum
315
+ module.exports.start = start
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@browsersync/bslive",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
+ "bin": {
7
+ "bslive": "./bin.js"
8
+ },
6
9
  "napi": {
7
10
  "name": "bslive",
8
11
  "triples": {
@@ -36,29 +39,29 @@
36
39
  },
37
40
  "scripts": {
38
41
  "artifacts": "napi artifacts",
39
- "build": "napi build --platform --release",
40
- "build:debug": "napi build --platform",
42
+ "build": "napi build --cargo-name bslive --platform --release",
43
+ "build:debug": "napi build --cargo-name bslive --platform",
41
44
  "prepublishOnly": "napi prepublish -t npm",
42
45
  "test": "ava",
43
46
  "universal": "napi universal",
44
47
  "version": "napi version"
45
48
  },
46
49
  "optionalDependencies": {
47
- "@browsersync/bslive-win32-x64-msvc": "0.0.5",
48
- "@browsersync/bslive-darwin-x64": "0.0.5",
49
- "@browsersync/bslive-linux-x64-gnu": "0.0.5",
50
- "@browsersync/bslive-darwin-arm64": "0.0.5",
51
- "@browsersync/bslive-android-arm64": "0.0.5",
52
- "@browsersync/bslive-linux-arm64-gnu": "0.0.5",
53
- "@browsersync/bslive-linux-arm64-musl": "0.0.5",
54
- "@browsersync/bslive-win32-arm64-msvc": "0.0.5",
55
- "@browsersync/bslive-linux-arm-gnueabihf": "0.0.5",
56
- "@browsersync/bslive-linux-arm-musleabihf": "0.0.5",
57
- "@browsersync/bslive-linux-x64-musl": "0.0.5",
58
- "@browsersync/bslive-freebsd-x64": "0.0.5",
59
- "@browsersync/bslive-win32-ia32-msvc": "0.0.5",
60
- "@browsersync/bslive-android-arm-eabi": "0.0.5",
61
- "@browsersync/bslive-darwin-universal": "0.0.5",
62
- "@browsersync/bslive-linux-riscv64-gnu": "0.0.5"
50
+ "@browsersync/bslive-win32-x64-msvc": "0.0.7",
51
+ "@browsersync/bslive-darwin-x64": "0.0.7",
52
+ "@browsersync/bslive-linux-x64-gnu": "0.0.7",
53
+ "@browsersync/bslive-darwin-arm64": "0.0.7",
54
+ "@browsersync/bslive-android-arm64": "0.0.7",
55
+ "@browsersync/bslive-linux-arm64-gnu": "0.0.7",
56
+ "@browsersync/bslive-linux-arm64-musl": "0.0.7",
57
+ "@browsersync/bslive-win32-arm64-msvc": "0.0.7",
58
+ "@browsersync/bslive-linux-arm-gnueabihf": "0.0.7",
59
+ "@browsersync/bslive-linux-arm-musleabihf": "0.0.7",
60
+ "@browsersync/bslive-linux-x64-musl": "0.0.7",
61
+ "@browsersync/bslive-freebsd-x64": "0.0.7",
62
+ "@browsersync/bslive-win32-ia32-msvc": "0.0.7",
63
+ "@browsersync/bslive-android-arm-eabi": "0.0.7",
64
+ "@browsersync/bslive-darwin-universal": "0.0.7",
65
+ "@browsersync/bslive-linux-riscv64-gnu": "0.0.7"
63
66
  }
64
67
  }
package/src/lib.rs DELETED
@@ -1,9 +0,0 @@
1
- #![deny(clippy::all)]
2
-
3
- #[macro_use]
4
- extern crate napi_derive;
5
-
6
- #[napi]
7
- pub fn sum(a: i32, b: i32) -> i32 {
8
- a + b
9
- }
File without changes