@holo-js/adapter-shared 0.3.14 → 0.3.16
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/build.mjs
CHANGED
|
@@ -99,23 +99,23 @@ function compileShape(node, fieldName, runtime, path = "fields") {
|
|
|
99
99
|
return { fields: `Object.freeze({${fields.join(",")}})`, code: `${runtime}.objectAsync({${schemas.join(",")}})` };
|
|
100
100
|
}
|
|
101
101
|
function compileBrowserValidation(source, fileName = "schema.tsx") {
|
|
102
|
-
if (!source.includes("@holo-js/
|
|
102
|
+
if (!source.includes("@holo-js/validation")) return void 0;
|
|
103
103
|
const file = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true);
|
|
104
104
|
const diagnostics = ts.transpileModule(source, { fileName, reportDiagnostics: true, compilerOptions: { jsx: ts.JsxEmit.Preserve } }).diagnostics;
|
|
105
105
|
if (diagnostics?.some((diagnostic) => diagnostic.category === ts.DiagnosticCategory.Error)) return void 0;
|
|
106
106
|
let fieldName;
|
|
107
|
-
const schemaNames = /* @__PURE__ */ new
|
|
107
|
+
const schemaNames = /* @__PURE__ */ new Set();
|
|
108
108
|
for (const statement of file.statements) {
|
|
109
109
|
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) continue;
|
|
110
110
|
const packageName = statement.moduleSpecifier.text;
|
|
111
|
-
if (packageName !== "@holo-js/
|
|
111
|
+
if (packageName !== "@holo-js/validation") continue;
|
|
112
112
|
const bindings = statement.importClause?.namedBindings;
|
|
113
113
|
if (!bindings || !ts.isNamedImports(bindings) || statement.importClause?.isTypeOnly) continue;
|
|
114
114
|
for (const binding of bindings.elements) {
|
|
115
115
|
if (binding.isTypeOnly) continue;
|
|
116
116
|
const name = binding.propertyName?.text ?? binding.name.text;
|
|
117
117
|
if (name === "field") fieldName = binding.name.text;
|
|
118
|
-
if (name === "schema" || name === "defineSchema") schemaNames.
|
|
118
|
+
if (name === "schema" || name === "defineSchema") schemaNames.add(binding.name.text);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
if (!fieldName || schemaNames.size === 0) return void 0;
|
|
@@ -131,8 +131,7 @@ function compileBrowserValidation(source, fileName = "schema.tsx") {
|
|
|
131
131
|
if (!shape || !ts.isObjectLiteralExpression(shape)) continue;
|
|
132
132
|
const compiled = compileShape(shape, fieldName, runtime);
|
|
133
133
|
if (!compiled) continue;
|
|
134
|
-
const
|
|
135
|
-
const code = `(() => { const fields = ${compiled.fields}; const compiled = ${compiled.code}; return Object.freeze({kind: 'schema', ${mode} fields, '~standard': {version: 1, vendor: 'holo-js', validate: ${runtime}.createSchemaStandardValidate(fields, () => compiled), types: undefined}}) })()`;
|
|
134
|
+
const code = `(() => { const fields = ${compiled.fields}; const compiled = ${compiled.code}; return Object.freeze({kind: 'schema', fields, '~standard': {version: 1, vendor: 'holo-js', validate: ${runtime}.createSchemaStandardValidate(fields, () => compiled), types: undefined}}) })()`;
|
|
136
135
|
replacements.push({ start: call.getStart(file), end: call.end, code });
|
|
137
136
|
}
|
|
138
137
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createRealtimeClientDefinitionModule,
|
|
9
9
|
createRealtimeClientDefinitionTransform,
|
|
10
10
|
stripRealtimeServerHandlers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TJF55YJH.mjs";
|
|
12
12
|
export {
|
|
13
13
|
compileBrowserValidation,
|
|
14
14
|
createRealtimeClientDefinitionModule,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/adapter-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "Holo-JS Framework - shared framework adapter infrastructure",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,11 +33,14 @@
|
|
|
33
33
|
"test": "vitest --run"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@holo-js/kernel": "^0.3.
|
|
36
|
+
"@holo-js/kernel": "^0.3.16",
|
|
37
37
|
"typescript": "^5.7.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"tsup": "^8.3.5",
|
|
41
41
|
"vitest": "^4.1.5"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": "^22.12.0 || ^24.0.0 || ^26.0.0"
|
|
42
45
|
}
|
|
43
46
|
}
|