@jay-framework/compiler-jay-html 0.16.0 → 0.16.1
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 +19 -0
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -23115,11 +23115,26 @@ function collectImportedAliases(type2, aliases2) {
|
|
|
23115
23115
|
collectImportedAliases(type2.itemType, aliases2);
|
|
23116
23116
|
}
|
|
23117
23117
|
}
|
|
23118
|
+
function containsFileType(type2) {
|
|
23119
|
+
if (isAtomicType(type2))
|
|
23120
|
+
return type2.name === "file";
|
|
23121
|
+
if (isOptionalType(type2))
|
|
23122
|
+
return containsFileType(type2.innerType);
|
|
23123
|
+
if (isArrayType$1(type2))
|
|
23124
|
+
return containsFileType(type2.itemType);
|
|
23125
|
+
if (isRecordType(type2))
|
|
23126
|
+
return containsFileType(type2.itemType);
|
|
23127
|
+
if (isObjectType$1(type2))
|
|
23128
|
+
return Object.values(type2.props).some(containsFileType);
|
|
23129
|
+
return false;
|
|
23130
|
+
}
|
|
23118
23131
|
function renderType(type2, aliasToViewState, indent) {
|
|
23119
23132
|
if (isOptionalType(type2)) {
|
|
23120
23133
|
return renderType(type2.innerType, aliasToViewState, indent);
|
|
23121
23134
|
}
|
|
23122
23135
|
if (isAtomicType(type2)) {
|
|
23136
|
+
if (type2.name === "file")
|
|
23137
|
+
return "JayFile";
|
|
23123
23138
|
return type2.name;
|
|
23124
23139
|
}
|
|
23125
23140
|
if (isEnumType(type2)) {
|
|
@@ -23200,6 +23215,10 @@ function compileAction(actionWithValidations, contractResolver = defaultContract
|
|
|
23200
23215
|
`import { ${resolved.viewStateName} } from '${resolved.importPath}';`
|
|
23201
23216
|
);
|
|
23202
23217
|
}
|
|
23218
|
+
const usesFileType = containsFileType(action.inputType) || action.outputType && containsFileType(action.outputType);
|
|
23219
|
+
if (usesFileType) {
|
|
23220
|
+
importStatements.push(`import { JayFile } from '@jay-framework/fullstack-component';`);
|
|
23221
|
+
}
|
|
23203
23222
|
if (importStatements.length > 0) {
|
|
23204
23223
|
sections.push(importStatements.join("\n"));
|
|
23205
23224
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/compiler-jay-html",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"author": "",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@jay-framework/compiler-analyze-exported-types": "^0.16.
|
|
38
|
-
"@jay-framework/compiler-shared": "^0.16.
|
|
39
|
-
"@jay-framework/component": "^0.16.
|
|
40
|
-
"@jay-framework/logger": "^0.16.
|
|
41
|
-
"@jay-framework/runtime": "^0.16.
|
|
42
|
-
"@jay-framework/secure": "^0.16.
|
|
37
|
+
"@jay-framework/compiler-analyze-exported-types": "^0.16.1",
|
|
38
|
+
"@jay-framework/compiler-shared": "^0.16.1",
|
|
39
|
+
"@jay-framework/component": "^0.16.1",
|
|
40
|
+
"@jay-framework/logger": "^0.16.1",
|
|
41
|
+
"@jay-framework/runtime": "^0.16.1",
|
|
42
|
+
"@jay-framework/secure": "^0.16.1",
|
|
43
43
|
"@types/js-yaml": "^4.0.9",
|
|
44
44
|
"change-case": "^4.1.2",
|
|
45
45
|
"js-yaml": "^4.1.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@caiogondim/strip-margin": "^1.0.0",
|
|
54
|
-
"@jay-framework/4-react": "^0.16.
|
|
55
|
-
"@jay-framework/dev-environment": "^0.16.
|
|
54
|
+
"@jay-framework/4-react": "^0.16.1",
|
|
55
|
+
"@jay-framework/dev-environment": "^0.16.1",
|
|
56
56
|
"@testing-library/jest-dom": "^6.2.0",
|
|
57
57
|
"@types/js-beautify": "^1",
|
|
58
58
|
"@types/node": "^20.11.5",
|