@absolutejs/absolute 0.19.0-beta.1117 → 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
|
-
import { 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) => {
|
|
171670
|
+
import { delimiter, dirname as dirname5, relative as relative2, resolve as resolve11 } from "path";
|
|
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("\\", "/");
|
|
@@ -171682,7 +171725,19 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171682
171725
|
}
|
|
171683
171726
|
const temporaryDirectory = mkdtempSync(resolve11(tmpdir2(), "absolute-lint-proof-"));
|
|
171684
171727
|
const temporaryIndex = resolve11(temporaryDirectory, "index");
|
|
171685
|
-
const
|
|
171728
|
+
const temporaryObjects = resolve11(temporaryDirectory, "objects");
|
|
171729
|
+
mkdirSync8(temporaryObjects, { recursive: true });
|
|
171730
|
+
const repositoryObjectsPath = runGit(["rev-parse", "--git-path", "objects"], { cwd: root });
|
|
171731
|
+
const repositoryObjects = resolve11(root, repositoryObjectsPath);
|
|
171732
|
+
const existingAlternates = process.env.GIT_ALTERNATE_OBJECT_DIRECTORIES?.trim();
|
|
171733
|
+
const env3 = {
|
|
171734
|
+
GIT_ALTERNATE_OBJECT_DIRECTORIES: [
|
|
171735
|
+
repositoryObjects,
|
|
171736
|
+
...existingAlternates ? [existingAlternates] : []
|
|
171737
|
+
].join(delimiter),
|
|
171738
|
+
GIT_INDEX_FILE: temporaryIndex,
|
|
171739
|
+
GIT_OBJECT_DIRECTORY: temporaryObjects
|
|
171740
|
+
};
|
|
171686
171741
|
try {
|
|
171687
171742
|
runGit(["read-tree", "--empty"], { cwd: root, env: env3 });
|
|
171688
171743
|
const files = runGit(["ls-files", "--cached", "--others", "--exclude-standard", "-z"], { cwd: root }).split("\x00").filter((path) => {
|
|
@@ -171695,12 +171750,7 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171695
171750
|
return false;
|
|
171696
171751
|
}
|
|
171697
171752
|
});
|
|
171698
|
-
|
|
171699
|
-
runGit(["add", "-f", "--", ...files.slice(index, index + 200)], {
|
|
171700
|
-
cwd: root,
|
|
171701
|
-
env: env3
|
|
171702
|
-
});
|
|
171703
|
-
}
|
|
171753
|
+
stageFiles(files, root, env3);
|
|
171704
171754
|
return runGit(["write-tree"], { cwd: root, env: env3 });
|
|
171705
171755
|
} finally {
|
|
171706
171756
|
rmSync5(temporaryDirectory, { force: true, recursive: true });
|
|
@@ -171721,16 +171771,56 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171721
171771
|
const path = resolve11(cwd, proofLocation);
|
|
171722
171772
|
const temporary = `${path}.${process.pid}.tmp`;
|
|
171723
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
|
+
}
|
|
171724
171783
|
mkdirSync8(dirname5(path), { recursive: true });
|
|
171725
171784
|
writeFileSync7(temporary, `${JSON.stringify(proof, null, 2)}
|
|
171726
171785
|
`);
|
|
171727
171786
|
renameSync2(temporary, path);
|
|
171728
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";
|
|
171729
171792
|
}, isLintProof = (value) => {
|
|
171730
171793
|
if (value === null || typeof value !== "object")
|
|
171731
171794
|
return false;
|
|
171732
|
-
const
|
|
171733
|
-
|
|
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 };
|
|
171734
171824
|
}, verifyLintProof = (command, options = {}) => {
|
|
171735
171825
|
const cwd = options.cwd ?? process.cwd();
|
|
171736
171826
|
const proofLocation = options.proofLocation ?? DEFAULT_PROOF_LOCATION;
|
|
@@ -171760,20 +171850,49 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171760
171850
|
reason: "source tree changed since lint passed",
|
|
171761
171851
|
valid: false
|
|
171762
171852
|
};
|
|
171853
|
+
if (options.trustedKeyLocation) {
|
|
171854
|
+
const result = verifyAttestation(proof, cwd, options.trustedKeyLocation);
|
|
171855
|
+
if (!result.valid)
|
|
171856
|
+
return result;
|
|
171857
|
+
}
|
|
171763
171858
|
return { proof, valid: true };
|
|
171764
171859
|
}, parseArgs = (args) => {
|
|
171765
171860
|
const separator = args.indexOf("--");
|
|
171766
|
-
const controlArgs = separator ===
|
|
171767
|
-
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);
|
|
171768
171863
|
const proofFlag = controlArgs.indexOf("--proof");
|
|
171769
|
-
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];
|
|
171770
171869
|
if (!proofLocation)
|
|
171771
171870
|
throw new Error("--proof requires a path");
|
|
171772
|
-
|
|
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;
|
|
171773
171892
|
}, runLintProof = async (args) => {
|
|
171774
171893
|
const [operation] = args;
|
|
171775
171894
|
if (operation !== "run" && operation !== "verify") {
|
|
171776
|
-
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>");
|
|
171777
171896
|
return 2;
|
|
171778
171897
|
}
|
|
171779
171898
|
let parsed;
|
|
@@ -171787,17 +171906,16 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171787
171906
|
console.error("A lint command is required after --");
|
|
171788
171907
|
return 2;
|
|
171789
171908
|
}
|
|
171790
|
-
if (operation === "
|
|
171791
|
-
|
|
171792
|
-
|
|
171793
|
-
|
|
171794
|
-
|
|
171795
|
-
|
|
171796
|
-
|
|
171797
|
-
}
|
|
171798
|
-
console.log(`\x1B[32m\u2713\x1B[0m Lint proof matches the source tree, command, and lint toolchain`);
|
|
171799
|
-
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;
|
|
171800
171916
|
}
|
|
171917
|
+
if (operation === "verify")
|
|
171918
|
+
return runVerification(parsed);
|
|
171801
171919
|
const proc = Bun.spawn(parsed.command, {
|
|
171802
171920
|
stderr: "inherit",
|
|
171803
171921
|
stdout: "inherit"
|
|
@@ -171807,8 +171925,11 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
|
|
|
171807
171925
|
console.error("\x1B[31m\u2717\x1B[0m Lint failed; proof was not updated");
|
|
171808
171926
|
return exitCode;
|
|
171809
171927
|
}
|
|
171810
|
-
writeLintProof(parsed.command, {
|
|
171811
|
-
|
|
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}`);
|
|
171812
171933
|
return 0;
|
|
171813
171934
|
};
|
|
171814
171935
|
var init_lintProof = __esm(() => {
|
|
@@ -173057,7 +173178,7 @@ var init_mem = __esm(() => {
|
|
|
173057
173178
|
});
|
|
173058
173179
|
|
|
173059
173180
|
// src/cli/config/guards.ts
|
|
173060
|
-
var
|
|
173181
|
+
var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
173061
173182
|
|
|
173062
173183
|
// src/cli/config/schema/fromType.ts
|
|
173063
173184
|
import {
|
|
@@ -173119,7 +173240,7 @@ var import_typescript3, VIRTUAL_NAME = "__absolute_type_introspect__.ts", MAX_DE
|
|
|
173119
173240
|
}, readDiskCache = (cwd, typeName, signature, specifier) => {
|
|
173120
173241
|
try {
|
|
173121
173242
|
const cached = JSON.parse(readFileSync17(cacheFile(cwd, typeName, specifier), "utf-8"));
|
|
173122
|
-
if (
|
|
173243
|
+
if (isRecord4(cached) && cached.signature === signature && Array.isArray(cached.fields)) {
|
|
173123
173244
|
return cached.fields;
|
|
173124
173245
|
}
|
|
173125
173246
|
} catch {}
|
|
@@ -173527,11 +173648,11 @@ var init_frameworks = __esm(() => {
|
|
|
173527
173648
|
|
|
173528
173649
|
// src/cli/generate/context.ts
|
|
173529
173650
|
import { dirname as dirname6, isAbsolute, join as join14, relative as relative4, resolve as resolve14 } from "path";
|
|
173530
|
-
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) => {
|
|
173531
173652
|
const styles = config.stylesConfig;
|
|
173532
173653
|
if (typeof styles === "string")
|
|
173533
173654
|
return resolveDir(cwd, styles);
|
|
173534
|
-
if (
|
|
173655
|
+
if (isRecord5(styles)) {
|
|
173535
173656
|
const indexes = asString(styles.indexes);
|
|
173536
173657
|
if (indexes)
|
|
173537
173658
|
return resolveDir(cwd, indexes);
|
|
@@ -173542,7 +173663,7 @@ var asString = (value) => typeof value === "string" ? value : undefined, isRecor
|
|
|
173542
173663
|
return dir ? dirname6(dir) : resolve14(project.cwd, "src/frontend");
|
|
173543
173664
|
}, resolveProject = async (cwd, configOverride) => {
|
|
173544
173665
|
const loaded = await loadConfig(configOverride);
|
|
173545
|
-
const config =
|
|
173666
|
+
const config = isRecord5(loaded) ? loaded : {};
|
|
173546
173667
|
const frameworkDirs = {};
|
|
173547
173668
|
for (const key of FRAMEWORK_KEYS2) {
|
|
173548
173669
|
const dir = asString(config[frameworks2[key].configDirKey]);
|
|
@@ -174524,7 +174645,7 @@ ${value.map((item) => `${pad}${serializeValue(item, level + 1, indent)}`).join(`
|
|
|
174524
174645
|
`)}
|
|
174525
174646
|
${indent.repeat(level)}]`;
|
|
174526
174647
|
}
|
|
174527
|
-
if (
|
|
174648
|
+
if (isRecord4(value)) {
|
|
174528
174649
|
const keys = Object.keys(value);
|
|
174529
174650
|
if (keys.length === 0)
|
|
174530
174651
|
return "{}";
|
|
@@ -174737,18 +174858,18 @@ var init_catalog = __esm(() => {
|
|
|
174737
174858
|
// src/cli/integrations/addPlugin.ts
|
|
174738
174859
|
import { existsSync as existsSync23, readFileSync as readFileSync23 } from "fs";
|
|
174739
174860
|
import { join as join20 } from "path";
|
|
174740
|
-
var
|
|
174861
|
+
var isRecord6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readPackageJson = (cwd) => {
|
|
174741
174862
|
const path = join20(cwd, "package.json");
|
|
174742
174863
|
if (!existsSync23(path))
|
|
174743
174864
|
return null;
|
|
174744
174865
|
try {
|
|
174745
174866
|
const parsed = JSON.parse(readFileSync23(path, "utf-8"));
|
|
174746
|
-
return
|
|
174867
|
+
return isRecord6(parsed) ? parsed : null;
|
|
174747
174868
|
} catch {
|
|
174748
174869
|
return null;
|
|
174749
174870
|
}
|
|
174750
174871
|
}, addGroupKeys = (group, names) => {
|
|
174751
|
-
if (!
|
|
174872
|
+
if (!isRecord6(group))
|
|
174752
174873
|
return;
|
|
174753
174874
|
for (const name of Object.keys(group))
|
|
174754
174875
|
names.add(name);
|
|
@@ -175340,12 +175461,12 @@ var init_resolveAuthSettings = __esm(() => {
|
|
|
175340
175461
|
// src/cli/config/auth/resolveAuthState.ts
|
|
175341
175462
|
import { existsSync as existsSync25, readdirSync as readdirSync6, readFileSync as readFileSync25 } from "fs";
|
|
175342
175463
|
import { join as join21, relative as relative7, resolve as resolve16 } from "path";
|
|
175343
|
-
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) => {
|
|
175344
175465
|
if (!existsSync25(path))
|
|
175345
175466
|
return null;
|
|
175346
175467
|
try {
|
|
175347
175468
|
const parsed = JSON.parse(readFileSync25(path, "utf-8"));
|
|
175348
|
-
return
|
|
175469
|
+
return isRecord7(parsed) ? parsed : null;
|
|
175349
175470
|
} catch {
|
|
175350
175471
|
return null;
|
|
175351
175472
|
}
|
|
@@ -175358,7 +175479,7 @@ var import_typescript10, AUTH_PACKAGE2 = "@absolutejs/auth", REPO_URL = "https:/
|
|
|
175358
175479
|
return null;
|
|
175359
175480
|
for (const field of ["dependencies", "devDependencies"]) {
|
|
175360
175481
|
const group = pkg[field];
|
|
175361
|
-
if (!
|
|
175482
|
+
if (!isRecord7(group))
|
|
175362
175483
|
continue;
|
|
175363
175484
|
const version2 = group[AUTH_PACKAGE2];
|
|
175364
175485
|
if (typeof version2 === "string")
|
|
@@ -176643,7 +176764,7 @@ var init_logs = __esm(() => {
|
|
|
176643
176764
|
import {
|
|
176644
176765
|
existsSync as existsSync33,
|
|
176645
176766
|
readFileSync as readFileSync31,
|
|
176646
|
-
realpathSync,
|
|
176767
|
+
realpathSync as realpathSync2,
|
|
176647
176768
|
rmSync as rmSync6,
|
|
176648
176769
|
writeFileSync as writeFileSync19
|
|
176649
176770
|
} from "fs";
|
|
@@ -176652,13 +176773,13 @@ import { dirname as dirname14, join as join28, resolve as resolve19, sep } from
|
|
|
176652
176773
|
var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
176653
176774
|
try {
|
|
176654
176775
|
const parsed = JSON.parse(readFileSync31(path, "utf-8"));
|
|
176655
|
-
return
|
|
176776
|
+
return isRecord4(parsed) ? parsed : null;
|
|
176656
176777
|
} catch {
|
|
176657
176778
|
return null;
|
|
176658
176779
|
}
|
|
176659
176780
|
}, dependencyRecord = (manifest, field) => {
|
|
176660
176781
|
const value = Reflect.get(manifest, field);
|
|
176661
|
-
return
|
|
176782
|
+
return isRecord4(value) ? value : {};
|
|
176662
176783
|
}, dependencyNames = (manifest) => [
|
|
176663
176784
|
...new Set(DEPENDENCY_FIELDS.flatMap((field) => Object.keys(dependencyRecord(manifest, field))))
|
|
176664
176785
|
], declaresPackage = (manifest, name) => DEPENDENCY_FIELDS.some((field) => Object.hasOwn(dependencyRecord(manifest, field), name)), manifestName = (manifest, fallback) => {
|
|
@@ -176714,7 +176835,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176714
176835
|
directory = parent;
|
|
176715
176836
|
}
|
|
176716
176837
|
}, appendConsumer = (consumers, consumerPaths, path, manifest) => {
|
|
176717
|
-
const physicalPath =
|
|
176838
|
+
const physicalPath = realpathSync2(path);
|
|
176718
176839
|
if (!manifest || consumerPaths.has(physicalPath))
|
|
176719
176840
|
return;
|
|
176720
176841
|
consumerPaths.add(physicalPath);
|
|
@@ -176734,7 +176855,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176734
176855
|
identity: {
|
|
176735
176856
|
consumer: consumerName,
|
|
176736
176857
|
packageName: target,
|
|
176737
|
-
packagePath:
|
|
176858
|
+
packagePath: realpathSync2(path),
|
|
176738
176859
|
version: manifestVersion(manifest)
|
|
176739
176860
|
}
|
|
176740
176861
|
};
|
|
@@ -176753,7 +176874,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176753
176874
|
const consumers = [
|
|
176754
176875
|
{ manifest: rootManifest, path: rootManifestPath }
|
|
176755
176876
|
];
|
|
176756
|
-
const consumerPaths = new Set([
|
|
176877
|
+
const consumerPaths = new Set([realpathSync2(rootManifestPath)]);
|
|
176757
176878
|
const projectManifestPath = findProjectManifest(cwd, installRoot);
|
|
176758
176879
|
appendConsumer(consumers, consumerPaths, projectManifestPath, readManifest(projectManifestPath));
|
|
176759
176880
|
const projectConsumers = [...consumers];
|
|
@@ -176789,7 +176910,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176789
176910
|
if (!manifest)
|
|
176790
176911
|
return [];
|
|
176791
176912
|
const existing = Reflect.get(manifest, "overrides");
|
|
176792
|
-
const overrides =
|
|
176913
|
+
const overrides = isRecord4(existing) ? existing : {};
|
|
176793
176914
|
const changes = [];
|
|
176794
176915
|
const rootName = manifestName(manifest, "<workspace>");
|
|
176795
176916
|
for (const duplicate of duplicates) {
|
|
@@ -176808,7 +176929,7 @@ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
|
|
|
176808
176929
|
}, removeDuplicateTypeGraphPackages = (report) => {
|
|
176809
176930
|
const manifest = readManifest(join28(report.installRoot, "package.json")) ?? {};
|
|
176810
176931
|
const rootName = manifestName(manifest, "<workspace>");
|
|
176811
|
-
const installPrefix = `${
|
|
176932
|
+
const installPrefix = `${realpathSync2(report.installRoot)}${sep}`;
|
|
176812
176933
|
const nodeModulesSegment = `${sep}node_modules${sep}`;
|
|
176813
176934
|
const removed = [];
|
|
176814
176935
|
const stalePaths = duplicateTypeGraphPackages(report).flatMap((duplicate) => {
|
|
@@ -177736,7 +177857,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177736
177857
|
if (!encoded)
|
|
177737
177858
|
return;
|
|
177738
177859
|
const map = JSON.parse(Buffer.from(encoded, "base64").toString("utf-8"));
|
|
177739
|
-
if (!
|
|
177860
|
+
if (!isRecord4(map))
|
|
177740
177861
|
return;
|
|
177741
177862
|
if (!Array.isArray(map.sources))
|
|
177742
177863
|
return;
|
|
@@ -177987,7 +178108,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177987
178108
|
}, pickExportEntry = (value) => {
|
|
177988
178109
|
if (typeof value === "string")
|
|
177989
178110
|
return value;
|
|
177990
|
-
if (!
|
|
178111
|
+
if (!isRecord4(value))
|
|
177991
178112
|
return;
|
|
177992
178113
|
for (const key of ["bun", "node", "import", "module", "default"]) {
|
|
177993
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 {};
|