@hubspot/cms-dev-server 0.8.6 → 0.10.0

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 CHANGED
@@ -102,6 +102,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
102
102
  protocol: sslEnabled ? "wss" : void 0
103
103
  }
104
104
  },
105
+ root: webRoot,
105
106
  ssr: {
106
107
  // TODO: might need more entries here to get things to resolve through
107
108
  // resolveWebRootDepsPlugin
@@ -118,7 +119,11 @@ Custom origin: ${process.env.VITE_ORIGIN}
118
119
  sslEnabled ? mkcert({ hosts: additionalMkcertHosts }) : null,
119
120
  react({
120
121
  babel: {
121
- plugins: ["babel-plugin-styled-components", "styled-jsx/babel"]
122
+ plugins: [
123
+ "babel-plugin-styled-components",
124
+ "styled-jsx/babel",
125
+ "macros"
126
+ ]
122
127
  }
123
128
  }),
124
129
  clientIslandEntryPlugin(),
package/dist/run.js CHANGED
@@ -2,11 +2,55 @@
2
2
 
3
3
  // src/lib/cli.ts
4
4
  import { resolve } from "path";
5
+
6
+ // src/lib/logColors.ts
7
+ var CONTROL_CHARACTER = "\x1B";
8
+ var DEFAULT_SCHEME = "[0m";
9
+ var ForeGroudANSIColorMap = {
10
+ black: 30,
11
+ red: 31,
12
+ green: 32,
13
+ yellow: 33,
14
+ blue: 34,
15
+ magenta: 35,
16
+ cyan: 36,
17
+ white: 37
18
+ };
19
+ function wrapMessageInColor(color, message) {
20
+ return `${CONTROL_CHARACTER}[${ForeGroudANSIColorMap[color]}m${message}${CONTROL_CHARACTER}${DEFAULT_SCHEME}`;
21
+ }
22
+
23
+ // src/lib/cli.ts
24
+ function printHelpMessage() {
25
+ console.log(`
26
+ HubSpot CMS Dev Server
27
+
28
+ Usage: hs-cms-dev-server <path> [options]
29
+
30
+ Mandatory:
31
+ <path> Path to the directory containing your assets.
32
+
33
+ Options:
34
+ -c, --config Path to alternate hubspot.config.yaml configuration.
35
+ -a, --account The account name or id to use for the dev server.
36
+ --ssl Enables SSL for the dev server, serving it over an https:// URL.
37
+ --storybook Launches a Storybook dev server.
38
+
39
+ For more information on HubSpot CMS JS Rendering, visit:
40
+ ${wrapMessageInColor(
41
+ "cyan",
42
+ "https://github.hubspot.com/cms-js-building-block-examples/"
43
+ )}`);
44
+ }
5
45
  function getDevServerCommandLineOptions(argv) {
6
46
  const args = [...argv];
7
47
  const webRoot2 = args[2];
8
48
  let hubspotCliConfigPathOption2;
9
49
  let hubspotCliAccountNameOption2;
50
+ if (args.length == 2 || args.includes("help") || args.includes("--help")) {
51
+ printHelpMessage();
52
+ process.exit(0);
53
+ }
10
54
  const configOptionIndex = args.findIndex(
11
55
  (arg) => arg === "-c" || arg === "--config"
12
56
  );
@@ -2217,6 +2261,7 @@ Custom origin: ${process.env.VITE_ORIGIN}
2217
2261
  protocol: sslEnabled ? "wss" : void 0
2218
2262
  }
2219
2263
  },
2264
+ root: webRoot2,
2220
2265
  ssr: {
2221
2266
  // TODO: might need more entries here to get things to resolve through
2222
2267
  // resolveWebRootDepsPlugin
@@ -2233,7 +2278,11 @@ Custom origin: ${process.env.VITE_ORIGIN}
2233
2278
  sslEnabled ? mkcert({ hosts: additionalMkcertHosts }) : null,
2234
2279
  react({
2235
2280
  babel: {
2236
- plugins: ["babel-plugin-styled-components", "styled-jsx/babel"]
2281
+ plugins: [
2282
+ "babel-plugin-styled-components",
2283
+ "styled-jsx/babel",
2284
+ "macros"
2285
+ ]
2237
2286
  }
2238
2287
  }),
2239
2288
  clientIslandEntryPlugin(),
@@ -2379,23 +2428,6 @@ async function fetchWebsiteDomainNames(portalId) {
2379
2428
  return domainNames;
2380
2429
  }
2381
2430
 
2382
- // src/lib/logColors.ts
2383
- var CONTROL_CHARACTER = "\x1B";
2384
- var DEFAULT_SCHEME = "[0m";
2385
- var ForeGroudANSIColorMap = {
2386
- black: 30,
2387
- red: 31,
2388
- green: 32,
2389
- yellow: 33,
2390
- blue: 34,
2391
- megenta: 35,
2392
- cyan: 36,
2393
- white: 37
2394
- };
2395
- function wrapMessageInColor(color, message) {
2396
- return `${CONTROL_CHARACTER}[${ForeGroudANSIColorMap[color]}m${message}${CONTROL_CHARACTER}${DEFAULT_SCHEME}`;
2397
- }
2398
-
2399
2431
  // src/createDevServer.ts
2400
2432
  var BASE_PATH = "/";
2401
2433
  var PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3e3;
@@ -2439,7 +2471,7 @@ async function createDevServer(webRoot2, storybook2, hubspotCliConfigPathOption2
2439
2471
  );
2440
2472
  } catch (e) {
2441
2473
  console.warn(
2442
- `Unable to get gating information. gated features will not be availalbe in the local dev server`
2474
+ `Unable to get gating information. Gated features will not be available in the local dev server.`
2443
2475
  );
2444
2476
  }
2445
2477
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cms-dev-server",
3
- "version": "0.8.6",
3
+ "version": "0.10.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "engines": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@hubspot/cli-lib": "^3.0.12",
28
- "@hubspot/cms-components": "^0.8.6",
28
+ "@hubspot/cms-components": "^0.10.0",
29
29
  "@originjs/vite-plugin-commonjs": "^1.0.3",
30
30
  "@storybook/addon-actions": "7.0.7",
31
31
  "@storybook/addon-essentials": "7.0.7",
@@ -37,6 +37,7 @@
37
37
  "@storybook/testing-library": "^0.0.13",
38
38
  "@vitejs/plugin-react": "^4.0.0",
39
39
  "ansi-to-html": "0.7.x",
40
+ "babel-plugin-macros": "^3.1.0",
40
41
  "babel-plugin-styled-components": "^2.1.4",
41
42
  "cors": "^2.8.5",
42
43
  "debug": "^4.3.4",
@@ -100,5 +101,5 @@
100
101
  "publishConfig": {
101
102
  "access": "public"
102
103
  },
103
- "gitHead": "803096069b28abd1842356254912bfa911db1884"
104
+ "gitHead": "33530a6ecbfd2c6c3ff53dc17d1172f2cd780da8"
104
105
  }
Binary file
@@ -1,2 +0,0 @@
1
- import { Alias } from 'vite';
2
- export default function generateBpmAliases(webRoot: string): Alias[];
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'vite';
2
- declare const noNodeBuiltinsPlugin: () => Plugin;
3
- export default noNodeBuiltinsPlugin;
@@ -1,2 +0,0 @@
1
- import { Plugin } from 'vite';
2
- export default function devSecretsPlugin(secretNames: Array<string>): Plugin;
@@ -1,2 +0,0 @@
1
- import { Plugin } from 'vite';
2
- export default function resolveSharedDeps(): Plugin | null;