@thirtified/eudi-dev 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +223 -2
- package/dist/binary.d.ts +42 -0
- package/dist/binary.js +76 -0
- package/dist/binary.js.map +1 -0
- package/dist/commands/credentials.d.ts +151 -0
- package/dist/commands/credentials.js +234 -0
- package/dist/commands/credentials.js.map +1 -0
- package/dist/commands/registrar.d.ts +116 -0
- package/dist/commands/registrar.js +150 -0
- package/dist/commands/registrar.js.map +1 -0
- package/dist/commands/trust.d.ts +58 -0
- package/dist/commands/trust.js +90 -0
- package/dist/commands/trust.js.map +1 -0
- package/dist/errors.d.ts +47 -0
- package/dist/errors.js +41 -0
- package/dist/errors.js.map +1 -0
- package/dist/eudi.d.ts +66 -0
- package/dist/eudi.js +113 -0
- package/dist/eudi.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/input.d.ts +32 -0
- package/dist/input.js +7 -0
- package/dist/input.js.map +1 -0
- package/dist/runner.d.ts +86 -0
- package/dist/runner.js +246 -0
- package/dist/runner.js.map +1 -0
- package/dist/types.d.ts +345 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +24 -0
- package/dist/version.js +35 -0
- package/dist/version.js.map +1 -0
- package/package.json +71 -4
- package/src/binary.ts +114 -0
- package/src/commands/credentials.ts +384 -0
- package/src/commands/registrar.ts +243 -0
- package/src/commands/trust.ts +123 -0
- package/src/errors.ts +66 -0
- package/src/eudi.ts +159 -0
- package/src/index.ts +44 -0
- package/src/input.ts +27 -0
- package/src/runner.ts +310 -0
- package/src/types.ts +396 -0
- package/src/version.ts +36 -0
package/src/version.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The eudi-dev release this package is written and tested against.
|
|
3
|
+
*
|
|
4
|
+
* The `--json` documents only gain fields within a major version (upstream
|
|
5
|
+
* ADR 0020), so any v3.x binary works. A different major version is refused
|
|
6
|
+
* unless `allowAnyVersion` is set.
|
|
7
|
+
*/
|
|
8
|
+
export const EUDI_DEV_VERSION = 'v3.10.1';
|
|
9
|
+
|
|
10
|
+
/** The upstream major version whose JSON contract the types describe. */
|
|
11
|
+
export const SUPPORTED_MAJOR = 3;
|
|
12
|
+
|
|
13
|
+
/** GitHub repository that publishes the release binaries. */
|
|
14
|
+
export const UPSTREAM_REPO = 'eudi-dev/eudi-dev';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Parses a version tag such as `v3.10.1` or `v3.0.0-beta.1`. Returns
|
|
18
|
+
* `undefined` for `dev` builds and anything else that isn't semver-like.
|
|
19
|
+
*/
|
|
20
|
+
export function parseVersion(tag: string): { major: number; minor: number; patch: number; prerelease?: string } | undefined {
|
|
21
|
+
const m = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(tag.trim());
|
|
22
|
+
if (!m) return undefined;
|
|
23
|
+
const result: { major: number; minor: number; patch: number; prerelease?: string } = {
|
|
24
|
+
major: Number(m[1]),
|
|
25
|
+
minor: Number(m[2]),
|
|
26
|
+
patch: Number(m[3]),
|
|
27
|
+
};
|
|
28
|
+
if (m[4] !== undefined) result.prerelease = m[4];
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Normalises `3.10.1` to `v3.10.1`. */
|
|
33
|
+
export function normaliseTag(version: string): string {
|
|
34
|
+
const v = version.trim();
|
|
35
|
+
return v.startsWith('v') ? v : `v${v}`;
|
|
36
|
+
}
|