@kanonak-protocol/cli 8.2.0 → 8.4.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/commands/install.d.ts +6 -2
- package/dist/commands/lock.d.ts +21 -0
- package/dist/commands/upgrade.d.ts +17 -0
- package/dist/index.js +284 -262
- package/package.json +3 -3
|
@@ -9,7 +9,9 @@ import { FileCache } from '../cache/FileCache.js';
|
|
|
9
9
|
* Installing `publisher/package` installs exactly the version that lock pins
|
|
10
10
|
* plus the closure it pins, verifying every fetched file against the lock's
|
|
11
11
|
* sha256 before caching (the `npm ci` model). There is no version-range
|
|
12
|
-
* selection: the publisher's lock IS the resolution.
|
|
12
|
+
* selection here: the publisher's lock IS the resolution. `kanonak lock`
|
|
13
|
+
* writes a folder's lock from the ranges its packages state, and
|
|
14
|
+
* `kanonak install` with no package installs exactly that lock.
|
|
13
15
|
*
|
|
14
16
|
* Where the bytes come from is the consumer's choice when it configured
|
|
15
17
|
* package URL templates (#130): a new install records the template's URL in
|
|
@@ -28,7 +30,9 @@ import { FileCache } from '../cache/FileCache.js';
|
|
|
28
30
|
*
|
|
29
31
|
* A refusal throws; the CLI reports it and exits 1.
|
|
30
32
|
*/
|
|
31
|
-
export declare function installCommand(packageRef?: string
|
|
33
|
+
export declare function installCommand(packageRef?: string, options?: {
|
|
34
|
+
frozen?: boolean;
|
|
35
|
+
}): Promise<void>;
|
|
32
36
|
/**
|
|
33
37
|
* Ensure a pinned package is in the cache: a cache hit is verified against the
|
|
34
38
|
* lock's integrity; a miss is fetched through `publisherIndex` (the user's
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { KanonakParser } from '@kanonak-protocol/sdk';
|
|
2
|
+
import type { KanonakDocument } from '@kanonak-protocol/types/document/models';
|
|
3
|
+
/**
|
|
4
|
+
* `kanonak lock` — write the `kanonak.lock` of the packages in this folder.
|
|
5
|
+
*
|
|
6
|
+
* Every dependency import, transitively, is locked at the newest version
|
|
7
|
+
* every range on its package admits, from the publishers' locks and their
|
|
8
|
+
* lines (`resolveLock`). Every range is resolved again each time the lock is
|
|
9
|
+
* written, so its diff shows each move for review. Every version is checked
|
|
10
|
+
* against its sha256 and cached, and `kanonak install` then installs exactly
|
|
11
|
+
* what the lock pins.
|
|
12
|
+
*
|
|
13
|
+
* The lock is the folder's packages' and nothing else's: an entry none of
|
|
14
|
+
* them reaches, such as one `kanonak install {publisher}/{package}` added,
|
|
15
|
+
* leaves it. Where the bytes come from is the consumer's choice when it
|
|
16
|
+
* configured package URL templates (#130). A refusal throws; the CLI reports
|
|
17
|
+
* it and exits 1.
|
|
18
|
+
*/
|
|
19
|
+
export declare function lockCommand(): Promise<void>;
|
|
20
|
+
/** The Kanonak packages in `folder`, each parsed; one that doesn't parse throws, naming its file. */
|
|
21
|
+
export declare function readPackages(folder: string, parser: KanonakParser): KanonakDocument[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `kanonak upgrade` — raise each import's floor in the newest version of every
|
|
3
|
+
* package in this folder to the newest version its range admits, and import
|
|
4
|
+
* each built-in home whose terms it names, as a new version of the package
|
|
5
|
+
* (`planUpgrade`). Upgrading is editing the text: what a version reads is
|
|
6
|
+
* stated in it, so a newer dependency reaches a package only through a
|
|
7
|
+
* version that states it.
|
|
8
|
+
*
|
|
9
|
+
* A source named for its version, `{version}.kan.yml` or
|
|
10
|
+
* `{package}@{version}.kan.yml`, is a published version whose bytes never
|
|
11
|
+
* change, so the new version is written beside it under its own name. Any
|
|
12
|
+
* other source is the package's one file, and is edited in place. With
|
|
13
|
+
* `check`, nothing is written, and it exits 1 when anything would change.
|
|
14
|
+
*/
|
|
15
|
+
export declare function upgradeCommand(options: {
|
|
16
|
+
check?: boolean;
|
|
17
|
+
}): Promise<void>;
|