@barefootjs/test 0.5.1 → 0.5.3
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/index.js +57 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -187862,6 +187862,24 @@ function getSourceLocation(node, sourceFile, filePath) {
|
|
|
187862
187862
|
}
|
|
187863
187863
|
};
|
|
187864
187864
|
}
|
|
187865
|
+
function membersToProperties(members, sourceFile) {
|
|
187866
|
+
return members.filter(import_typescript6.default.isPropertySignature).map((member) => ({
|
|
187867
|
+
name: propertyNameText(member.name, sourceFile),
|
|
187868
|
+
type: typeNodeToTypeInfo(member.type, sourceFile) ?? {
|
|
187869
|
+
kind: "unknown",
|
|
187870
|
+
raw: "unknown"
|
|
187871
|
+
},
|
|
187872
|
+
optional: !!member.questionToken,
|
|
187873
|
+
readonly: !!member.modifiers?.some((m) => m.kind === import_typescript6.default.SyntaxKind.ReadonlyKeyword)
|
|
187874
|
+
}));
|
|
187875
|
+
}
|
|
187876
|
+
function propertyNameText(name, sourceFile) {
|
|
187877
|
+
if (!name)
|
|
187878
|
+
return "";
|
|
187879
|
+
if (import_typescript6.default.isStringLiteral(name) || import_typescript6.default.isNumericLiteral(name))
|
|
187880
|
+
return name.text;
|
|
187881
|
+
return name.getText(sourceFile);
|
|
187882
|
+
}
|
|
187865
187883
|
function typeNodeToTypeInfo(typeNode, sourceFile) {
|
|
187866
187884
|
if (!typeNode)
|
|
187867
187885
|
return null;
|
|
@@ -187899,18 +187917,21 @@ function typeNodeToTypeInfo(typeNode, sourceFile) {
|
|
|
187899
187917
|
return {
|
|
187900
187918
|
kind: "object",
|
|
187901
187919
|
raw,
|
|
187902
|
-
properties: typeNode.members
|
|
187903
|
-
name: member.name?.getText(sourceFile) ?? "",
|
|
187904
|
-
type: typeNodeToTypeInfo(member.type, sourceFile) ?? {
|
|
187905
|
-
kind: "unknown",
|
|
187906
|
-
raw: "unknown"
|
|
187907
|
-
},
|
|
187908
|
-
optional: !!member.questionToken,
|
|
187909
|
-
readonly: !!member.modifiers?.some((m) => m.kind === import_typescript6.default.SyntaxKind.ReadonlyKeyword)
|
|
187910
|
-
}))
|
|
187920
|
+
properties: membersToProperties(typeNode.members, sourceFile)
|
|
187911
187921
|
};
|
|
187912
187922
|
}
|
|
187913
187923
|
if (import_typescript6.default.isTypeReferenceNode(typeNode)) {
|
|
187924
|
+
const refName = import_typescript6.default.isIdentifier(typeNode.typeName) ? typeNode.typeName.text : "";
|
|
187925
|
+
if ((refName === "Array" || refName === "ReadonlyArray") && typeNode.typeArguments?.length === 1) {
|
|
187926
|
+
return {
|
|
187927
|
+
kind: "array",
|
|
187928
|
+
raw,
|
|
187929
|
+
elementType: typeNodeToTypeInfo(typeNode.typeArguments[0], sourceFile) ?? {
|
|
187930
|
+
kind: "unknown",
|
|
187931
|
+
raw: "unknown"
|
|
187932
|
+
}
|
|
187933
|
+
};
|
|
187934
|
+
}
|
|
187914
187935
|
return {
|
|
187915
187936
|
kind: "interface",
|
|
187916
187937
|
raw
|
|
@@ -189052,14 +189073,17 @@ function collectInterfaceDefinition(node, ctx) {
|
|
|
189052
189073
|
kind: "interface",
|
|
189053
189074
|
name: node.name.text,
|
|
189054
189075
|
definition: node.getText(ctx.sourceFile),
|
|
189076
|
+
properties: membersToProperties(node.members, ctx.sourceFile),
|
|
189055
189077
|
loc: getSourceLocation(node, ctx.sourceFile, ctx.filePath)
|
|
189056
189078
|
});
|
|
189057
189079
|
}
|
|
189058
189080
|
function collectTypeAliasDefinition(node, ctx) {
|
|
189081
|
+
const properties = import_typescript7.default.isTypeLiteralNode(node.type) ? membersToProperties(node.type.members, ctx.sourceFile) : undefined;
|
|
189059
189082
|
ctx.typeDefinitions.push({
|
|
189060
189083
|
kind: "type",
|
|
189061
189084
|
name: node.name.text,
|
|
189062
189085
|
definition: node.getText(ctx.sourceFile),
|
|
189086
|
+
properties,
|
|
189063
189087
|
loc: getSourceLocation(node, ctx.sourceFile, ctx.filePath)
|
|
189064
189088
|
});
|
|
189065
189089
|
}
|
|
@@ -190435,7 +190459,24 @@ var UNSUPPORTED_METHODS = new Set([
|
|
|
190435
190459
|
"some",
|
|
190436
190460
|
"forEach",
|
|
190437
190461
|
"flatMap",
|
|
190438
|
-
"flat"
|
|
190462
|
+
"flat",
|
|
190463
|
+
"split",
|
|
190464
|
+
"startsWith",
|
|
190465
|
+
"endsWith",
|
|
190466
|
+
"replace",
|
|
190467
|
+
"replaceAll",
|
|
190468
|
+
"repeat",
|
|
190469
|
+
"padStart",
|
|
190470
|
+
"padEnd",
|
|
190471
|
+
"charAt",
|
|
190472
|
+
"charCodeAt",
|
|
190473
|
+
"codePointAt",
|
|
190474
|
+
"normalize",
|
|
190475
|
+
"substring",
|
|
190476
|
+
"substr",
|
|
190477
|
+
"match",
|
|
190478
|
+
"matchAll",
|
|
190479
|
+
"search"
|
|
190439
190480
|
]);
|
|
190440
190481
|
function parseExpression(expr) {
|
|
190441
190482
|
const trimmed = expr.trim();
|
|
@@ -191297,7 +191338,7 @@ function checkSupport(expr) {
|
|
|
191297
191338
|
return {
|
|
191298
191339
|
supported: false,
|
|
191299
191340
|
level: "L5_UNSUPPORTED",
|
|
191300
|
-
reason: `
|
|
191341
|
+
reason: `Method '${methodName}()' has no template lowering and requires client-side evaluation. Wrap the expression in /* @client */ to defer it to hydration, or pre-compute the value before rendering.`
|
|
191301
191342
|
};
|
|
191302
191343
|
}
|
|
191303
191344
|
}
|
|
@@ -194487,6 +194528,9 @@ function buildIfStatementChain(analyzer, ctx) {
|
|
|
194487
194528
|
return alternate;
|
|
194488
194529
|
}
|
|
194489
194530
|
|
|
194531
|
+
// ../jsx/src/ir-to-client-js/collect-elements.ts
|
|
194532
|
+
var EMPTY_RENDER_EXPRS = new Set(["null", "undefined", "false", "''", '""', "``"]);
|
|
194533
|
+
|
|
194490
194534
|
// ../jsx/src/ir-to-client-js/identifiers.ts
|
|
194491
194535
|
var KEYWORDS_AND_GLOBALS = new Set([
|
|
194492
194536
|
"true",
|
|
@@ -194821,6 +194865,8 @@ var CLIENT_PACKAGE_SOURCES = new Set([
|
|
|
194821
194865
|
"@barefootjs/client",
|
|
194822
194866
|
"@barefootjs/client/runtime"
|
|
194823
194867
|
]);
|
|
194868
|
+
// ../jsx/src/combine-client-js.ts
|
|
194869
|
+
var import_typescript18 = __toESM(require_typescript(), 1);
|
|
194824
194870
|
// ../jsx/src/debug.ts
|
|
194825
194871
|
function escapeForIdBoundary(name) {
|
|
194826
194872
|
return name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/test",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Test utilities for BarefootJS - IR-based component testing without a browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"directory": "packages/test"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@barefootjs/jsx": "0.5.
|
|
42
|
+
"@barefootjs/jsx": "0.5.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.0.0"
|