@hubspot/ui-extensions-dev-server 0.7.1 → 0.7.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.
@@ -0,0 +1,26 @@
1
+ const fs = require('fs');
2
+ const { logger } = require('@hubspot/cli-lib/logger');
3
+
4
+ function codeCheckingPlugin(options = {}) {
5
+ const { output } = options;
6
+ return {
7
+ name: 'ui-extensions-code-checking-plugin',
8
+ enforce: 'post',
9
+ writeBundle(__options, __bundle) {
10
+ try {
11
+ const code = fs.readFileSync(output).toString();
12
+ if (
13
+ !code.includes('const extend = (...args) => self.extend(...args);')
14
+ ) {
15
+ logger.warn(
16
+ 'Unable to determine if your extension entry point is calling hubspot.extend, this may prevent it from rendering as expected'
17
+ );
18
+ }
19
+ } catch (e) {
20
+ logger.error('Unable to load bundle for code checking');
21
+ }
22
+ },
23
+ };
24
+ }
25
+
26
+ module.exports = codeCheckingPlugin;
@@ -2,6 +2,8 @@ const { ROLLUP_OPTIONS, WEBSOCKET_MESSAGE_VERSION } = require('../constants');
2
2
  const { build } = require('vite');
3
3
  const manifestPlugin = require('./manifestPlugin');
4
4
  const { stripAnsiColorCodes } = require('../utils');
5
+ const codeCheckingPlugin = require('./codeCheckingPlugin');
6
+ const path = require('path');
5
7
  const { logger } = require('@hubspot/cli-lib/logger');
6
8
 
7
9
  function devBuildPlugin(options = {}) {
@@ -65,6 +67,9 @@ function devBuildPlugin(options = {}) {
65
67
  minify: false,
66
68
  output: extensionConfig.output,
67
69
  }),
70
+ codeCheckingPlugin({
71
+ output: path.join(outputDir, extensionConfig.output),
72
+ }),
68
73
  ],
69
74
  output: {
70
75
  ...ROLLUP_OPTIONS.output,
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@hubspot/ui-extensions-dev-server",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "jest",
8
+ "build": "echo 'no build step for @hubspot/ui-extensions-dev-server'",
8
9
  "jest": "jest --watch"
9
10
  },
10
11
  "publishConfig": {
@@ -32,7 +33,7 @@
32
33
  ],
33
34
  "license": "MIT",
34
35
  "dependencies": {
35
- "@hubspot/app-functions-dev-server": "^0.7.0",
36
+ "@hubspot/app-functions-dev-server": "^0.7.2",
36
37
  "@hubspot/cli-lib": "^4.1.6",
37
38
  "command-line-args": "^5.2.1",
38
39
  "command-line-usage": "^7.0.1",
@@ -67,5 +68,5 @@
67
68
  "optional": true
68
69
  }
69
70
  },
70
- "gitHead": "f3c6bfa9f758bdb23179e953a1826d1f0c3bd90f"
71
+ "gitHead": "291eae6851c5dc9be36952059ab8a7506e08b93b"
71
72
  }