@quillmark/quiver 0.6.0 → 0.7.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.
- package/dist/node.d.ts +11 -1
- package/dist/node.js +12 -1
- package/package.json +1 -1
package/dist/node.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Importing this module is the consumer's explicit declaration of intent:
|
|
5
5
|
* "I am running in Node and want the Node-only Quiver factories." It exposes
|
|
6
6
|
* the same `Quiver` class as the main entry, augmented with `fromDir`,
|
|
7
|
-
* `fromPackage`, `fromBuiltDir`, and `
|
|
7
|
+
* `fromPackage`, `fromBuiltDir`, `build`, and `buildPackage` static methods.
|
|
8
8
|
*
|
|
9
9
|
* Side effect: at module evaluation time, the Node-only static methods are
|
|
10
10
|
* installed on the shared `Quiver` constructor. Any other module that already
|
|
@@ -63,6 +63,16 @@ type NodeQuiverStatics = {
|
|
|
63
63
|
* on I/O failures.
|
|
64
64
|
*/
|
|
65
65
|
build(sourceDir: string, outDir: string, opts?: BuildOptions): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Resolves an npm specifier against `node_modules` and builds the source
|
|
68
|
+
* layout at the package root. The resolved package must have `Quiver.yaml`
|
|
69
|
+
* at its root. Symmetric to `fromPackage` but writes a runtime build
|
|
70
|
+
* artifact to outDir instead of loading.
|
|
71
|
+
*
|
|
72
|
+
* Throws `transport_error` on resolution/I/O failure, `quiver_invalid` on
|
|
73
|
+
* source validation failures.
|
|
74
|
+
*/
|
|
75
|
+
buildPackage(specifier: string, outDir: string, opts?: BuildOptions): Promise<void>;
|
|
66
76
|
};
|
|
67
77
|
export type Quiver = Base;
|
|
68
78
|
export declare const Quiver: typeof Base & NodeQuiverStatics;
|
package/dist/node.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Importing this module is the consumer's explicit declaration of intent:
|
|
5
5
|
* "I am running in Node and want the Node-only Quiver factories." It exposes
|
|
6
6
|
* the same `Quiver` class as the main entry, augmented with `fromDir`,
|
|
7
|
-
* `fromPackage`, `fromBuiltDir`, and `
|
|
7
|
+
* `fromPackage`, `fromBuiltDir`, `build`, and `buildPackage` static methods.
|
|
8
8
|
*
|
|
9
9
|
* Side effect: at module evaluation time, the Node-only static methods are
|
|
10
10
|
* installed on the shared `Quiver` constructor. Any other module that already
|
|
@@ -55,6 +55,17 @@ Quiver.fromPackage = async function fromPackage(specifier) {
|
|
|
55
55
|
Quiver.build = async function build(sourceDir, outDir, opts) {
|
|
56
56
|
return buildQuiver(sourceDir, outDir, opts);
|
|
57
57
|
};
|
|
58
|
+
Quiver.buildPackage = async function buildPackage(specifier, outDir, opts) {
|
|
59
|
+
const req = createRequire(import.meta.url);
|
|
60
|
+
let yamlPath;
|
|
61
|
+
try {
|
|
62
|
+
yamlPath = req.resolve(`${specifier}/Quiver.yaml`);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
throw new QuiverError("transport_error", `Failed to resolve quiver package "${specifier}": ${err.message}`, { cause: err });
|
|
66
|
+
}
|
|
67
|
+
return buildQuiver(dirname(yamlPath), outDir, opts);
|
|
68
|
+
};
|
|
58
69
|
// ---------------------------------------------------------------------------
|
|
59
70
|
// 3. Re-export the rest of the public surface so consumers get one import.
|
|
60
71
|
// ---------------------------------------------------------------------------
|