@hubspot/cms-dev-server 1.0.17 → 1.0.19
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/generateJsonFromJsx.js +1 -1
- package/dist/index.js +75 -8
- package/dist/internalSsr.js +71 -6
- package/dist/run.js +75 -8
- package/dist/storybook/index.js +1 -1
- package/dist/storybook-main/main.js +75 -10
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ import { normalizePath as normalizePath2 } from "vite";
|
|
|
9
9
|
import { createServer as createViteServer } from "vite";
|
|
10
10
|
import { default as react } from "@vitejs/plugin-react";
|
|
11
11
|
|
|
12
|
-
// ../cms-js-internal/dist/types-
|
|
12
|
+
// ../cms-js-internal/dist/types-BxnmA6nH.js
|
|
13
13
|
import path from "path";
|
|
14
14
|
var viteRoot;
|
|
15
15
|
var viteCommand;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createServer as createViteServer } from "vite";
|
|
3
3
|
import { default as react } from "@vitejs/plugin-react";
|
|
4
4
|
|
|
5
|
-
// ../cms-js-internal/dist/types-
|
|
5
|
+
// ../cms-js-internal/dist/types-BxnmA6nH.js
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { createHash } from "crypto";
|
|
8
8
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -10,6 +10,64 @@ import { join } from "path/posix";
|
|
|
10
10
|
var COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
|
|
11
11
|
var ENTRY_POINTS_PATH = "components/partials/";
|
|
12
12
|
var MODULE_FOLDER_PATH = "components/modules/";
|
|
13
|
+
function sortKeys(input, options = {}) {
|
|
14
|
+
const { deep, compare } = options;
|
|
15
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
16
|
+
function deepSortArray(array) {
|
|
17
|
+
const resultFromCache = cache.get(array);
|
|
18
|
+
if (resultFromCache !== void 0) {
|
|
19
|
+
return resultFromCache;
|
|
20
|
+
}
|
|
21
|
+
const result = [];
|
|
22
|
+
cache.set(array, result);
|
|
23
|
+
result.push(
|
|
24
|
+
...array.map((item) => {
|
|
25
|
+
if (Array.isArray(item)) {
|
|
26
|
+
return deepSortArray(item);
|
|
27
|
+
}
|
|
28
|
+
if (isPlainObject(item)) {
|
|
29
|
+
return _sortKeys(item);
|
|
30
|
+
}
|
|
31
|
+
return item;
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
function _sortKeys(object) {
|
|
37
|
+
const resultFromCache = cache.get(object);
|
|
38
|
+
if (resultFromCache !== void 0) {
|
|
39
|
+
return resultFromCache;
|
|
40
|
+
}
|
|
41
|
+
const result = {};
|
|
42
|
+
const keys = Object.keys(object).sort(compare);
|
|
43
|
+
cache.set(object, result);
|
|
44
|
+
for (const key of keys) {
|
|
45
|
+
const value = object[key];
|
|
46
|
+
let newValue;
|
|
47
|
+
if (deep && Array.isArray(value)) {
|
|
48
|
+
newValue = deepSortArray(value);
|
|
49
|
+
} else {
|
|
50
|
+
newValue = deep && isPlainObject(value) ? _sortKeys(value) : value;
|
|
51
|
+
}
|
|
52
|
+
Object.defineProperty(result, key, {
|
|
53
|
+
...Object.getOwnPropertyDescriptor(object, key),
|
|
54
|
+
value: newValue
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(input)) {
|
|
60
|
+
return deep ? deepSortArray(input) : [...input];
|
|
61
|
+
}
|
|
62
|
+
return _sortKeys(input);
|
|
63
|
+
}
|
|
64
|
+
function isPlainObject(value) {
|
|
65
|
+
if (typeof value !== "object" || value === null) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const prototype = Object.getPrototypeOf(value);
|
|
69
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
70
|
+
}
|
|
13
71
|
var badInlineJsChars = /[\u2028\u2029<>/]/g;
|
|
14
72
|
var inlineJsEscapeChars = {
|
|
15
73
|
"\u2028": "\\u2028",
|
|
@@ -27,11 +85,18 @@ function escapeForInlineJS(input) {
|
|
|
27
85
|
function jsonStringifyAndEscapeForInlineJS(input, { baseIndent = 0, jsonIndent = 2, prettyPrint = true } = {}) {
|
|
28
86
|
const indentString = " ".repeat(baseIndent);
|
|
29
87
|
jsonIndent = prettyPrint ? jsonIndent : void 0;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
88
|
+
let sorted;
|
|
89
|
+
try {
|
|
90
|
+
if (isPlainObject(input) || Array.isArray(input)) {
|
|
91
|
+
sorted = sortKeys(input, { deep: true });
|
|
92
|
+
}
|
|
93
|
+
} catch (e) {
|
|
94
|
+
console.error("Error sorting Island keys", e);
|
|
95
|
+
}
|
|
96
|
+
return escapeForInlineJS(
|
|
97
|
+
JSON.stringify(sorted ?? input, null, jsonIndent)
|
|
98
|
+
).replace(/\n/gm, `
|
|
99
|
+
${indentString}`);
|
|
35
100
|
}
|
|
36
101
|
var viteRoot;
|
|
37
102
|
var viteCommand;
|
|
@@ -1573,7 +1638,7 @@ function trackUsage(action) {
|
|
|
1573
1638
|
eventName: EVENT_NAME,
|
|
1574
1639
|
action,
|
|
1575
1640
|
nodeVersion: getNodeVersionData(),
|
|
1576
|
-
version: "1.0.
|
|
1641
|
+
version: "1.0.19",
|
|
1577
1642
|
os: getPlatform()
|
|
1578
1643
|
};
|
|
1579
1644
|
const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
|
@@ -4413,7 +4478,7 @@ var createDevServerRoutes = async (viteServer, appLocals, storybookPort) => {
|
|
|
4413
4478
|
const distAssetsPath = path13.join(appWebRoot, "assets");
|
|
4414
4479
|
devServerApp.use("/assets", expressStatic(distAssetsPath));
|
|
4415
4480
|
} else {
|
|
4416
|
-
devServerApp.use(appViteServer.middlewares);
|
|
4481
|
+
devServerApp.use("/local", appViteServer.middlewares);
|
|
4417
4482
|
}
|
|
4418
4483
|
devServerApp.use(viteServer.middlewares);
|
|
4419
4484
|
devServerApp.use("/api", createAppServerAPIRoutes_default());
|
|
@@ -4561,6 +4626,7 @@ import {
|
|
|
4561
4626
|
} from "vite";
|
|
4562
4627
|
import { default as react2 } from "@vitejs/plugin-react";
|
|
4563
4628
|
import { default as mkcert2 } from "vite-plugin-mkcert";
|
|
4629
|
+
var isProd3 = true;
|
|
4564
4630
|
async function createAppServer(appWebRoot, port, sslEnabled) {
|
|
4565
4631
|
const origin = process.env.VITE_ORIGIN ?? (sslEnabled ? `https://hslocal.net:${port}` : `http://hslocal.net:${port}`);
|
|
4566
4632
|
const viteConfig = {
|
|
@@ -4575,6 +4641,7 @@ async function createAppServer(appWebRoot, port, sslEnabled) {
|
|
|
4575
4641
|
},
|
|
4576
4642
|
appType: "custom",
|
|
4577
4643
|
root: appWebRoot,
|
|
4644
|
+
base: isProd3 ? void 0 : "/local",
|
|
4578
4645
|
ssr: {
|
|
4579
4646
|
noExternal: "@hubspot/cms-components"
|
|
4580
4647
|
},
|
package/dist/internalSsr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../cms-js-internal/dist/types-
|
|
1
|
+
// ../cms-js-internal/dist/types-BxnmA6nH.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { createHash } from "crypto";
|
|
4
4
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -68,6 +68,64 @@ var collectCssInDev = (modulePathToStartWith, viteServer, cssModulesImported = /
|
|
|
68
68
|
).map((cssModule) => createPreloadLink(cssModule.url)).join("\n")}
|
|
69
69
|
`;
|
|
70
70
|
};
|
|
71
|
+
function sortKeys(input, options = {}) {
|
|
72
|
+
const { deep, compare } = options;
|
|
73
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
74
|
+
function deepSortArray(array) {
|
|
75
|
+
const resultFromCache = cache.get(array);
|
|
76
|
+
if (resultFromCache !== void 0) {
|
|
77
|
+
return resultFromCache;
|
|
78
|
+
}
|
|
79
|
+
const result = [];
|
|
80
|
+
cache.set(array, result);
|
|
81
|
+
result.push(
|
|
82
|
+
...array.map((item) => {
|
|
83
|
+
if (Array.isArray(item)) {
|
|
84
|
+
return deepSortArray(item);
|
|
85
|
+
}
|
|
86
|
+
if (isPlainObject(item)) {
|
|
87
|
+
return _sortKeys(item);
|
|
88
|
+
}
|
|
89
|
+
return item;
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
function _sortKeys(object) {
|
|
95
|
+
const resultFromCache = cache.get(object);
|
|
96
|
+
if (resultFromCache !== void 0) {
|
|
97
|
+
return resultFromCache;
|
|
98
|
+
}
|
|
99
|
+
const result = {};
|
|
100
|
+
const keys = Object.keys(object).sort(compare);
|
|
101
|
+
cache.set(object, result);
|
|
102
|
+
for (const key of keys) {
|
|
103
|
+
const value = object[key];
|
|
104
|
+
let newValue;
|
|
105
|
+
if (deep && Array.isArray(value)) {
|
|
106
|
+
newValue = deepSortArray(value);
|
|
107
|
+
} else {
|
|
108
|
+
newValue = deep && isPlainObject(value) ? _sortKeys(value) : value;
|
|
109
|
+
}
|
|
110
|
+
Object.defineProperty(result, key, {
|
|
111
|
+
...Object.getOwnPropertyDescriptor(object, key),
|
|
112
|
+
value: newValue
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
if (Array.isArray(input)) {
|
|
118
|
+
return deep ? deepSortArray(input) : [...input];
|
|
119
|
+
}
|
|
120
|
+
return _sortKeys(input);
|
|
121
|
+
}
|
|
122
|
+
function isPlainObject(value) {
|
|
123
|
+
if (typeof value !== "object" || value === null) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const prototype = Object.getPrototypeOf(value);
|
|
127
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
128
|
+
}
|
|
71
129
|
var badInlineJsChars = /[\u2028\u2029<>/]/g;
|
|
72
130
|
var inlineJsEscapeChars = {
|
|
73
131
|
"\u2028": "\\u2028",
|
|
@@ -85,11 +143,18 @@ function escapeForInlineJS(input) {
|
|
|
85
143
|
function jsonStringifyAndEscapeForInlineJS(input, { baseIndent = 0, jsonIndent = 2, prettyPrint = true } = {}) {
|
|
86
144
|
const indentString = " ".repeat(baseIndent);
|
|
87
145
|
jsonIndent = prettyPrint ? jsonIndent : void 0;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
146
|
+
let sorted;
|
|
147
|
+
try {
|
|
148
|
+
if (isPlainObject(input) || Array.isArray(input)) {
|
|
149
|
+
sorted = sortKeys(input, { deep: true });
|
|
150
|
+
}
|
|
151
|
+
} catch (e) {
|
|
152
|
+
console.error("Error sorting Island keys", e);
|
|
153
|
+
}
|
|
154
|
+
return escapeForInlineJS(
|
|
155
|
+
JSON.stringify(sorted ?? input, null, jsonIndent)
|
|
156
|
+
).replace(/\n/gm, `
|
|
157
|
+
${indentString}`);
|
|
93
158
|
}
|
|
94
159
|
var viteRoot;
|
|
95
160
|
var viteCommand;
|
package/dist/run.js
CHANGED
|
@@ -811,7 +811,7 @@ function packagePath(metaUrl, projectPath) {
|
|
|
811
811
|
);
|
|
812
812
|
}
|
|
813
813
|
|
|
814
|
-
// ../cms-js-internal/dist/types-
|
|
814
|
+
// ../cms-js-internal/dist/types-BxnmA6nH.js
|
|
815
815
|
import path3 from "path";
|
|
816
816
|
import { createHash } from "crypto";
|
|
817
817
|
import fs2, { readFileSync, existsSync as existsSync2, readdirSync, lstatSync } from "fs";
|
|
@@ -819,6 +819,64 @@ import { join as join2 } from "path/posix";
|
|
|
819
819
|
var COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
|
|
820
820
|
var ENTRY_POINTS_PATH = "components/partials/";
|
|
821
821
|
var MODULE_FOLDER_PATH = "components/modules/";
|
|
822
|
+
function sortKeys(input, options = {}) {
|
|
823
|
+
const { deep, compare } = options;
|
|
824
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
825
|
+
function deepSortArray(array) {
|
|
826
|
+
const resultFromCache = cache.get(array);
|
|
827
|
+
if (resultFromCache !== void 0) {
|
|
828
|
+
return resultFromCache;
|
|
829
|
+
}
|
|
830
|
+
const result = [];
|
|
831
|
+
cache.set(array, result);
|
|
832
|
+
result.push(
|
|
833
|
+
...array.map((item) => {
|
|
834
|
+
if (Array.isArray(item)) {
|
|
835
|
+
return deepSortArray(item);
|
|
836
|
+
}
|
|
837
|
+
if (isPlainObject(item)) {
|
|
838
|
+
return _sortKeys(item);
|
|
839
|
+
}
|
|
840
|
+
return item;
|
|
841
|
+
})
|
|
842
|
+
);
|
|
843
|
+
return result;
|
|
844
|
+
}
|
|
845
|
+
function _sortKeys(object) {
|
|
846
|
+
const resultFromCache = cache.get(object);
|
|
847
|
+
if (resultFromCache !== void 0) {
|
|
848
|
+
return resultFromCache;
|
|
849
|
+
}
|
|
850
|
+
const result = {};
|
|
851
|
+
const keys = Object.keys(object).sort(compare);
|
|
852
|
+
cache.set(object, result);
|
|
853
|
+
for (const key of keys) {
|
|
854
|
+
const value = object[key];
|
|
855
|
+
let newValue;
|
|
856
|
+
if (deep && Array.isArray(value)) {
|
|
857
|
+
newValue = deepSortArray(value);
|
|
858
|
+
} else {
|
|
859
|
+
newValue = deep && isPlainObject(value) ? _sortKeys(value) : value;
|
|
860
|
+
}
|
|
861
|
+
Object.defineProperty(result, key, {
|
|
862
|
+
...Object.getOwnPropertyDescriptor(object, key),
|
|
863
|
+
value: newValue
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
return result;
|
|
867
|
+
}
|
|
868
|
+
if (Array.isArray(input)) {
|
|
869
|
+
return deep ? deepSortArray(input) : [...input];
|
|
870
|
+
}
|
|
871
|
+
return _sortKeys(input);
|
|
872
|
+
}
|
|
873
|
+
function isPlainObject(value) {
|
|
874
|
+
if (typeof value !== "object" || value === null) {
|
|
875
|
+
return false;
|
|
876
|
+
}
|
|
877
|
+
const prototype = Object.getPrototypeOf(value);
|
|
878
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
879
|
+
}
|
|
822
880
|
var badInlineJsChars = /[\u2028\u2029<>/]/g;
|
|
823
881
|
var inlineJsEscapeChars = {
|
|
824
882
|
"\u2028": "\\u2028",
|
|
@@ -836,11 +894,18 @@ function escapeForInlineJS(input) {
|
|
|
836
894
|
function jsonStringifyAndEscapeForInlineJS(input, { baseIndent = 0, jsonIndent = 2, prettyPrint = true } = {}) {
|
|
837
895
|
const indentString = " ".repeat(baseIndent);
|
|
838
896
|
jsonIndent = prettyPrint ? jsonIndent : void 0;
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
897
|
+
let sorted;
|
|
898
|
+
try {
|
|
899
|
+
if (isPlainObject(input) || Array.isArray(input)) {
|
|
900
|
+
sorted = sortKeys(input, { deep: true });
|
|
901
|
+
}
|
|
902
|
+
} catch (e) {
|
|
903
|
+
console.error("Error sorting Island keys", e);
|
|
904
|
+
}
|
|
905
|
+
return escapeForInlineJS(
|
|
906
|
+
JSON.stringify(sorted ?? input, null, jsonIndent)
|
|
907
|
+
).replace(/\n/gm, `
|
|
908
|
+
${indentString}`);
|
|
844
909
|
}
|
|
845
910
|
var viteRoot;
|
|
846
911
|
var viteCommand;
|
|
@@ -2101,7 +2166,7 @@ function trackUsage(action) {
|
|
|
2101
2166
|
eventName: EVENT_NAME,
|
|
2102
2167
|
action,
|
|
2103
2168
|
nodeVersion: getNodeVersionData(),
|
|
2104
|
-
version: "1.0.
|
|
2169
|
+
version: "1.0.19",
|
|
2105
2170
|
os: getPlatform()
|
|
2106
2171
|
};
|
|
2107
2172
|
const url3 = isAuthedWithPersonalAccessKey ? DEV_SERVER_USAGE_ENDPOINT_AUTHENTICATED : DEV_SERVER_USAGE_ENDPOINT;
|
|
@@ -5153,7 +5218,7 @@ var createDevServerRoutes = async (viteServer, appLocals, storybookPort) => {
|
|
|
5153
5218
|
const distAssetsPath = path14.join(appWebRoot, "assets");
|
|
5154
5219
|
devServerApp.use("/assets", expressStatic(distAssetsPath));
|
|
5155
5220
|
} else {
|
|
5156
|
-
devServerApp.use(appViteServer.middlewares);
|
|
5221
|
+
devServerApp.use("/local", appViteServer.middlewares);
|
|
5157
5222
|
}
|
|
5158
5223
|
devServerApp.use(viteServer.middlewares);
|
|
5159
5224
|
devServerApp.use("/api", createAppServerAPIRoutes_default());
|
|
@@ -5301,6 +5366,7 @@ import {
|
|
|
5301
5366
|
} from "vite";
|
|
5302
5367
|
import { default as react2 } from "@vitejs/plugin-react";
|
|
5303
5368
|
import { default as mkcert2 } from "vite-plugin-mkcert";
|
|
5369
|
+
var isProd3 = true;
|
|
5304
5370
|
async function createAppServer(appWebRoot, port, sslEnabled) {
|
|
5305
5371
|
const origin = process.env.VITE_ORIGIN ?? (sslEnabled ? `https://hslocal.net:${port}` : `http://hslocal.net:${port}`);
|
|
5306
5372
|
const viteConfig = {
|
|
@@ -5315,6 +5381,7 @@ async function createAppServer(appWebRoot, port, sslEnabled) {
|
|
|
5315
5381
|
},
|
|
5316
5382
|
appType: "custom",
|
|
5317
5383
|
root: appWebRoot,
|
|
5384
|
+
base: isProd3 ? void 0 : "/local",
|
|
5318
5385
|
ssr: {
|
|
5319
5386
|
noExternal: "@hubspot/cms-components"
|
|
5320
5387
|
},
|
package/dist/storybook/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
// ../cms-js-internal/dist/types-
|
|
11
|
+
// ../cms-js-internal/dist/types-BxnmA6nH.js
|
|
12
12
|
import path from "path";
|
|
13
13
|
import { createHash } from "crypto";
|
|
14
14
|
import fs, { readFileSync, existsSync, readdirSync, lstatSync } from "fs";
|
|
@@ -35,6 +35,64 @@ function createPreloadLink(assetPath, basePath = "") {
|
|
|
35
35
|
throw new Error(`Unknown preload type for ${assetPath}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
function sortKeys(input, options = {}) {
|
|
39
|
+
const { deep, compare } = options;
|
|
40
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
41
|
+
function deepSortArray(array) {
|
|
42
|
+
const resultFromCache = cache.get(array);
|
|
43
|
+
if (resultFromCache !== void 0) {
|
|
44
|
+
return resultFromCache;
|
|
45
|
+
}
|
|
46
|
+
const result = [];
|
|
47
|
+
cache.set(array, result);
|
|
48
|
+
result.push(
|
|
49
|
+
...array.map((item) => {
|
|
50
|
+
if (Array.isArray(item)) {
|
|
51
|
+
return deepSortArray(item);
|
|
52
|
+
}
|
|
53
|
+
if (isPlainObject(item)) {
|
|
54
|
+
return _sortKeys(item);
|
|
55
|
+
}
|
|
56
|
+
return item;
|
|
57
|
+
})
|
|
58
|
+
);
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
function _sortKeys(object) {
|
|
62
|
+
const resultFromCache = cache.get(object);
|
|
63
|
+
if (resultFromCache !== void 0) {
|
|
64
|
+
return resultFromCache;
|
|
65
|
+
}
|
|
66
|
+
const result = {};
|
|
67
|
+
const keys = Object.keys(object).sort(compare);
|
|
68
|
+
cache.set(object, result);
|
|
69
|
+
for (const key of keys) {
|
|
70
|
+
const value = object[key];
|
|
71
|
+
let newValue;
|
|
72
|
+
if (deep && Array.isArray(value)) {
|
|
73
|
+
newValue = deepSortArray(value);
|
|
74
|
+
} else {
|
|
75
|
+
newValue = deep && isPlainObject(value) ? _sortKeys(value) : value;
|
|
76
|
+
}
|
|
77
|
+
Object.defineProperty(result, key, {
|
|
78
|
+
...Object.getOwnPropertyDescriptor(object, key),
|
|
79
|
+
value: newValue
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
if (Array.isArray(input)) {
|
|
85
|
+
return deep ? deepSortArray(input) : [...input];
|
|
86
|
+
}
|
|
87
|
+
return _sortKeys(input);
|
|
88
|
+
}
|
|
89
|
+
function isPlainObject(value) {
|
|
90
|
+
if (typeof value !== "object" || value === null) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const prototype = Object.getPrototypeOf(value);
|
|
94
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
95
|
+
}
|
|
38
96
|
function escapeChar(unsafeChar) {
|
|
39
97
|
return inlineJsEscapeChars[unsafeChar];
|
|
40
98
|
}
|
|
@@ -44,11 +102,18 @@ function escapeForInlineJS(input) {
|
|
|
44
102
|
function jsonStringifyAndEscapeForInlineJS(input, { baseIndent = 0, jsonIndent = 2, prettyPrint = true } = {}) {
|
|
45
103
|
const indentString = " ".repeat(baseIndent);
|
|
46
104
|
jsonIndent = prettyPrint ? jsonIndent : void 0;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
105
|
+
let sorted;
|
|
106
|
+
try {
|
|
107
|
+
if (isPlainObject(input) || Array.isArray(input)) {
|
|
108
|
+
sorted = sortKeys(input, { deep: true });
|
|
109
|
+
}
|
|
110
|
+
} catch (e) {
|
|
111
|
+
console.error("Error sorting Island keys", e);
|
|
112
|
+
}
|
|
113
|
+
return escapeForInlineJS(
|
|
114
|
+
JSON.stringify(sorted ?? input, null, jsonIndent)
|
|
115
|
+
).replace(/\n/gm, `
|
|
116
|
+
${indentString}`);
|
|
52
117
|
}
|
|
53
118
|
function resolveIslandPlugin(islandsSet) {
|
|
54
119
|
return {
|
|
@@ -313,8 +378,8 @@ function isStylesheetAsset(staticAsset) {
|
|
|
313
378
|
return staticAsset.type === "stylesheet";
|
|
314
379
|
}
|
|
315
380
|
var COMPONENT_EXTENSIONS, ENTRY_POINTS_PATH, MODULE_FOLDER_PATH, TEMPLATE_FOLDER_PATH, VIRTUAL_ISLAND_RUNTIME, VIRTUAL_CONFIG_SETUP, CSS_LANGS_RE, collectCssModules, collectCssInDev, badInlineJsChars, inlineJsEscapeChars, viteRoot, viteCommand, clientRenderIsland, virtualClientRenderIslandModuleId, scriptTagToLogServerMessages, getComponentExtension, hasComponentExtension, isStorybookStory, removeComponentExtension, COMBINED_REACT_BASE_PATH, ISLAND_RUNTIME_CONFIG_BASE_PATH, removeIndexFromPath, removeIndexOrTrailingJsFromPath, HEALTHCHECKS_ENABLED_DEFAULT, HEALTHCHECKS_STRICT_DEFAULT, BUILD_INFO_PATH, GATES, ENABLED_FEATURES_GATE_MAP, findAllComponentsIn;
|
|
316
|
-
var
|
|
317
|
-
"../cms-js-internal/dist/types-
|
|
381
|
+
var init_types_BxnmA6nH = __esm({
|
|
382
|
+
"../cms-js-internal/dist/types-BxnmA6nH.js"() {
|
|
318
383
|
COMPONENT_EXTENSIONS = [".jsx", ".tsx", ".js", ".ts"];
|
|
319
384
|
ENTRY_POINTS_PATH = "components/partials/";
|
|
320
385
|
MODULE_FOLDER_PATH = "components/modules/";
|
|
@@ -1098,8 +1163,8 @@ function ModuleSlot(props) {
|
|
|
1098
1163
|
var setProperty, getProperty, hasProperty, serializeIslandDataForInlineScript, writeSharedStateToJsGlobal, createIslandsGlobalJsForClientInDev, traverse, CMS_MODULE_COMPONENT_NAME, DND_AREA_COMPONENT_NAME, PLUGIN_NAME, promiseForNewWritableStream, renderStreamToPromise, createServerRenderContextV22, createServerRenderContext2, renderServerSidePropsWithAsyncLocalStoreContext, bootStrapRenderContext;
|
|
1099
1164
|
var init_dist = __esm({
|
|
1100
1165
|
"../cms-js-internal/dist/index.js"() {
|
|
1101
|
-
|
|
1102
|
-
|
|
1166
|
+
init_types_BxnmA6nH();
|
|
1167
|
+
init_types_BxnmA6nH();
|
|
1103
1168
|
({ setProperty, getProperty, hasProperty } = dotProp);
|
|
1104
1169
|
serializeIslandDataForInlineScript = (tweakedIslandsArray, perServerRequestData, baseIndent = 0, prettyPrint, isUngatedForClientOnlySupplementalFieldSerialization = false) => {
|
|
1105
1170
|
const islandsArrayToSerialize = tweakedIslandsArray.map(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cms-dev-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@babel/parser": "^7.25.3",
|
|
30
30
|
"@babel/traverse": "^7.25.3",
|
|
31
31
|
"@babel/types": "^7.25.2",
|
|
32
|
-
"@hubspot/cms-components": "^1.0.
|
|
32
|
+
"@hubspot/cms-components": "^1.0.19",
|
|
33
33
|
"@hubspot/local-dev-lib": "2.0.1",
|
|
34
34
|
"@inquirer/select": "^2.0.0",
|
|
35
35
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"access": "public"
|
|
133
133
|
},
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "93a5843ed0250056800ed4aa76beb96f7a7887e0"
|
|
135
135
|
}
|