@openedges/pkl-napi 0.0.0-stage → 0.32.0

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.
@@ -0,0 +1,29 @@
1
+ import type { PklValue } from "./index.cjs";
2
+
3
+ export function roundtripValue<T extends PklValue>(val: T): PklValue;
4
+ export function roundtripInteger(val: bigint): bigint;
5
+ export function roundtripBytes(val: Uint8Array): Uint8Array;
6
+ export function roundtripString(val: string): string;
7
+
8
+ export interface ConversionBenchmarkResult {
9
+ iterations: number;
10
+ totalMs: number;
11
+ elapsedMs: number;
12
+ nativeElapsedMs: number;
13
+ avgUs: number;
14
+ perIterationUs: number;
15
+ nativePerIterationUs: number;
16
+ opsPerSec: number;
17
+ sample: PklValue;
18
+ lastValue: PklValue;
19
+ }
20
+ export type ConversionTelemetry = ConversionBenchmarkResult;
21
+
22
+ export function measureConversion(
23
+ iterations?: number,
24
+ sampleValue?: PklValue,
25
+ ): ConversionBenchmarkResult;
26
+ export function measureConversion(
27
+ value: PklValue,
28
+ iterations?: number,
29
+ ): ConversionBenchmarkResult;
@@ -0,0 +1,38 @@
1
+ import type { PklValue } from "./index.mjs";
2
+
3
+ export function roundtripValue<T extends PklValue>(val: T): PklValue;
4
+ export function roundtripInteger(val: bigint): bigint;
5
+ export function roundtripBytes(val: Uint8Array): Uint8Array;
6
+ export function roundtripString(val: string): string;
7
+
8
+ export interface ConversionBenchmarkResult {
9
+ iterations: number;
10
+ totalMs: number;
11
+ elapsedMs: number;
12
+ nativeElapsedMs: number;
13
+ avgUs: number;
14
+ perIterationUs: number;
15
+ nativePerIterationUs: number;
16
+ opsPerSec: number;
17
+ sample: PklValue;
18
+ lastValue: PklValue;
19
+ }
20
+ export type ConversionTelemetry = ConversionBenchmarkResult;
21
+
22
+ export function measureConversion(
23
+ iterations?: number,
24
+ sampleValue?: PklValue,
25
+ ): ConversionBenchmarkResult;
26
+ export function measureConversion(
27
+ value: PklValue,
28
+ iterations?: number,
29
+ ): ConversionBenchmarkResult;
30
+
31
+ declare const _testingDefault: {
32
+ roundtripValue: typeof roundtripValue;
33
+ roundtripInteger: typeof roundtripInteger;
34
+ roundtripBytes: typeof roundtripBytes;
35
+ roundtripString: typeof roundtripString;
36
+ measureConversion: typeof measureConversion;
37
+ };
38
+ export default _testingDefault;
@@ -0,0 +1,29 @@
1
+ import type { PklValue } from "./index";
2
+
3
+ export function roundtripValue<T extends PklValue>(val: T): PklValue;
4
+ export function roundtripInteger(val: bigint): bigint;
5
+ export function roundtripBytes(val: Uint8Array): Uint8Array;
6
+ export function roundtripString(val: string): string;
7
+
8
+ export interface ConversionBenchmarkResult {
9
+ iterations: number;
10
+ totalMs: number;
11
+ elapsedMs: number;
12
+ nativeElapsedMs: number;
13
+ avgUs: number;
14
+ perIterationUs: number;
15
+ nativePerIterationUs: number;
16
+ opsPerSec: number;
17
+ sample: PklValue;
18
+ lastValue: PklValue;
19
+ }
20
+ export type ConversionTelemetry = ConversionBenchmarkResult;
21
+
22
+ export function measureConversion(
23
+ iterations?: number,
24
+ sampleValue?: PklValue,
25
+ ): ConversionBenchmarkResult;
26
+ export function measureConversion(
27
+ value: PklValue,
28
+ iterations?: number,
29
+ ): ConversionBenchmarkResult;
@@ -0,0 +1,14 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ const require = createRequire(import.meta.url);
4
+ const testing = require("./testing.cjs");
5
+
6
+ export const {
7
+ roundtripValue,
8
+ roundtripInteger,
9
+ roundtripBytes,
10
+ roundtripString,
11
+ measureConversion,
12
+ } = testing;
13
+
14
+ export default testing;
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,86 @@
1
1
  {
2
2
  "name": "@openedges/pkl-napi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.32.0",
4
+ "description": "Node.js N-API bindings for the shared pure-Rust Apple Pkl 0.32.0 engine",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/openedges/pkl-rs.git",
9
+ "directory": "packages/pkl-napi"
10
+ },
11
+ "homepage": "https://github.com/openedges/pkl-rs/tree/main/packages/pkl-napi#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/openedges/pkl-rs/issues"
14
+ },
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.mjs",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "import": {
21
+ "types": "./dist/index.d.mts",
22
+ "default": "./dist/index.mjs"
23
+ },
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.cjs"
27
+ }
28
+ },
29
+ "./testing": {
30
+ "import": {
31
+ "types": "./dist/testing.d.mts",
32
+ "default": "./dist/testing.mjs"
33
+ },
34
+ "require": {
35
+ "types": "./dist/testing.d.cts",
36
+ "default": "./dist/testing.cjs"
37
+ }
38
+ }
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "native",
43
+ "README.md",
44
+ "LICENSE",
45
+ "NOTICE",
46
+ "THIRD-PARTY-NOTICES.md"
47
+ ],
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ },
51
+ "os": [
52
+ "darwin",
53
+ "linux",
54
+ "win32"
55
+ ],
56
+ "cpu": [
57
+ "arm64",
58
+ "x64"
59
+ ],
60
+ "pklPlatformSupport": {
61
+ "runtime": "napi-node",
62
+ "napiVersion": 8,
63
+ "linuxGlibcMinimum": "2.28",
64
+ "targets": [
65
+ "darwin-arm64",
66
+ "darwin-x64",
67
+ "linux-x64-gnu",
68
+ "linux-arm64-gnu",
69
+ "linux-x64-musl",
70
+ "linux-arm64-musl",
71
+ "win32-x64-msvc"
72
+ ]
73
+ },
74
+ "scripts": {
75
+ "build": "node ./scripts/build.mjs",
76
+ "test": "node ./test/run.mjs"
77
+ },
78
+ "keywords": [
79
+ "pkl",
80
+ "apple-pkl",
81
+ "configuration",
82
+ "napi",
83
+ "rust",
84
+ "nodejs"
85
+ ]
86
+ }