@hubspot/cms-dev-server 0.4.0 → 0.4.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.
- package/dist/createDevServer.js +4 -2
- package/dist/createDevServerConfiguration.js +155 -0
- package/dist/createViteDevServer.js +4 -3
- package/dist/index.js +20 -5
- package/dist/lib/getDevServerConfiguration.js +63 -0
- package/dist/lib/templates.js +18 -7
- package/dist/proxyPage/proxyPage.js +2 -2
- package/dist/routes/module.js +2 -2
- package/dist/routes/partial.js +2 -2
- package/dist/routes/proxyPageRouteHandler.js +2 -2
- package/dist/routes/proxyPathPageRouteHandler.js +2 -2
- package/dist/run.js +1955 -5
- package/dist/storybook/index.js +7 -3
- package/dist/storybook/main.js +2 -1
- package/package.json +12 -9
- package/types/createViteDevServer.d.ts +1 -1
- package/dist/fsevents-72LCIACT.node +0 -0
package/dist/storybook/index.js
CHANGED
|
@@ -3,12 +3,18 @@ import React, { useEffect } from "react";
|
|
|
3
3
|
import { renderToStaticMarkup as renderToStaticMarkup2 } from "react-dom/server";
|
|
4
4
|
|
|
5
5
|
// ../cms-js-internal/dist/index.js
|
|
6
|
+
import path from "path";
|
|
7
|
+
import stream from "stream";
|
|
6
8
|
import { renderToPipeableStream } from "react-dom/server";
|
|
7
9
|
import {
|
|
8
10
|
ServerRenderContext,
|
|
9
11
|
createServerRenderContext
|
|
10
12
|
} from "@hubspot/cms-components";
|
|
11
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
import path2 from "path";
|
|
15
|
+
import { existsSync, readdirSync, lstatSync } from "fs";
|
|
16
|
+
import { join as joinPosix } from "path/posix";
|
|
17
|
+
import { basename } from "path";
|
|
12
18
|
import { cloneElement } from "react";
|
|
13
19
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
14
20
|
function renderFieldsToJson(fields) {
|
|
@@ -119,9 +125,7 @@ function moduleFieldsToJson(fields) {
|
|
|
119
125
|
function moduleStory(ModuleComponent, fields) {
|
|
120
126
|
const moduleJson = renderFieldsToJson(fields);
|
|
121
127
|
const argTypes = getFieldsArgTypes(moduleJson);
|
|
122
|
-
const story = (_args) => /* @__PURE__ */ jsx2(ModuleComponent, {
|
|
123
|
-
..._args
|
|
124
|
-
});
|
|
128
|
+
const story = (_args) => /* @__PURE__ */ jsx2(ModuleComponent, { ..._args });
|
|
125
129
|
const storyWithArgs = story.bind({});
|
|
126
130
|
storyWithArgs.argTypes = argTypes;
|
|
127
131
|
storyWithArgs.args = {};
|
package/dist/storybook/main.js
CHANGED
|
@@ -2,6 +2,7 @@ import path from 'path';
|
|
|
2
2
|
import { mergeConfig } from 'vite';
|
|
3
3
|
const webRoot = process.env.WEB_ROOT;
|
|
4
4
|
const storyPath = path.resolve(process.cwd(), webRoot, '**/*.stories.*');
|
|
5
|
+
const sharedDepsEnabled = Boolean(process.env.SHARED_DEPS_ENABLED);
|
|
5
6
|
export default {
|
|
6
7
|
addons: ['@storybook/addon-essentials'],
|
|
7
8
|
framework: '@storybook/react-vite',
|
|
@@ -23,7 +24,7 @@ export default {
|
|
|
23
24
|
css: {
|
|
24
25
|
postcss: webRoot,
|
|
25
26
|
},
|
|
26
|
-
plugins: [resolveIslandPlugin()],
|
|
27
|
+
plugins: [resolveIslandPlugin({ sharedDepsEnabled })],
|
|
27
28
|
};
|
|
28
29
|
return mergeConfig(config, viteConfig);
|
|
29
30
|
},
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cms-dev-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=16.x"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "tsc
|
|
10
|
+
"build": "tsc -noEmit && yarn run copy-html && yarn build-types && node scripts/build.mjs",
|
|
11
11
|
"build:watch": "nodemon --exec 'yarn build'",
|
|
12
12
|
"copy-html": "copyfiles -u 1 'src/html/**' 'dist'",
|
|
13
13
|
"build-types": "tsc --project tsconfig.types.json",
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@hubspot/cli-lib": "^3.0.12",
|
|
27
|
-
"@hubspot/cms-components": "^0.4.
|
|
28
|
-
"@hubspot/cms-js-internal": "^0.4.0",
|
|
27
|
+
"@hubspot/cms-components": "^0.4.2",
|
|
29
28
|
"@storybook/addon-actions": "^7.0.0-beta.19",
|
|
30
29
|
"@storybook/addon-essentials": "^7.0.0-beta.19",
|
|
31
30
|
"@storybook/addon-interactions": "^7.0.0-beta.19",
|
|
@@ -49,6 +48,7 @@
|
|
|
49
48
|
"vite-plugin-mkcert": "^1.10.1"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
51
|
+
"@hubspot/cms-js-internal": "^0.4.0",
|
|
52
52
|
"@testing-library/dom": "^8.20.0",
|
|
53
53
|
"@types/express": "^4.17.13",
|
|
54
54
|
"@types/react": "^18.0.0",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"ts-node": "^10.7.0",
|
|
60
60
|
"vitest": "0.25.8"
|
|
61
61
|
},
|
|
62
|
-
"main": "./dist/
|
|
62
|
+
"main": "./dist/index.js",
|
|
63
63
|
"exports": {
|
|
64
|
-
".": "./dist/
|
|
64
|
+
".": "./dist/index.js",
|
|
65
65
|
"./storybook": {
|
|
66
66
|
"types": "./types/storybook/index.d.ts",
|
|
67
67
|
"default": "./dist/storybook/index.js"
|
|
@@ -77,20 +77,23 @@
|
|
|
77
77
|
"types"
|
|
78
78
|
],
|
|
79
79
|
"nodemonConfig": {
|
|
80
|
+
"delay": "2000ms",
|
|
80
81
|
"ext": "js,json,ts,tsx,jsx,html",
|
|
81
82
|
"ignore": [
|
|
82
83
|
"testApp/*",
|
|
83
|
-
"dist/*"
|
|
84
|
+
"./dist/*"
|
|
84
85
|
],
|
|
85
86
|
"watch": [
|
|
86
87
|
"src",
|
|
87
88
|
"package.json",
|
|
88
89
|
"yarn.lock",
|
|
89
|
-
"tsconfig.json"
|
|
90
|
+
"tsconfig.json",
|
|
91
|
+
"../cms-components/dist",
|
|
92
|
+
"../cms-js-internal/dist"
|
|
90
93
|
]
|
|
91
94
|
},
|
|
92
95
|
"publishConfig": {
|
|
93
96
|
"access": "public"
|
|
94
97
|
},
|
|
95
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "977f3d499c0813345ef95393b6e1c53021429ea6"
|
|
96
99
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function createViteDevServer(webRoot: string): Promise<import("vite").ViteDevServer>;
|
|
1
|
+
declare function createViteDevServer(webRoot: string, port: any, sslEnabled: boolean, domainsToProxy?: any[]): Promise<import("vite").ViteDevServer>;
|
|
2
2
|
export default createViteDevServer;
|
|
Binary file
|