nap-sdk 0.2.0 → 0.2.1

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare function parseUri(uri: string): Record<string, unknown>;
2
2
  export declare function parseManifest(yamlStr: string): Record<string, unknown>;
3
- export declare function resolve(uri: string, repoPath: string): Record<string, unknown>;
3
+ export declare function resolve(uri: string, repoPath?: string): Record<string, unknown>;
4
4
  export declare function version(): string;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE7D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE7D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAK/E;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC"}
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { homedir } from "node:os";
2
+ import { join } from "node:path";
1
3
  import native from "./native.js";
2
4
  export function parseUri(uri) {
3
5
  return JSON.parse(native.parseUri(uri));
@@ -6,6 +8,9 @@ export function parseManifest(yamlStr) {
6
8
  return JSON.parse(native.parseManifest(yamlStr));
7
9
  }
8
10
  export function resolve(uri, repoPath) {
11
+ if (!repoPath) {
12
+ repoPath = process.env.NAP_DIR || join(homedir(), ".nap");
13
+ }
9
14
  return JSON.parse(native.resolve(uri, repoPath));
10
15
  }
11
16
  export function version() {
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nap-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "TypeScript SDK for NAP (Narrative Addressing Protocol), powered by Rust and NAPI-RS.",
5
5
  "license": "MIT",
6
6
  "repository": {