@jay-framework/compiler-jay-html 0.16.0 → 0.16.2

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -0
  2. 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.0",
3
+ "version": "0.16.2",
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.0",
38
- "@jay-framework/compiler-shared": "^0.16.0",
39
- "@jay-framework/component": "^0.16.0",
40
- "@jay-framework/logger": "^0.16.0",
41
- "@jay-framework/runtime": "^0.16.0",
42
- "@jay-framework/secure": "^0.16.0",
37
+ "@jay-framework/compiler-analyze-exported-types": "^0.16.2",
38
+ "@jay-framework/compiler-shared": "^0.16.2",
39
+ "@jay-framework/component": "^0.16.2",
40
+ "@jay-framework/logger": "^0.16.2",
41
+ "@jay-framework/runtime": "^0.16.2",
42
+ "@jay-framework/secure": "^0.16.2",
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.0",
55
- "@jay-framework/dev-environment": "^0.16.0",
54
+ "@jay-framework/4-react": "^0.16.2",
55
+ "@jay-framework/dev-environment": "^0.16.2",
56
56
  "@testing-library/jest-dom": "^6.2.0",
57
57
  "@types/js-beautify": "^1",
58
58
  "@types/node": "^20.11.5",