@absolutejs/absolute 0.19.0-beta.1118 → 0.19.0-beta.1119
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-dCpCal/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-dCpCal/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-dCpCal/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
package/dist/cli/index.js
CHANGED
|
@@ -171648,20 +171648,27 @@ __export(exports_lintProof, {
|
|
|
171648
171648
|
createLintSourceTree: () => createLintSourceTree,
|
|
171649
171649
|
createLintProof: () => createLintProof
|
|
171650
171650
|
});
|
|
171651
|
-
import {
|
|
171651
|
+
import {
|
|
171652
|
+
createHash as createHash2,
|
|
171653
|
+
createPrivateKey,
|
|
171654
|
+
createPublicKey,
|
|
171655
|
+
sign,
|
|
171656
|
+
verify
|
|
171657
|
+
} from "crypto";
|
|
171652
171658
|
import {
|
|
171653
171659
|
existsSync as existsSync11,
|
|
171654
171660
|
lstatSync,
|
|
171655
171661
|
mkdirSync as mkdirSync8,
|
|
171656
171662
|
mkdtempSync,
|
|
171657
171663
|
readFileSync as readFileSync14,
|
|
171664
|
+
realpathSync,
|
|
171658
171665
|
renameSync as renameSync2,
|
|
171659
171666
|
rmSync as rmSync5,
|
|
171660
171667
|
writeFileSync as writeFileSync7
|
|
171661
171668
|
} from "fs";
|
|
171662
171669
|
import { tmpdir as tmpdir2 } from "os";
|
|
171663
171670
|
import { delimiter, dirname as dirname5, relative as relative2, resolve as resolve11 } from "path";
|
|
171664
|
-
var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSION = 1, runGit = (args, options) => {
|
|
171671
|
+
var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSION = 1, FLAG_NOT_FOUND = -1, runGit = (args, options) => {
|
|
171665
171672
|
const proc = Bun.spawnSync(["git", ...args], {
|
|
171666
171673
|
cwd: options.cwd,
|
|
171667
171674
|
env: { ...process.env, ...options.env },
|
|
@@ -171673,7 +171680,43 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171673
171680
|
throw new Error(detail || `git ${args.join(" ")} failed`);
|
|
171674
171681
|
}
|
|
171675
171682
|
return proc.stdout.toString().trim();
|
|
171676
|
-
}, gitRoot = (cwd) => resolve11(runGit(["rev-parse", "--show-toplevel"], { cwd })),
|
|
171683
|
+
}, gitRoot = (cwd) => resolve11(runGit(["rev-parse", "--show-toplevel"], { cwd })), isInside = (parent, candidate) => {
|
|
171684
|
+
const path = relative2(parent, candidate);
|
|
171685
|
+
return path === "" || !path.startsWith("../") && path !== "..";
|
|
171686
|
+
}, attestationPayload = (proof) => Buffer.from([
|
|
171687
|
+
"absolute-lint-proof-attestation:1",
|
|
171688
|
+
JSON.stringify({
|
|
171689
|
+
command: proof.command,
|
|
171690
|
+
contractVersion: proof.contractVersion,
|
|
171691
|
+
createdAt: proof.createdAt,
|
|
171692
|
+
lintFingerprint: proof.lintFingerprint,
|
|
171693
|
+
sourceTree: proof.sourceTree
|
|
171694
|
+
})
|
|
171695
|
+
].join("\x00")), publicKeyId = (key) => createHash2("sha256").update(key.export({ format: "der", type: "spki" })).digest("hex"), readEd25519PrivateKey = (cwd, location) => {
|
|
171696
|
+
const path = resolve11(cwd, location);
|
|
171697
|
+
if (isInside(realpathSync(gitRoot(cwd)), realpathSync(path))) {
|
|
171698
|
+
throw new Error("lint proof signing key must live outside the Git working tree");
|
|
171699
|
+
}
|
|
171700
|
+
const key = createPrivateKey(readFileSync14(path));
|
|
171701
|
+
if (key.asymmetricKeyType !== "ed25519") {
|
|
171702
|
+
throw new Error("lint proof signing key must be an Ed25519 private key");
|
|
171703
|
+
}
|
|
171704
|
+
return key;
|
|
171705
|
+
}, readEd25519PublicKey = (cwd, location) => {
|
|
171706
|
+
const key = createPublicKey(readFileSync14(resolve11(cwd, location)));
|
|
171707
|
+
if (key.asymmetricKeyType !== "ed25519") {
|
|
171708
|
+
throw new Error("trusted lint proof key must be an Ed25519 public key");
|
|
171709
|
+
}
|
|
171710
|
+
return key;
|
|
171711
|
+
}, stageFiles = (files, root, env3) => {
|
|
171712
|
+
const batchSize = 200;
|
|
171713
|
+
for (let index = 0;index < files.length; index += batchSize) {
|
|
171714
|
+
runGit(["add", "-f", "--", ...files.slice(index, index + batchSize)], {
|
|
171715
|
+
cwd: root,
|
|
171716
|
+
env: env3
|
|
171717
|
+
});
|
|
171718
|
+
}
|
|
171719
|
+
}, createLintSourceTree = (cwd = process.cwd(), proofLocation = DEFAULT_PROOF_LOCATION) => {
|
|
171677
171720
|
const root = gitRoot(cwd);
|
|
171678
171721
|
const proofPath = resolve11(cwd, proofLocation);
|
|
171679
171722
|
const proofRelative = relative2(root, proofPath).replaceAll("\\", "/");
|
|
@@ -171707,12 +171750,7 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171707
171750
|
return false;
|
|
171708
171751
|
}
|
|
171709
171752
|
});
|
|
171710
|
-
|
|
171711
|
-
runGit(["add", "-f", "--", ...files.slice(index, index + 200)], {
|
|
171712
|
-
cwd: root,
|
|
171713
|
-
env: env3
|
|
171714
|
-
});
|
|
171715
|
-
}
|
|
171753
|
+
stageFiles(files, root, env3);
|
|
171716
171754
|
return runGit(["write-tree"], { cwd: root, env: env3 });
|
|
171717
171755
|
} finally {
|
|
171718
171756
|
rmSync5(temporaryDirectory, { force: true, recursive: true });
|
|
@@ -171733,16 +171771,56 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171733
171771
|
const path = resolve11(cwd, proofLocation);
|
|
171734
171772
|
const temporary = `${path}.${process.pid}.tmp`;
|
|
171735
171773
|
const proof = createLintProof(command, { cwd, proofLocation });
|
|
171774
|
+
if (options.signingKeyLocation) {
|
|
171775
|
+
const privateKey = readEd25519PrivateKey(cwd, options.signingKeyLocation);
|
|
171776
|
+
const publicKey = createPublicKey(privateKey);
|
|
171777
|
+
proof.attestation = {
|
|
171778
|
+
algorithm: "ed25519",
|
|
171779
|
+
keyId: publicKeyId(publicKey),
|
|
171780
|
+
signature: sign(null, attestationPayload(proof), privateKey).toString("base64")
|
|
171781
|
+
};
|
|
171782
|
+
}
|
|
171736
171783
|
mkdirSync8(dirname5(path), { recursive: true });
|
|
171737
171784
|
writeFileSync7(temporary, `${JSON.stringify(proof, null, 2)}
|
|
171738
171785
|
`);
|
|
171739
171786
|
renameSync2(temporary, path);
|
|
171740
171787
|
return proof;
|
|
171788
|
+
}, isRecord3 = (value) => value !== null && typeof value === "object", isLintProofAttestation = (value) => {
|
|
171789
|
+
if (!isRecord3(value))
|
|
171790
|
+
return false;
|
|
171791
|
+
return Reflect.get(value, "algorithm") === "ed25519" && typeof Reflect.get(value, "keyId") === "string" && typeof Reflect.get(value, "signature") === "string";
|
|
171741
171792
|
}, isLintProof = (value) => {
|
|
171742
171793
|
if (value === null || typeof value !== "object")
|
|
171743
171794
|
return false;
|
|
171744
|
-
const
|
|
171745
|
-
|
|
171795
|
+
const command = Reflect.get(value, "command");
|
|
171796
|
+
const attestation = Reflect.get(value, "attestation");
|
|
171797
|
+
return Reflect.get(value, "contractVersion") === PROOF_CONTRACT_VERSION && Array.isArray(command) && command.every((part) => typeof part === "string") && typeof Reflect.get(value, "createdAt") === "string" && typeof Reflect.get(value, "lintFingerprint") === "string" && typeof Reflect.get(value, "sourceTree") === "string" && (attestation === undefined || isLintProofAttestation(attestation));
|
|
171798
|
+
}, verifyAttestation = (proof, cwd, trustedKeyLocation) => {
|
|
171799
|
+
if (!proof.attestation)
|
|
171800
|
+
return {
|
|
171801
|
+
reason: "lint proof is not signed",
|
|
171802
|
+
valid: false
|
|
171803
|
+
};
|
|
171804
|
+
let trustedKey;
|
|
171805
|
+
try {
|
|
171806
|
+
trustedKey = readEd25519PublicKey(cwd, trustedKeyLocation);
|
|
171807
|
+
} catch (error) {
|
|
171808
|
+
return {
|
|
171809
|
+
reason: error instanceof Error ? error.message : "trusted lint proof key is invalid",
|
|
171810
|
+
valid: false
|
|
171811
|
+
};
|
|
171812
|
+
}
|
|
171813
|
+
if (proof.attestation.keyId !== publicKeyId(trustedKey))
|
|
171814
|
+
return {
|
|
171815
|
+
reason: "lint proof was signed by an untrusted key",
|
|
171816
|
+
valid: false
|
|
171817
|
+
};
|
|
171818
|
+
if (!verify(null, attestationPayload(proof), trustedKey, Buffer.from(proof.attestation.signature, "base64")))
|
|
171819
|
+
return {
|
|
171820
|
+
reason: "lint proof signature is invalid",
|
|
171821
|
+
valid: false
|
|
171822
|
+
};
|
|
171823
|
+
return { valid: true };
|
|
171746
171824
|
}, verifyLintProof = (command, options = {}) => {
|
|
171747
171825
|
const cwd = options.cwd ?? process.cwd();
|
|
171748
171826
|
const proofLocation = options.proofLocation ?? DEFAULT_PROOF_LOCATION;
|
|
@@ -171772,20 +171850,49 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171772
171850
|
reason: "source tree changed since lint passed",
|
|
171773
171851
|
valid: false
|
|
171774
171852
|
};
|
|
171853
|
+
if (options.trustedKeyLocation) {
|
|
171854
|
+
const result = verifyAttestation(proof, cwd, options.trustedKeyLocation);
|
|
171855
|
+
if (!result.valid)
|
|
171856
|
+
return result;
|
|
171857
|
+
}
|
|
171775
171858
|
return { proof, valid: true };
|
|
171776
171859
|
}, parseArgs = (args) => {
|
|
171777
171860
|
const separator = args.indexOf("--");
|
|
171778
|
-
const controlArgs = separator ===
|
|
171779
|
-
const command = separator ===
|
|
171861
|
+
const controlArgs = separator === FLAG_NOT_FOUND ? args : args.slice(0, separator);
|
|
171862
|
+
const command = separator === FLAG_NOT_FOUND ? [] : args.slice(separator + 1);
|
|
171780
171863
|
const proofFlag = controlArgs.indexOf("--proof");
|
|
171781
|
-
const proofLocation = proofFlag ===
|
|
171864
|
+
const proofLocation = proofFlag === FLAG_NOT_FOUND ? DEFAULT_PROOF_LOCATION : controlArgs[proofFlag + 1];
|
|
171865
|
+
const signingKeyFlag = controlArgs.indexOf("--signing-key");
|
|
171866
|
+
const signingKeyLocation = signingKeyFlag === FLAG_NOT_FOUND ? undefined : controlArgs[signingKeyFlag + 1];
|
|
171867
|
+
const trustedKeyFlag = controlArgs.indexOf("--trusted-key");
|
|
171868
|
+
const trustedKeyLocation = trustedKeyFlag === FLAG_NOT_FOUND ? undefined : controlArgs[trustedKeyFlag + 1];
|
|
171782
171869
|
if (!proofLocation)
|
|
171783
171870
|
throw new Error("--proof requires a path");
|
|
171784
|
-
|
|
171871
|
+
if (signingKeyFlag !== FLAG_NOT_FOUND && !signingKeyLocation)
|
|
171872
|
+
throw new Error("--signing-key requires a path");
|
|
171873
|
+
if (trustedKeyFlag !== FLAG_NOT_FOUND && !trustedKeyLocation)
|
|
171874
|
+
throw new Error("--trusted-key requires a path");
|
|
171875
|
+
return {
|
|
171876
|
+
command,
|
|
171877
|
+
proofLocation,
|
|
171878
|
+
signingKeyLocation,
|
|
171879
|
+
trustedKeyLocation
|
|
171880
|
+
};
|
|
171881
|
+
}, runVerification = (parsed) => {
|
|
171882
|
+
const result = verifyLintProof(parsed.command, {
|
|
171883
|
+
proofLocation: parsed.proofLocation,
|
|
171884
|
+
trustedKeyLocation: parsed.trustedKeyLocation
|
|
171885
|
+
});
|
|
171886
|
+
if (!result.valid) {
|
|
171887
|
+
console.error(`\x1B[31m\u2717\x1B[0m ${result.reason}`);
|
|
171888
|
+
return 1;
|
|
171889
|
+
}
|
|
171890
|
+
console.log(`\x1B[32m\u2713\x1B[0m Lint proof matches the source tree, command, and lint toolchain${parsed.trustedKeyLocation ? ", with a trusted signature" : ""}`);
|
|
171891
|
+
return 0;
|
|
171785
171892
|
}, runLintProof = async (args) => {
|
|
171786
171893
|
const [operation] = args;
|
|
171787
171894
|
if (operation !== "run" && operation !== "verify") {
|
|
171788
|
-
console.error("Usage: absolute lint-proof <run|verify> [--proof path] -- <lint command>");
|
|
171895
|
+
console.error("Usage: absolute lint-proof <run|verify> [--proof path] [--signing-key path | --trusted-key path] -- <lint command>");
|
|
171789
171896
|
return 2;
|
|
171790
171897
|
}
|
|
171791
171898
|
let parsed;
|
|
@@ -171799,17 +171906,16 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171799
171906
|
console.error("A lint command is required after --");
|
|
171800
171907
|
return 2;
|
|
171801
171908
|
}
|
|
171802
|
-
if (operation === "
|
|
171803
|
-
|
|
171804
|
-
|
|
171805
|
-
|
|
171806
|
-
|
|
171807
|
-
|
|
171808
|
-
|
|
171809
|
-
}
|
|
171810
|
-
console.log(`\x1B[32m\u2713\x1B[0m Lint proof matches the source tree, command, and lint toolchain`);
|
|
171811
|
-
return 0;
|
|
171909
|
+
if (operation === "run" && parsed.trustedKeyLocation) {
|
|
171910
|
+
console.error("--trusted-key is only valid with lint-proof verify");
|
|
171911
|
+
return 2;
|
|
171912
|
+
}
|
|
171913
|
+
if (operation === "verify" && parsed.signingKeyLocation) {
|
|
171914
|
+
console.error("--signing-key is only valid with lint-proof run");
|
|
171915
|
+
return 2;
|
|
171812
171916
|
}
|
|
171917
|
+
if (operation === "verify")
|
|
171918
|
+
return runVerification(parsed);
|
|
171813
171919
|
const proc = Bun.spawn(parsed.command, {
|
|
171814
171920
|
stderr: "inherit",
|
|
171815
171921
|
stdout: "inherit"
|
|
@@ -171819,8 +171925,11 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171819
171925
|
console.error("\x1B[31m\u2717\x1B[0m Lint failed; proof was not updated");
|
|
171820
171926
|
return exitCode;
|
|
171821
171927
|
}
|
|
171822
|
-
writeLintProof(parsed.command, {
|
|
171823
|
-
|
|
171928
|
+
writeLintProof(parsed.command, {
|
|
171929
|
+
proofLocation: parsed.proofLocation,
|
|
171930
|
+
signingKeyLocation: parsed.signingKeyLocation
|
|
171931
|
+
});
|
|
171932
|
+
console.log(`\x1B[32m\u2713\x1B[0m Wrote exact-source lint proof${parsed.signingKeyLocation ? " with an Ed25519 attestation" : ""}: ${parsed.proofLocation}`);
|
|
171824
171933
|
return 0;
|
|
171825
171934
|
};
|
|
171826
171935
|
var init_lintProof = __esm(() => {
|
|
@@ -173069,7 +173178,7 @@ var init_mem = __esm(() => {
|
|
|
173069
173178
|
});
|
|
173070
173179
|
|
|
173071
173180
|
// src/cli/config/guards.ts
|
|
173072
|
-
var
|
|
173181
|
+
var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
173073
173182
|
|
|
173074
173183
|
// src/cli/config/schema/fromType.ts
|
|
173075
173184
|
import {
|
|
@@ -173131,7 +173240,7 @@ var import_typescript3, VIRTUAL_NAME = "__absolute_type_introspect__.ts", MAX_DE
|
|
|
173131
173240
|
}, readDiskCache = (cwd, typeName, signature, specifier) => {
|
|
173132
173241
|
try {
|
|
173133
173242
|
const cached = JSON.parse(readFileSync17(cacheFile(cwd, typeName, specifier), "utf-8"));
|
|
173134
|
-
if (
|
|
173243
|
+
if (isRecord4(cached) && cached.signature === signature && Array.isArray(cached.fields)) {
|
|
173135
173244
|
return cached.fields;
|
|
173136
173245
|
}
|
|
173137
173246
|
} catch {}
|
|
@@ -173539,11 +173648,11 @@ var init_frameworks = __esm(() => {
|
|
|
173539
173648
|
|
|
173540
173649
|
// src/cli/generate/context.ts
|
|
173541
173650
|
import { dirname as dirname6, isAbsolute, join as join14, relative as relative4, resolve as resolve14 } from "path";
|
|
173542
|
-
var asString = (value) => typeof value === "string" ? value : undefined,
|
|
173651
|
+
var asString = (value) => typeof value === "string" ? value : undefined, isRecord5 = (value) => typeof value === "object" && value !== null, resolveDir = (cwd, value) => isAbsolute(value) ? value : resolve14(cwd, value), resolveStylesDir = (cwd, config) => {
|
|
173543
173652
|
const styles = config.stylesConfig;
|
|
173544
173653
|
if (typeof styles === "string")
|
|
173545
173654
|
return resolveDir(cwd, styles);
|
|
173546
|
-
if (
|
|
173655
|
+
if (isRecord5(styles)) {
|
|
173547
173656
|
const indexes = asString(styles.indexes);
|
|
173548
173657
|
if (indexes)
|
|
173549
173658
|
return resolveDir(cwd, indexes);
|
|
@@ -173554,7 +173663,7 @@ var asString = (value) => typeof value === "string" ? value : undefined, isRecor
|
|
|
173554
173663
|
return dir ? dirname6(dir) : resolve14(project.cwd, "src/frontend");
|
|
173555
173664
|
}, resolveProject = async (cwd, configOverride) => {
|
|
173556
173665
|
const loaded = await loadConfig(configOverride);
|
|
173557
|
-
const config =
|
|
173666
|
+
const config = isRecord5(loaded) ? loaded : {};
|
|
173558
173667
|
const frameworkDirs = {};
|
|
173559
173668
|
for (const key of FRAMEWORK_KEYS2) {
|
|
173560
173669
|
const dir = asString(config[frameworks2[key].configDirKey]);
|
|
@@ -174536,7 +174645,7 @@ ${value.map((item) => `${pad}${serializeValue(item, level + 1, indent)}`).join(`
|
|
|
174536
174645
|
`)}
|
|
174537
174646
|
${indent.repeat(level)}]`;
|
|
174538
174647
|
}
|
|
174539
|
-
if (
|
|
174648
|
+
if (isRecord4(value)) {
|
|
174540
174649
|
const keys = Object.keys(value);
|
|
174541
174650
|
if (keys.length === 0)
|
|
174542
174651
|
return "{}";
|
|
@@ -174749,18 +174858,18 @@ var init_catalog = __esm(() => {
|
|
|
174749
174858
|
// src/cli/integrations/addPlugin.ts
|
|
174750
174859
|
import { existsSync as existsSync23, readFileSync as readFileSync23 } from "fs";
|
|
174751
174860
|
import { join as join20 } from "path";
|
|
174752
|
-
var
|
|
174861
|
+
var isRecord6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readPackageJson = (cwd) => {
|
|
174753
174862
|
const path = join20(cwd, "package.json");
|
|
174754
174863
|
if (!existsSync23(path))
|
|
174755
174864
|
return null;
|
|
174756
174865
|
try {
|
|
174757
174866
|
const parsed = JSON.parse(readFileSync23(path, "utf-8"));
|
|
174758
|
-
return
|
|
174867
|
+
return isRecord6(parsed) ? parsed : null;
|
|
174759
174868
|
} catch {
|
|
174760
174869
|
return null;
|
|
174761
174870
|
}
|
|
174762
174871
|
}, addGroupKeys = (group, names) => {
|
|
174763
|
-
if (!
|
|
174872
|
+
if (!isRecord6(group))
|
|
174764
174873
|
return;
|
|
174765
174874
|
for (const name of Object.keys(group))
|
|
174766
174875
|
names.add(name);
|
|
@@ -175352,12 +175461,12 @@ var init_resolveAuthSettings = __esm(() => {
|
|
|
175352
175461
|
// src/cli/config/auth/resolveAuthState.ts
|
|
175353
175462
|
import { existsSync as existsSync25, readdirSync as readdirSync6, readFileSync as readFileSync25 } from "fs";
|
|
175354
175463
|
import { join as join21, relative as relative7, resolve as resolve16 } from "path";
|
|
175355
|
-
var import_typescript10, AUTH_PACKAGE2 = "@absolutejs/auth", REPO_URL = "https://github.com/absolutejs/absolute-auth", NPM_URL = "https://www.npmjs.com/package/@absolutejs/auth", SKIP_DIRS, MAX_FILES = 4000, SETUP_EXPORTS,
|
|
175464
|
+
var import_typescript10, AUTH_PACKAGE2 = "@absolutejs/auth", REPO_URL = "https://github.com/absolutejs/absolute-auth", NPM_URL = "https://www.npmjs.com/package/@absolutejs/auth", SKIP_DIRS, MAX_FILES = 4000, SETUP_EXPORTS, isRecord7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
|
|
175356
175465
|
if (!existsSync25(path))
|
|
175357
175466
|
return null;
|
|
175358
175467
|
try {
|
|
175359
175468
|
const parsed = JSON.parse(readFileSync25(path, "utf-8"));
|
|
175360
|
-
return
|
|
175469
|
+
return isRecord7(parsed) ? parsed : null;
|
|
175361
175470
|
} catch {
|
|
175362
175471
|
return null;
|
|
175363
175472
|
}
|
|
@@ -175370,7 +175479,7 @@ var import_typescript10, AUTH_PACKAGE2 = "@absolutejs/auth", REPO_URL = "https:/
|
|
|
175370
175479
|
return null;
|
|
175371
175480
|
for (const field of ["dependencies", "devDependencies"]) {
|
|
175372
175481
|
const group = pkg[field];
|
|
175373
|
-
if (!
|
|
175482
|
+
if (!isRecord7(group))
|
|
175374
175483
|
continue;
|
|
175375
175484
|
const version2 = group[AUTH_PACKAGE2];
|
|
175376
175485
|
if (typeof version2 === "string")
|
|
@@ -176655,7 +176764,7 @@ var init_logs = __esm(() => {
|
|
|
176655
176764
|
import {
|
|
176656
176765
|
existsSync as existsSync33,
|
|
176657
176766
|
readFileSync as readFileSync31,
|
|
176658
|
-
realpathSync,
|
|
176767
|
+
realpathSync as realpathSync2,
|
|
176659
176768
|
rmSync as rmSync6,
|
|
176660
176769
|
writeFileSync as writeFileSync19
|
|
176661
176770
|
} from "fs";
|
|
@@ -176664,13 +176773,13 @@ import { dirname as dirname14, join as join28, resolve as resolve19, sep } from
|
|
|
176664
176773
|
var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
176665
176774
|
try {
|
|
176666
176775
|
const parsed = JSON.parse(readFileSync31(path, "utf-8"));
|
|
176667
|
-
return
|
|
176776
|
+
return isRecord4(parsed) ? parsed : null;
|
|
176668
176777
|
} catch {
|
|
176669
176778
|
return null;
|
|
176670
176779
|
}
|
|
176671
176780
|
}, dependencyRecord = (manifest, field) => {
|
|
176672
176781
|
const value = Reflect.get(manifest, field);
|
|
176673
|
-
return
|
|
176782
|
+
return isRecord4(value) ? value : {};
|
|
176674
176783
|
}, dependencyNames = (manifest) => [
|
|
176675
176784
|
...new Set(DEPENDENCY_FIELDS.flatMap((field) => Object.keys(dependencyRecord(manifest, field))))
|
|
176676
176785
|
], declaresPackage = (manifest, name) => DEPENDENCY_FIELDS.some((field) => Object.hasOwn(dependencyRecord(manifest, field), name)), manifestName = (manifest, fallback) => {
|
|
@@ -176726,7 +176835,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176726
176835
|
directory = parent;
|
|
176727
176836
|
}
|
|
176728
176837
|
}, appendConsumer = (consumers, consumerPaths, path, manifest) => {
|
|
176729
|
-
const physicalPath =
|
|
176838
|
+
const physicalPath = realpathSync2(path);
|
|
176730
176839
|
if (!manifest || consumerPaths.has(physicalPath))
|
|
176731
176840
|
return;
|
|
176732
176841
|
consumerPaths.add(physicalPath);
|
|
@@ -176746,7 +176855,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176746
176855
|
identity: {
|
|
176747
176856
|
consumer: consumerName,
|
|
176748
176857
|
packageName: target,
|
|
176749
|
-
packagePath:
|
|
176858
|
+
packagePath: realpathSync2(path),
|
|
176750
176859
|
version: manifestVersion(manifest)
|
|
176751
176860
|
}
|
|
176752
176861
|
};
|
|
@@ -176765,7 +176874,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176765
176874
|
const consumers = [
|
|
176766
176875
|
{ manifest: rootManifest, path: rootManifestPath }
|
|
176767
176876
|
];
|
|
176768
|
-
const consumerPaths = new Set([
|
|
176877
|
+
const consumerPaths = new Set([realpathSync2(rootManifestPath)]);
|
|
176769
176878
|
const projectManifestPath = findProjectManifest(cwd, installRoot);
|
|
176770
176879
|
appendConsumer(consumers, consumerPaths, projectManifestPath, readManifest(projectManifestPath));
|
|
176771
176880
|
const projectConsumers = [...consumers];
|
|
@@ -176801,7 +176910,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176801
176910
|
if (!manifest)
|
|
176802
176911
|
return [];
|
|
176803
176912
|
const existing = Reflect.get(manifest, "overrides");
|
|
176804
|
-
const overrides =
|
|
176913
|
+
const overrides = isRecord4(existing) ? existing : {};
|
|
176805
176914
|
const changes = [];
|
|
176806
176915
|
const rootName = manifestName(manifest, "<workspace>");
|
|
176807
176916
|
for (const duplicate of duplicates) {
|
|
@@ -176820,7 +176929,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176820
176929
|
}, removeDuplicateTypeGraphPackages = (report) => {
|
|
176821
176930
|
const manifest = readManifest(join28(report.installRoot, "package.json")) ?? {};
|
|
176822
176931
|
const rootName = manifestName(manifest, "<workspace>");
|
|
176823
|
-
const installPrefix = `${
|
|
176932
|
+
const installPrefix = `${realpathSync2(report.installRoot)}${sep}`;
|
|
176824
176933
|
const nodeModulesSegment = `${sep}node_modules${sep}`;
|
|
176825
176934
|
const removed = [];
|
|
176826
176935
|
const stalePaths = duplicateTypeGraphPackages(report).flatMap((duplicate) => {
|
|
@@ -177748,7 +177857,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177748
177857
|
if (!encoded)
|
|
177749
177858
|
return;
|
|
177750
177859
|
const map = JSON.parse(Buffer.from(encoded, "base64").toString("utf-8"));
|
|
177751
|
-
if (!
|
|
177860
|
+
if (!isRecord4(map))
|
|
177752
177861
|
return;
|
|
177753
177862
|
if (!Array.isArray(map.sources))
|
|
177754
177863
|
return;
|
|
@@ -177999,7 +178108,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177999
178108
|
}, pickExportEntry = (value) => {
|
|
178000
178109
|
if (typeof value === "string")
|
|
178001
178110
|
return value;
|
|
178002
|
-
if (!
|
|
178111
|
+
if (!isRecord4(value))
|
|
178003
178112
|
return;
|
|
178004
178113
|
for (const key of ["bun", "node", "import", "module", "default"]) {
|
|
178005
178114
|
const entry = pickExportEntry(value[key]);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
type LintProofAttestation = {
|
|
2
|
+
algorithm: 'ed25519';
|
|
3
|
+
keyId: string;
|
|
4
|
+
signature: string;
|
|
5
|
+
};
|
|
1
6
|
type LintProof = {
|
|
7
|
+
attestation?: LintProofAttestation;
|
|
2
8
|
command: string[];
|
|
3
9
|
contractVersion: number;
|
|
4
10
|
createdAt: string;
|
|
@@ -12,23 +18,24 @@ type ProofResult = {
|
|
|
12
18
|
reason: string;
|
|
13
19
|
valid: false;
|
|
14
20
|
};
|
|
21
|
+
type CreateLintProofOptions = {
|
|
22
|
+
cwd?: string;
|
|
23
|
+
proofLocation?: string;
|
|
24
|
+
};
|
|
25
|
+
type WriteLintProofOptions = CreateLintProofOptions & {
|
|
26
|
+
signingKeyLocation?: string;
|
|
27
|
+
};
|
|
28
|
+
type VerifyLintProofOptions = CreateLintProofOptions & {
|
|
29
|
+
trustedKeyLocation?: string;
|
|
30
|
+
};
|
|
15
31
|
/**
|
|
16
32
|
* Build a Git tree from the complete working copy without modifying the real
|
|
17
33
|
* index. Ignored files and the proof itself are excluded. Git performs its
|
|
18
34
|
* normal clean filters, so the digest is stable across checkout platforms.
|
|
19
35
|
*/
|
|
20
36
|
export declare const createLintSourceTree: (cwd?: string, proofLocation?: string) => string;
|
|
21
|
-
export declare const createLintProof: (command: string[], options?:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}) => LintProof;
|
|
25
|
-
export declare const writeLintProof: (command: string[], options?: {
|
|
26
|
-
cwd?: string;
|
|
27
|
-
proofLocation?: string;
|
|
28
|
-
}) => LintProof;
|
|
29
|
-
export declare const verifyLintProof: (command: string[], options?: {
|
|
30
|
-
cwd?: string;
|
|
31
|
-
proofLocation?: string;
|
|
32
|
-
}) => ProofResult;
|
|
37
|
+
export declare const createLintProof: (command: string[], options?: CreateLintProofOptions) => LintProof;
|
|
38
|
+
export declare const writeLintProof: (command: string[], options?: WriteLintProofOptions) => LintProof;
|
|
39
|
+
export declare const verifyLintProof: (command: string[], options?: VerifyLintProofOptions) => ProofResult;
|
|
33
40
|
export declare const runLintProof: (args: string[]) => Promise<number>;
|
|
34
41
|
export {};
|