@bonsae/nrg 0.5.0 → 0.5.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.
@@ -1843,10 +1843,22 @@ function buildPlugin(options) {
1843
1843
  const tsconfigsToCheck = [serverTsconfig, clientTsconfig].filter(
1844
1844
  (p) => fs11.existsSync(p)
1845
1845
  );
1846
- for (const tsconfig of tsconfigsToCheck) {
1847
- execSync(`npx tsc -p ${tsconfig} --noEmit`, { stdio: "inherit" });
1846
+ try {
1847
+ for (const tsconfig of tsconfigsToCheck) {
1848
+ execSync(`npx tsc -p ${tsconfig} --noEmit`, {
1849
+ stdio: ["inherit", "pipe", "pipe"],
1850
+ encoding: "utf-8"
1851
+ });
1852
+ }
1853
+ logger.stopSpinner("Type checked");
1854
+ } catch (e) {
1855
+ logger.stopSpinner("Type check failed");
1856
+ const output = (e.stdout || "") + (e.stderr || "");
1857
+ if (output) {
1858
+ console.error(output);
1859
+ }
1860
+ throw new BuildError("type-check", e);
1848
1861
  }
1849
- logger.stopSpinner("Type checked");
1850
1862
  logger.startSpinner("Cleaning");
1851
1863
  cleanDir(buildContext.outDir);
1852
1864
  logger.stopSpinner("Cleaned");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonsae/nrg",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "NRG framework — build Node-RED nodes with Vue 3, TypeScript, and JSON Schema",
5
5
  "author": "Allan Oricil <allanoricil@duck.com>",
6
6
  "license": "MIT",
@@ -8,14 +8,16 @@
8
8
  :required="required"
9
9
  />
10
10
  </slot>
11
- <button
12
- ref="expand-button"
13
- class="red-ui-button red-ui-button-small expand-button"
14
- @click="onClickExpand"
15
- >
16
- <i class="fa fa-expand"></i>
17
- </button>
18
- <div :id="editorId" ref="editor"></div>
11
+ <div class="editor-wrapper">
12
+ <button
13
+ ref="expand-button"
14
+ class="red-ui-button red-ui-button-small expand-button"
15
+ @click="onClickExpand"
16
+ >
17
+ <i class="fa fa-expand"></i>
18
+ </button>
19
+ <div :id="editorId" ref="editor"></div>
20
+ </div>
19
21
  <div v-show="error" class="node-red-vue-input-error-message">
20
22
  {{ error }}
21
23
  </div>
@@ -290,7 +292,7 @@ export default defineComponent({
290
292
  });
291
293
  </script>
292
294
  <style scoped>
293
- .container {
295
+ .editor-wrapper {
294
296
  position: relative;
295
297
  }
296
298
 
@@ -32,9 +32,19 @@ function serveNrgResources(RED: RED): void {
32
32
  httpAdmin.use(function (req: any, res: any, next: any) {
33
33
  const prefix = "/nrg/assets/";
34
34
  if (!(req.path as string).startsWith(prefix)) return next();
35
- const reqPath = (req.path as string)
35
+ let reqPath = (req.path as string)
36
36
  .slice(prefix.length)
37
37
  .replace(/\.\./g, "");
38
+ // Serve the Vue dev build in development for devtools support
39
+ if (
40
+ reqPath === "vue.esm-browser.prod.js" &&
41
+ process.env.NODE_ENV !== "production"
42
+ ) {
43
+ const devPath = path.resolve(clientDir, "vue.esm-browser.js");
44
+ if (fs.existsSync(devPath)) {
45
+ reqPath = "vue.esm-browser.js";
46
+ }
47
+ }
38
48
  const filePath = path.resolve(clientDir, reqPath);
39
49
  if (!filePath.startsWith(clientDir)) return next();
40
50
  if (!fs.existsSync(filePath) || !fs.statSync(filePath).isFile())
@@ -37,10 +37,22 @@ function buildPlugin(options: BuildPluginOptions): Plugin {
37
37
  const tsconfigsToCheck = [serverTsconfig, clientTsconfig].filter((p) =>
38
38
  fs.existsSync(p),
39
39
  );
40
- for (const tsconfig of tsconfigsToCheck) {
41
- execSync(`npx tsc -p ${tsconfig} --noEmit`, { stdio: "inherit" });
40
+ try {
41
+ for (const tsconfig of tsconfigsToCheck) {
42
+ execSync(`npx tsc -p ${tsconfig} --noEmit`, {
43
+ stdio: ["inherit", "pipe", "pipe"],
44
+ encoding: "utf-8",
45
+ });
46
+ }
47
+ logger.stopSpinner("Type checked");
48
+ } catch (e: any) {
49
+ logger.stopSpinner("Type check failed");
50
+ const output = (e.stdout || "") + (e.stderr || "");
51
+ if (output) {
52
+ console.error(output);
53
+ }
54
+ throw new BuildError("type-check", e);
42
55
  }
43
- logger.stopSpinner("Type checked");
44
56
 
45
57
  logger.startSpinner("Cleaning");
46
58
  cleanDir(buildContext.outDir);