frakment 4.0.0 → 5.0.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/package.json +1 -1
- package/dist/src/commands/add.js +11 -2
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/src/commands/add.js
CHANGED
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
13
|
import { existsSync } from "node:fs";
|
|
14
14
|
import { readFile } from "node:fs/promises";
|
|
15
|
+
import { createRequire } from "node:module";
|
|
15
16
|
import path from "node:path";
|
|
16
17
|
import chalk from "chalk";
|
|
17
18
|
import { execa } from "execa";
|
|
@@ -26,8 +27,16 @@ const dependencyPattern = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*(?:@
|
|
|
26
27
|
const maxRegistryPayloadBytes = 10 * 1024 * 1024;
|
|
27
28
|
const maxRegistryManifestBytes = 1024 * 1024;
|
|
28
29
|
const defaultWebRegistry = "https://www.arrafi.dev/frakment/r";
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
const cliPackage = createRequire(import.meta.url)("../../package.json");
|
|
31
|
+
if (typeof cliPackage !== "object" ||
|
|
32
|
+
cliPackage === null ||
|
|
33
|
+
!("version" in cliPackage) ||
|
|
34
|
+
typeof cliPackage.version !== "string") {
|
|
35
|
+
throw new Error("CLI package version is unavailable");
|
|
36
|
+
}
|
|
37
|
+
const registryReleaseUrl = `https://github.com/frakment/ui/releases/download/${encodeURIComponent(`frakment@${cliPackage.version}`)}`;
|
|
38
|
+
const registryManifestUrl = `${registryReleaseUrl}/manifest.json`;
|
|
39
|
+
const registrySignatureUrl = `${registryReleaseUrl}/manifest.sigstore.json`;
|
|
31
40
|
const registrySignerIdentity = "^https://github\\.com/frakment/ui/\\.github/workflows/registry-sign\\.yml@refs/heads/main$";
|
|
32
41
|
const sigstoreIssuer = "https://token.actions.githubusercontent.com";
|
|
33
42
|
const defaultAliases = {
|