@wix/create-headless-site 0.0.30 → 0.0.32
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/build/index.js +66 -17
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -12477,10 +12477,10 @@ var require_error = __commonJS({
|
|
|
12477
12477
|
}
|
|
12478
12478
|
};
|
|
12479
12479
|
exports.HttpError = HttpError;
|
|
12480
|
-
function
|
|
12480
|
+
function createHttpError2(...args) {
|
|
12481
12481
|
return new HttpError(...args);
|
|
12482
12482
|
}
|
|
12483
|
-
exports.createHttpError =
|
|
12483
|
+
exports.createHttpError = createHttpError2;
|
|
12484
12484
|
}
|
|
12485
12485
|
});
|
|
12486
12486
|
|
|
@@ -75907,6 +75907,28 @@ function getHttpErrorInfo(httpError) {
|
|
|
75907
75907
|
};
|
|
75908
75908
|
}
|
|
75909
75909
|
|
|
75910
|
+
// ../cli-http-client/src/fetch-error.ts
|
|
75911
|
+
init_esm_shims();
|
|
75912
|
+
var import_http_client4 = __toESM(require_index_node(), 1);
|
|
75913
|
+
async function createHttpErrorFromFetch(originalResponse) {
|
|
75914
|
+
const res = originalResponse.clone();
|
|
75915
|
+
return (0, import_http_client4.createHttpError)({
|
|
75916
|
+
name: "Error",
|
|
75917
|
+
message: `Request failed with status code ${res.status}`,
|
|
75918
|
+
response: {
|
|
75919
|
+
config: {},
|
|
75920
|
+
data: await res.text(),
|
|
75921
|
+
status: res.status,
|
|
75922
|
+
statusText: res.statusText,
|
|
75923
|
+
headers: Object.fromEntries(res.headers)
|
|
75924
|
+
},
|
|
75925
|
+
code: res.statusText,
|
|
75926
|
+
config: {},
|
|
75927
|
+
toJSON: () => res,
|
|
75928
|
+
__CANCEL__: false
|
|
75929
|
+
});
|
|
75930
|
+
}
|
|
75931
|
+
|
|
75910
75932
|
// ../cli-auth/src/client.ts
|
|
75911
75933
|
var import_variant14 = __toESM(require_lib(), 1);
|
|
75912
75934
|
|
|
@@ -84008,14 +84030,14 @@ var open_default = open;
|
|
|
84008
84030
|
|
|
84009
84031
|
// ../user-browser/src/open-testkit.ts
|
|
84010
84032
|
init_esm_shims();
|
|
84011
|
-
var
|
|
84033
|
+
var import_http_client5 = __toESM(require_index_node(), 1);
|
|
84012
84034
|
async function open2(testEndpoint, url2) {
|
|
84013
|
-
await (0,
|
|
84035
|
+
await (0, import_http_client5.createHttpClient)().post(testEndpoint, void 0, {
|
|
84014
84036
|
params: {
|
|
84015
84037
|
url: url2
|
|
84016
84038
|
}
|
|
84017
84039
|
}).catch((error) => {
|
|
84018
|
-
if (
|
|
84040
|
+
if (import_http_client5.HttpClient.isHttpError(error) && error.response?.data?.message) {
|
|
84019
84041
|
throw new Error(error.response.data.message);
|
|
84020
84042
|
}
|
|
84021
84043
|
throw error;
|
|
@@ -89164,6 +89186,7 @@ var Platform;
|
|
|
89164
89186
|
Platform2["EditorSettings"] = "editor:settings";
|
|
89165
89187
|
Platform2["Mobile"] = "mobile";
|
|
89166
89188
|
Platform2["Standards"] = "standards";
|
|
89189
|
+
Platform2["DevPortal"] = "dev-portal";
|
|
89167
89190
|
})(Platform || (Platform = {}));
|
|
89168
89191
|
var ErrorSeverity;
|
|
89169
89192
|
(function(ErrorSeverity2) {
|
|
@@ -90152,7 +90175,7 @@ init_esm_shims();
|
|
|
90152
90175
|
init_esm_shims();
|
|
90153
90176
|
init_tslib_es6();
|
|
90154
90177
|
var import_wix_bi_logger_client = __toESM(require_dist());
|
|
90155
|
-
var
|
|
90178
|
+
var import_http_client6 = __toESM(require_index_node());
|
|
90156
90179
|
var defaultOptions2 = {
|
|
90157
90180
|
baseUrl: process.env.BI_BASE_URL || "https://frog.wix.com",
|
|
90158
90181
|
endpoint: "",
|
|
@@ -90182,7 +90205,7 @@ var StandaloneNodeLogger = (
|
|
|
90182
90205
|
endpoint = context2.endpoint || fullOptions.endpoint;
|
|
90183
90206
|
baseUrl = fullOptions.baseUrl, userAgent = fullOptions.userAgent, logError = fullOptions.logError;
|
|
90184
90207
|
headers = userAgent ? { headers: { "User-Agent": userAgent } } : {};
|
|
90185
|
-
return [4, new
|
|
90208
|
+
return [4, new import_http_client6.HttpClient({ baseURL: baseUrl }).get(endpoint, {
|
|
90186
90209
|
headers,
|
|
90187
90210
|
params: eventParams,
|
|
90188
90211
|
timeout: 30 * 1e3
|
|
@@ -90353,7 +90376,7 @@ function wixCliCliError(params) {
|
|
|
90353
90376
|
var package_default = {
|
|
90354
90377
|
name: "@wix/create-headless-site",
|
|
90355
90378
|
description: "Headless site creation wizard",
|
|
90356
|
-
version: "0.0.
|
|
90379
|
+
version: "0.0.32",
|
|
90357
90380
|
bin: "bin/index.cjs",
|
|
90358
90381
|
devDependencies: {
|
|
90359
90382
|
"@commander-js/extra-typings": "^13.0.0",
|
|
@@ -95516,6 +95539,7 @@ var ComponentType;
|
|
|
95516
95539
|
ComponentType3["WIX_AI_GATEWAY_CALLBACK"] = "WIX_AI_GATEWAY_CALLBACK";
|
|
95517
95540
|
ComponentType3["URL_MAPPER_PROVIDER"] = "URL_MAPPER_PROVIDER";
|
|
95518
95541
|
ComponentType3["PROVIDER_SUPPRESSION_SERVICE_PLUGIN"] = "PROVIDER_SUPPRESSION_SERVICE_PLUGIN";
|
|
95542
|
+
ComponentType3["ECOM_FORMS"] = "ECOM_FORMS";
|
|
95519
95543
|
})(ComponentType || (ComponentType = {}));
|
|
95520
95544
|
var WidgetVertical;
|
|
95521
95545
|
(function(WidgetVertical3) {
|
|
@@ -96234,6 +96258,7 @@ var DecorationType;
|
|
|
96234
96258
|
DecorationType3["STRIKETHROUGH"] = "STRIKETHROUGH";
|
|
96235
96259
|
DecorationType3["SUPERSCRIPT"] = "SUPERSCRIPT";
|
|
96236
96260
|
DecorationType3["SUBSCRIPT"] = "SUBSCRIPT";
|
|
96261
|
+
DecorationType3["FONT_FAMILY"] = "FONT_FAMILY";
|
|
96237
96262
|
})(DecorationType || (DecorationType = {}));
|
|
96238
96263
|
var FontType;
|
|
96239
96264
|
(function(FontType3) {
|
|
@@ -96337,6 +96362,7 @@ var TestEnum;
|
|
|
96337
96362
|
(function(TestEnum3) {
|
|
96338
96363
|
TestEnum3["UNKNOWN_TEST_ENUM"] = "UNKNOWN_TEST_ENUM";
|
|
96339
96364
|
TestEnum3["FIRST_TEST"] = "FIRST_TEST";
|
|
96365
|
+
TestEnum3["SECOND_TEST"] = "SECOND_TEST";
|
|
96340
96366
|
})(TestEnum || (TestEnum = {}));
|
|
96341
96367
|
var CalendarType;
|
|
96342
96368
|
(function(CalendarType3) {
|
|
@@ -97809,9 +97835,12 @@ var TimeConstraintType;
|
|
|
97809
97835
|
TimeConstraintType3["LAST_DAYS"] = "LAST_DAYS";
|
|
97810
97836
|
TimeConstraintType3["NEXT_DAYS"] = "NEXT_DAYS";
|
|
97811
97837
|
TimeConstraintType3["BETWEEN"] = "BETWEEN";
|
|
97838
|
+
TimeConstraintType3["TODAY"] = "TODAY";
|
|
97812
97839
|
TimeConstraintType3["THIS_MONTH"] = "THIS_MONTH";
|
|
97813
97840
|
TimeConstraintType3["ON_OR_AFTER"] = "ON_OR_AFTER";
|
|
97814
97841
|
TimeConstraintType3["ON_OR_BEFORE"] = "ON_OR_BEFORE";
|
|
97842
|
+
TimeConstraintType3["LAST_MONTHS"] = "LAST_MONTHS";
|
|
97843
|
+
TimeConstraintType3["NEXT_MONTHS"] = "NEXT_MONTHS";
|
|
97815
97844
|
})(TimeConstraintType || (TimeConstraintType = {}));
|
|
97816
97845
|
var ValueConstraintType;
|
|
97817
97846
|
(function(ValueConstraintType3) {
|
|
@@ -97856,6 +97885,7 @@ var AssetType;
|
|
|
97856
97885
|
AssetType3["RICOS"] = "RICOS";
|
|
97857
97886
|
AssetType3["DOC"] = "DOC";
|
|
97858
97887
|
AssetType3["SLIDE"] = "SLIDE";
|
|
97888
|
+
AssetType3["WIDGET"] = "WIDGET";
|
|
97859
97889
|
})(AssetType || (AssetType = {}));
|
|
97860
97890
|
var SaleType;
|
|
97861
97891
|
(function(SaleType2) {
|
|
@@ -98300,6 +98330,7 @@ var ComponentType2;
|
|
|
98300
98330
|
ComponentType3["WIX_AI_GATEWAY_CALLBACK"] = "WIX_AI_GATEWAY_CALLBACK";
|
|
98301
98331
|
ComponentType3["URL_MAPPER_PROVIDER"] = "URL_MAPPER_PROVIDER";
|
|
98302
98332
|
ComponentType3["PROVIDER_SUPPRESSION_SERVICE_PLUGIN"] = "PROVIDER_SUPPRESSION_SERVICE_PLUGIN";
|
|
98333
|
+
ComponentType3["ECOM_FORMS"] = "ECOM_FORMS";
|
|
98303
98334
|
})(ComponentType2 || (ComponentType2 = {}));
|
|
98304
98335
|
var WidgetVertical2;
|
|
98305
98336
|
(function(WidgetVertical3) {
|
|
@@ -99018,6 +99049,7 @@ var DecorationType2;
|
|
|
99018
99049
|
DecorationType3["STRIKETHROUGH"] = "STRIKETHROUGH";
|
|
99019
99050
|
DecorationType3["SUPERSCRIPT"] = "SUPERSCRIPT";
|
|
99020
99051
|
DecorationType3["SUBSCRIPT"] = "SUBSCRIPT";
|
|
99052
|
+
DecorationType3["FONT_FAMILY"] = "FONT_FAMILY";
|
|
99021
99053
|
})(DecorationType2 || (DecorationType2 = {}));
|
|
99022
99054
|
var FontType2;
|
|
99023
99055
|
(function(FontType3) {
|
|
@@ -99121,6 +99153,7 @@ var TestEnum2;
|
|
|
99121
99153
|
(function(TestEnum3) {
|
|
99122
99154
|
TestEnum3["UNKNOWN_TEST_ENUM"] = "UNKNOWN_TEST_ENUM";
|
|
99123
99155
|
TestEnum3["FIRST_TEST"] = "FIRST_TEST";
|
|
99156
|
+
TestEnum3["SECOND_TEST"] = "SECOND_TEST";
|
|
99124
99157
|
})(TestEnum2 || (TestEnum2 = {}));
|
|
99125
99158
|
var CalendarType2;
|
|
99126
99159
|
(function(CalendarType3) {
|
|
@@ -100593,9 +100626,12 @@ var TimeConstraintType2;
|
|
|
100593
100626
|
TimeConstraintType3["LAST_DAYS"] = "LAST_DAYS";
|
|
100594
100627
|
TimeConstraintType3["NEXT_DAYS"] = "NEXT_DAYS";
|
|
100595
100628
|
TimeConstraintType3["BETWEEN"] = "BETWEEN";
|
|
100629
|
+
TimeConstraintType3["TODAY"] = "TODAY";
|
|
100596
100630
|
TimeConstraintType3["THIS_MONTH"] = "THIS_MONTH";
|
|
100597
100631
|
TimeConstraintType3["ON_OR_AFTER"] = "ON_OR_AFTER";
|
|
100598
100632
|
TimeConstraintType3["ON_OR_BEFORE"] = "ON_OR_BEFORE";
|
|
100633
|
+
TimeConstraintType3["LAST_MONTHS"] = "LAST_MONTHS";
|
|
100634
|
+
TimeConstraintType3["NEXT_MONTHS"] = "NEXT_MONTHS";
|
|
100599
100635
|
})(TimeConstraintType2 || (TimeConstraintType2 = {}));
|
|
100600
100636
|
var ValueConstraintType2;
|
|
100601
100637
|
(function(ValueConstraintType3) {
|
|
@@ -100640,6 +100676,7 @@ var AssetType2;
|
|
|
100640
100676
|
AssetType3["RICOS"] = "RICOS";
|
|
100641
100677
|
AssetType3["DOC"] = "DOC";
|
|
100642
100678
|
AssetType3["SLIDE"] = "SLIDE";
|
|
100679
|
+
AssetType3["WIDGET"] = "WIDGET";
|
|
100643
100680
|
})(AssetType2 || (AssetType2 = {}));
|
|
100644
100681
|
var OpenConsentIn2;
|
|
100645
100682
|
(function(OpenConsentIn3) {
|
|
@@ -102122,7 +102159,8 @@ var BackendAsAServiceClient = class {
|
|
|
102122
102159
|
body: formData
|
|
102123
102160
|
});
|
|
102124
102161
|
if (!response.ok) {
|
|
102125
|
-
|
|
102162
|
+
const error = await createHttpErrorFromFetch(response);
|
|
102163
|
+
throw error;
|
|
102126
102164
|
}
|
|
102127
102165
|
return response.json();
|
|
102128
102166
|
},
|
|
@@ -102132,7 +102170,8 @@ var BackendAsAServiceClient = class {
|
|
|
102132
102170
|
} catch (e2) {
|
|
102133
102171
|
throw new CliError({
|
|
102134
102172
|
code: CliErrorCode.FailedToUploadStaticFiles(),
|
|
102135
|
-
cause: e2
|
|
102173
|
+
cause: e2,
|
|
102174
|
+
info: { endpointUrl }
|
|
102136
102175
|
});
|
|
102137
102176
|
}
|
|
102138
102177
|
};
|
|
@@ -102148,7 +102187,8 @@ var BackendAsAServiceClient = class {
|
|
|
102148
102187
|
body: fileContent
|
|
102149
102188
|
});
|
|
102150
102189
|
if (!response.ok) {
|
|
102151
|
-
|
|
102190
|
+
const error = await createHttpErrorFromFetch(response);
|
|
102191
|
+
throw error;
|
|
102152
102192
|
}
|
|
102153
102193
|
},
|
|
102154
102194
|
{ retries: 3 }
|
|
@@ -102156,7 +102196,8 @@ var BackendAsAServiceClient = class {
|
|
|
102156
102196
|
} catch (e2) {
|
|
102157
102197
|
throw new CliError({
|
|
102158
102198
|
code: CliErrorCode.FailedToUploadStaticFiles(),
|
|
102159
|
-
cause: e2
|
|
102199
|
+
cause: e2,
|
|
102200
|
+
info: { endpointUrl }
|
|
102160
102201
|
});
|
|
102161
102202
|
}
|
|
102162
102203
|
};
|
|
@@ -111544,16 +111585,17 @@ init_esm_shims();
|
|
|
111544
111585
|
import { resolve as resolve4, join as join13 } from "node:path";
|
|
111545
111586
|
import { copyFile as copyFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
111546
111587
|
async function assetsGenerator(opts) {
|
|
111547
|
-
const { templateRoot, projectFolder, outputPath } = opts;
|
|
111588
|
+
const { templateRoot, projectFolder, outputPath, assetsPrefix } = opts;
|
|
111548
111589
|
const assets = join13(templateRoot, "assets");
|
|
111549
111590
|
if (await pathExists(assets)) {
|
|
111550
|
-
const publicDir = join13(projectFolder,
|
|
111591
|
+
const publicDir = join13(projectFolder, outputPath ?? "");
|
|
111551
111592
|
const publicFiles = await getFiles(assets);
|
|
111552
111593
|
await mkdir2(publicDir, { recursive: true });
|
|
111553
111594
|
await Promise.all(
|
|
111554
111595
|
publicFiles.map(async (file) => {
|
|
111596
|
+
const outputName = assetsPrefix ? `${assetsPrefix}-${file}` : file;
|
|
111555
111597
|
const from = resolve4(assets, file);
|
|
111556
|
-
const to = resolve4(publicDir,
|
|
111598
|
+
const to = resolve4(publicDir, outputName);
|
|
111557
111599
|
await copyFile2(from, to);
|
|
111558
111600
|
})
|
|
111559
111601
|
);
|
|
@@ -111562,7 +111604,13 @@ async function assetsGenerator(opts) {
|
|
|
111562
111604
|
|
|
111563
111605
|
// ../gena/src/component-generator.ts
|
|
111564
111606
|
async function componentGenerator(opts) {
|
|
111565
|
-
const {
|
|
111607
|
+
const {
|
|
111608
|
+
template,
|
|
111609
|
+
projectFolder,
|
|
111610
|
+
assetsOutputPath,
|
|
111611
|
+
assetsPrefix,
|
|
111612
|
+
...generatorOpts
|
|
111613
|
+
} = opts;
|
|
111566
111614
|
const newFiles = await generator({
|
|
111567
111615
|
...generatorOpts,
|
|
111568
111616
|
template: join14(template, "files")
|
|
@@ -111570,7 +111618,8 @@ async function componentGenerator(opts) {
|
|
|
111570
111618
|
await assetsGenerator({
|
|
111571
111619
|
templateRoot: template,
|
|
111572
111620
|
projectFolder,
|
|
111573
|
-
outputPath: assetsOutputPath
|
|
111621
|
+
outputPath: assetsOutputPath,
|
|
111622
|
+
assetsPrefix
|
|
111574
111623
|
});
|
|
111575
111624
|
const newDependencies = await dependenciesUpdater({
|
|
111576
111625
|
projectFolder,
|