@starbeam/debug
Advanced tools
Comparing version 0.8.10-unstable.aeb2ad9 to 0.8.10-unstable.c41f68b
{ | ||
"name": "@starbeam/debug", | ||
"version": "0.8.10-unstable.aeb2ad9", | ||
"version": "0.8.10-unstable.c41f68b", | ||
"type": "module", | ||
@@ -39,9 +39,9 @@ "main": "index.ts", | ||
"dependencies": { | ||
"@domtree/flavors": "0.9.4-unstable.aeb2ad9", | ||
"@starbeam/core-utils": "0.8.10-unstable.aeb2ad9", | ||
"@starbeam/interfaces": "0.8.10-unstable.aeb2ad9", | ||
"@starbeam/reactive": "0.8.10-unstable.aeb2ad9", | ||
"@starbeam/shared": "1.3.8-unstable.aeb2ad9", | ||
"@starbeam/tags": "0.0.1-unstable.aeb2ad9", | ||
"@starbeam/verify": "0.8.10-unstable.aeb2ad9", | ||
"@domtree/flavors": "0.9.4-unstable.c41f68b", | ||
"@starbeam/core-utils": "0.8.10-unstable.c41f68b", | ||
"@starbeam/interfaces": "0.8.10-unstable.c41f68b", | ||
"@starbeam/reactive": "0.8.10-unstable.c41f68b", | ||
"@starbeam/shared": "1.3.8-unstable.c41f68b", | ||
"@starbeam/tags": "0.0.1-unstable.c41f68b", | ||
"@starbeam/verify": "0.8.10-unstable.c41f68b", | ||
"buffer": "^6.0.3", | ||
@@ -48,0 +48,0 @@ "stacktracey": "^2.1.8" |
@@ -36,3 +36,2 @@ import { isPresentArray } from "@starbeam/core-utils"; | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
while (true) { | ||
@@ -155,3 +154,3 @@ const next = getBase(parent); | ||
export const getUserFacing = (<D extends DescriptionDetails | undefined>( | ||
description: D | ||
description: D, | ||
): D => { | ||
@@ -175,3 +174,3 @@ if (description?.nesting?.type === "implementation") { | ||
expect(getIdString(["a", ["b", "c"], ["d", "e"]])).toEqual( | ||
"a->(b/c)->(d/e)" | ||
"a->(b/c)->(d/e)", | ||
); | ||
@@ -182,13 +181,13 @@ expect( | ||
["c", "d"], | ||
]) | ||
]), | ||
).toEqual("(a/b)->(c/d)"); | ||
expect(getIdString(["a", ["b", "c"], ["d", "e"], "f"])).toEqual( | ||
"a->(b/c)->(d/e)->f" | ||
"a->(b/c)->(d/e)->f", | ||
); | ||
expect(getIdString(["a", ["b", "c"], ["d", "e"], ["f", "g"]])).toEqual( | ||
"a->(b/c)->(d/e)->(f/g)" | ||
"a->(b/c)->(d/e)->(f/g)", | ||
); | ||
// multiple levels of nesting | ||
expect(getIdString(["a", ["b", ["c", "d"], "e"], "f"])).toEqual( | ||
"a->(b->(c/d)->e)->f" | ||
"a->(b->(c/d)->e)->f", | ||
); | ||
@@ -225,3 +224,3 @@ }); | ||
expect(describeFlat({ type: "specified", value: "mycell" })).toEqual( | ||
"mycell" | ||
"mycell", | ||
); | ||
@@ -234,3 +233,3 @@ const id = getID(); | ||
id, | ||
}) | ||
}), | ||
).toEqual(`{anonymous cell:${id}}`); | ||
@@ -241,3 +240,3 @@ }); | ||
expect(describeFullName({ type: "specified", value: "mycell" })).toEqual( | ||
"mycell" | ||
"mycell", | ||
); | ||
@@ -250,3 +249,3 @@ const id = getID(); | ||
id, | ||
}) | ||
}), | ||
).toEqual(`{anonymous cell:${id}}`); | ||
@@ -279,3 +278,3 @@ | ||
expect(describeFullName(getFullName(child))).toEqual( | ||
"mycell->{impl: initialized?}" | ||
"mycell->{impl: initialized?}", | ||
); | ||
@@ -286,3 +285,3 @@ expect( | ||
{ type: "implementation", value: { name: "initialized?", reason: "" } }, | ||
]) | ||
]), | ||
).toEqual("mycell->{impl: initialized?}"); | ||
@@ -302,6 +301,6 @@ | ||
expect(describeFullName([anonymous, { type: "index", value: 2 }])).toEqual( | ||
"{anonymous cell:1}[2]" | ||
"{anonymous cell:1}[2]", | ||
); | ||
expect(describeFullName([specified, { type: "index", value: 2 }])).toEqual( | ||
"mycell[2]" | ||
"mycell[2]", | ||
); | ||
@@ -313,3 +312,3 @@ | ||
{ type: "key", value: { name: "foo", key: {} } }, | ||
]) | ||
]), | ||
).toEqual("{anonymous cell:1}.get(foo)"); | ||
@@ -321,11 +320,11 @@ | ||
{ type: "key", value: { name: "foo", key: {} } }, | ||
]) | ||
]), | ||
).toEqual("mycell.get(foo)"); | ||
expect( | ||
describeFullName([anonymous, { type: "property", value: "foo" }]) | ||
describeFullName([anonymous, { type: "property", value: "foo" }]), | ||
).toEqual("{anonymous cell:1}.foo"); | ||
expect( | ||
describeFullName([specified, { type: "property", value: "foo" }]) | ||
describeFullName([specified, { type: "property", value: "foo" }]), | ||
).toEqual("mycell.foo"); | ||
@@ -332,0 +331,0 @@ }); |
@@ -6,2 +6,3 @@ import { isPresent } from "@starbeam/core-utils"; | ||
import { LOGGER } from "./logger.js"; | ||
import { Tree } from "./tree.js"; | ||
@@ -13,3 +14,3 @@ | ||
implementation = false, | ||
}: { implementation?: boolean; source?: boolean; id?: boolean } = {} | ||
}: { implementation?: boolean; source?: boolean; id?: boolean } = {}, | ||
): string => { | ||
@@ -19,4 +20,4 @@ const dependencies = getDependencies(tag); | ||
dependencies.map((dependency) => | ||
getDesc(dependency.description, implementation) | ||
) | ||
getDesc(dependency.description, implementation), | ||
), | ||
); | ||
@@ -41,3 +42,3 @@ | ||
id?: boolean; | ||
} = {} | ||
} = {}, | ||
): void => { | ||
@@ -47,14 +48,16 @@ const debug = debugReactive(tag, options); | ||
if (options.label) { | ||
console.group(options.label); | ||
LOGGER.group(options.label); | ||
} | ||
console.group( | ||
describe(getTag(tag).description, { id: options.id }), | ||
`(updated at ${lastUpdated(tag).at})` | ||
); | ||
console.info(debug); | ||
console.groupEnd(); | ||
{ | ||
LOGGER.group( | ||
describe(getTag(tag).description, { id: options.id }), | ||
`(updated at ${lastUpdated(tag).at})`, | ||
); | ||
LOGGER.info(debug); | ||
LOGGER.groupEnd(); | ||
} | ||
if (options.label) { | ||
console.groupEnd(); | ||
LOGGER.groupEnd(); | ||
} | ||
@@ -65,3 +68,3 @@ }; | ||
description: Description | undefined, | ||
options?: { id: boolean | undefined } | ||
options?: { id: boolean | undefined }, | ||
): string { | ||
@@ -75,5 +78,5 @@ return description && DEBUG | ||
description: Description | undefined, | ||
showImplementation: boolean | ||
showImplementation: boolean, | ||
): Description | undefined { | ||
return showImplementation ? description : DEBUG?.getUserFacing(description); | ||
} |
@@ -7,3 +7,3 @@ { | ||
"starbeam": { | ||
"source": "ts", | ||
"source": "tsx", | ||
"type": "tests" | ||
@@ -10,0 +10,0 @@ }, |
69381
31
1496
+ Added@starbeam/core-utils@0.8.10-unstable.c41f68b(transitive)
+ Added@starbeam/interfaces@0.8.10-unstable.c41f68b(transitive)
+ Added@starbeam/reactive@0.8.10-unstable.c41f68b(transitive)
+ Added@starbeam/shared@1.3.8-unstable.c41f68b(transitive)
+ Added@starbeam/tags@0.0.1-unstable.c41f68b(transitive)
+ Added@starbeam/verify@0.8.10-unstable.c41f68b(transitive)
- Removed@starbeam/core-utils@0.8.10-unstable.aeb2ad9(transitive)
- Removed@starbeam/interfaces@0.8.10-unstable.aeb2ad9(transitive)
- Removed@starbeam/reactive@0.8.10-unstable.aeb2ad9(transitive)
- Removed@starbeam/shared@1.3.8-unstable.aeb2ad9(transitive)
- Removed@starbeam/tags@0.0.1-unstable.aeb2ad9(transitive)
- Removed@starbeam/verify@0.8.10-unstable.aeb2ad9(transitive)