@meituan-nocode/vite-plugin-nocode-compiler 0.2.4-beta.13 → 0.2.4-beta.15

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.cjs CHANGED
@@ -47,16 +47,10 @@ function readJsonBody(req) {
47
47
  }
48
48
 
49
49
  // package.json
50
- var version = "0.2.4-beta.13";
50
+ var version = "0.2.4-beta.15";
51
51
 
52
52
  // src/index.ts
53
53
  var overrideMap = /* @__PURE__ */ new Map();
54
- function getSourceCode(filePath) {
55
- if (overrideMap.has(filePath)) {
56
- return overrideMap.get(filePath);
57
- }
58
- return (0, import_fs.readFileSync)(filePath, "utf-8");
59
- }
60
54
  function resolveFileToAbsPath(file, viteRoot) {
61
55
  if ((0, import_path.isAbsolute)(file)) {
62
56
  return (0, import_fs.existsSync)(file) ? (0, import_path.normalize)(file) : null;
@@ -84,7 +78,6 @@ function componentCompiler(options = {}) {
84
78
  ...options
85
79
  };
86
80
  if (options.enableReporting) {
87
- console.log("[vite compiler] init");
88
81
  (0, import_nocode_compiler_core.initReporter)({
89
82
  appName: options.reporterAppName || "nocode-compiler-plugin",
90
83
  enabled: true,
@@ -207,12 +200,13 @@ function componentCompiler(options = {}) {
207
200
  filePath,
208
201
  query
209
202
  });
210
- if (!useJSXCompiler && !useVueCompiler) {
211
- return code;
203
+ if (useJSXCompiler) {
204
+ return jsxCompiler.compile(code, filePath, pkgRegistry) || code;
205
+ }
206
+ if (useVueCompiler) {
207
+ return vueCompiler.compile(code, filePath, pkgRegistry) || code;
212
208
  }
213
- const sourceCode = getSourceCode(filePath);
214
- const result = useJSXCompiler ? jsxCompiler.compile(sourceCode, filePath, pkgRegistry) : vueCompiler.compile(sourceCode, filePath, pkgRegistry);
215
- return result != null ? result : code;
209
+ return code;
216
210
  }
217
211
  };
218
212
  }
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/index.ts
2
2
  import { normalize, dirname, isAbsolute, join } from "path";
3
- import { existsSync, readFileSync } from "fs";
3
+ import { existsSync } from "fs";
4
4
  import { JSXCompiler, VueCompiler, detectCompileScenario, PackageVersionRegistry, initReporter, getReporter } from "@meituan-nocode/nocode-compiler-core";
5
5
 
6
6
  // src/utils.ts
@@ -22,16 +22,10 @@ function readJsonBody(req) {
22
22
  }
23
23
 
24
24
  // package.json
25
- var version = "0.2.4-beta.13";
25
+ var version = "0.2.4-beta.15";
26
26
 
27
27
  // src/index.ts
28
28
  var overrideMap = /* @__PURE__ */ new Map();
29
- function getSourceCode(filePath) {
30
- if (overrideMap.has(filePath)) {
31
- return overrideMap.get(filePath);
32
- }
33
- return readFileSync(filePath, "utf-8");
34
- }
35
29
  function resolveFileToAbsPath(file, viteRoot) {
36
30
  if (isAbsolute(file)) {
37
31
  return existsSync(file) ? normalize(file) : null;
@@ -59,7 +53,6 @@ function componentCompiler(options = {}) {
59
53
  ...options
60
54
  };
61
55
  if (options.enableReporting) {
62
- console.log("[vite compiler] init");
63
56
  initReporter({
64
57
  appName: options.reporterAppName || "nocode-compiler-plugin",
65
58
  enabled: true,
@@ -182,12 +175,13 @@ function componentCompiler(options = {}) {
182
175
  filePath,
183
176
  query
184
177
  });
185
- if (!useJSXCompiler && !useVueCompiler) {
186
- return code;
178
+ if (useJSXCompiler) {
179
+ return jsxCompiler.compile(code, filePath, pkgRegistry) || code;
180
+ }
181
+ if (useVueCompiler) {
182
+ return vueCompiler.compile(code, filePath, pkgRegistry) || code;
187
183
  }
188
- const sourceCode = getSourceCode(filePath);
189
- const result = useJSXCompiler ? jsxCompiler.compile(sourceCode, filePath, pkgRegistry) : vueCompiler.compile(sourceCode, filePath, pkgRegistry);
190
- return result != null ? result : code;
184
+ return code;
191
185
  }
192
186
  };
193
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meituan-nocode/vite-plugin-nocode-compiler",
3
- "version": "0.2.4-beta.13",
3
+ "version": "0.2.4-beta.15",
4
4
  "description": "Vite plugin for nocode compiler",
5
5
  "type": "module",
6
6
  "exports": {