@wix/create-new 0.0.29 → 0.0.31
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/{chunk-OVBB732R.js → chunk-4P3PPFXH.js} +39 -160
- package/build/chunk-4P3PPFXH.js.map +1 -0
- package/build/{generator-MFLMNWRL.js → generator-L3CXBMWA.js} +2 -2
- package/build/index.js +202 -228
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/templates/app/blank/astro.config.mjs +1 -0
- package/build/chunk-OVBB732R.js.map +0 -1
- /package/build/{generator-MFLMNWRL.js.map → generator-L3CXBMWA.js.map} +0 -0
package/build/index.js
CHANGED
|
@@ -79,13 +79,11 @@ import {
|
|
|
79
79
|
CliErrorCode,
|
|
80
80
|
CliSystemErrorCode,
|
|
81
81
|
RepoType,
|
|
82
|
-
componentGenerator,
|
|
83
82
|
createPackageManager,
|
|
84
83
|
execa,
|
|
85
84
|
external_exports,
|
|
86
85
|
generator,
|
|
87
86
|
getEnvFilePath,
|
|
88
|
-
getExtensionDir,
|
|
89
87
|
getRepoType,
|
|
90
88
|
getTestOverrides,
|
|
91
89
|
gitClone,
|
|
@@ -113,7 +111,7 @@ import {
|
|
|
113
111
|
writeJson,
|
|
114
112
|
writePackageJson,
|
|
115
113
|
zod_default
|
|
116
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-4P3PPFXH.js";
|
|
117
115
|
import {
|
|
118
116
|
__commonJS,
|
|
119
117
|
__dirname,
|
|
@@ -15350,12 +15348,12 @@ var require_lodash = __commonJS({
|
|
|
15350
15348
|
Stack.prototype.has = stackHas;
|
|
15351
15349
|
Stack.prototype.set = stackSet;
|
|
15352
15350
|
function arrayLikeKeys(value2, inherited) {
|
|
15353
|
-
var isArr = isArray3(value2), isArg = !isArr && isArguments(value2), isBuff = !isArr && !isArg && isBuffer(value2),
|
|
15351
|
+
var isArr = isArray3(value2), isArg = !isArr && isArguments(value2), isBuff = !isArr && !isArg && isBuffer(value2), isType20 = !isArr && !isArg && !isBuff && isTypedArray(value2), skipIndexes = isArr || isArg || isBuff || isType20, result = skipIndexes ? baseTimes(value2.length, String) : [], length = result.length;
|
|
15354
15352
|
for (var key in value2) {
|
|
15355
15353
|
if ((inherited || hasOwnProperty3.call(value2, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
15356
15354
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
15357
15355
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
15358
|
-
|
|
15356
|
+
isType20 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
15359
15357
|
isIndex(key, length)))) {
|
|
15360
15358
|
result.push(key);
|
|
15361
15359
|
}
|
|
@@ -32549,10 +32547,10 @@ var require_kebabCase = __commonJS({
|
|
|
32549
32547
|
"use strict";
|
|
32550
32548
|
init_esm_shims();
|
|
32551
32549
|
var createCompounder = require_createCompounder();
|
|
32552
|
-
var
|
|
32550
|
+
var kebabCase5 = createCompounder(function(result, word, index) {
|
|
32553
32551
|
return result + (index ? "-" : "") + word.toLowerCase();
|
|
32554
32552
|
});
|
|
32555
|
-
module2.exports =
|
|
32553
|
+
module2.exports = kebabCase5;
|
|
32556
32554
|
}
|
|
32557
32555
|
});
|
|
32558
32556
|
|
|
@@ -32870,7 +32868,7 @@ var require_util = __commonJS({
|
|
|
32870
32868
|
return path4;
|
|
32871
32869
|
});
|
|
32872
32870
|
exports.normalize = normalize4;
|
|
32873
|
-
function
|
|
32871
|
+
function join20(aRoot, aPath) {
|
|
32874
32872
|
if (aRoot === "") {
|
|
32875
32873
|
aRoot = ".";
|
|
32876
32874
|
}
|
|
@@ -32902,7 +32900,7 @@ var require_util = __commonJS({
|
|
|
32902
32900
|
}
|
|
32903
32901
|
return joined;
|
|
32904
32902
|
}
|
|
32905
|
-
exports.join =
|
|
32903
|
+
exports.join = join20;
|
|
32906
32904
|
exports.isAbsolute = function(aPath) {
|
|
32907
32905
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
32908
32906
|
};
|
|
@@ -33116,7 +33114,7 @@ var require_util = __commonJS({
|
|
|
33116
33114
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
33117
33115
|
}
|
|
33118
33116
|
}
|
|
33119
|
-
sourceURL =
|
|
33117
|
+
sourceURL = join20(urlGenerate(parsed), sourceURL);
|
|
33120
33118
|
}
|
|
33121
33119
|
return normalize4(sourceURL);
|
|
33122
33120
|
}
|
|
@@ -50354,10 +50352,10 @@ var RenewTokenData = (0, import_variant.variant)({
|
|
|
50354
50352
|
var AuthClient = class {
|
|
50355
50353
|
constructor(httpClient) {
|
|
50356
50354
|
this.httpClient = httpClient;
|
|
50357
|
-
const { minRetryTimeout:
|
|
50355
|
+
const { minRetryTimeout: minRetryTimeout4 } = getTestOverrides();
|
|
50358
50356
|
this.retryOptions = {
|
|
50359
50357
|
retries: 3,
|
|
50360
|
-
minTimeout:
|
|
50358
|
+
minTimeout: minRetryTimeout4,
|
|
50361
50359
|
maxTimeout: 3 * 1e3
|
|
50362
50360
|
};
|
|
50363
50361
|
}
|
|
@@ -51102,6 +51100,23 @@ var accountAuthStrategy = {
|
|
|
51102
51100
|
async login({ deviceCode: deviceCode2, signal }) {
|
|
51103
51101
|
const accountAuth = await waitForLogin(deviceCode2, { signal });
|
|
51104
51102
|
return createAccountAuthState(accountAuth);
|
|
51103
|
+
},
|
|
51104
|
+
async loginWithRefreshToken({ refreshToken }) {
|
|
51105
|
+
const renewTokenResult = await client.renewToken({ refreshToken });
|
|
51106
|
+
if ((0, import_variant4.isType)(renewTokenResult, RenewTokenData.TokenRenewed)) {
|
|
51107
|
+
const newTokenData = renewTokenResult.payload;
|
|
51108
|
+
const userInfo2 = await client.userInfo({
|
|
51109
|
+
accessToken: newTokenData.accessToken
|
|
51110
|
+
});
|
|
51111
|
+
const result = { ...newTokenData, userInfo: userInfo2 };
|
|
51112
|
+
await deleteAuthData();
|
|
51113
|
+
await saveAuthData(result);
|
|
51114
|
+
return createAccountAuthState(result);
|
|
51115
|
+
}
|
|
51116
|
+
throw new CliError({
|
|
51117
|
+
code: CliErrorCode.FailedToLoginWithRefreshToken(),
|
|
51118
|
+
cause: null
|
|
51119
|
+
});
|
|
51105
51120
|
}
|
|
51106
51121
|
};
|
|
51107
51122
|
|
|
@@ -58190,19 +58205,28 @@ var useBiLogger = () => {
|
|
|
58190
58205
|
return context2;
|
|
58191
58206
|
};
|
|
58192
58207
|
|
|
58193
|
-
// ../../node_modules/@wix/bi-logger-
|
|
58208
|
+
// ../../node_modules/@wix/bi-logger-dev-tools-data/dist/esm/v2/index.js
|
|
58194
58209
|
init_esm_shims();
|
|
58195
58210
|
function wixCliCliCommand(params) {
|
|
58196
|
-
return { evid: 5200, src: 11, endpoint: "
|
|
58211
|
+
return { evid: 5200, src: 11, endpoint: "", params };
|
|
58197
58212
|
}
|
|
58198
58213
|
function wixCliCliCommandStatus(params) {
|
|
58199
|
-
return { evid: 5201, src: 11, endpoint: "
|
|
58214
|
+
return { evid: 5201, src: 11, endpoint: "", params };
|
|
58200
58215
|
}
|
|
58201
58216
|
function wixCliLoginStart(params) {
|
|
58202
|
-
return { evid: 5211, src: 11, endpoint: "
|
|
58217
|
+
return { evid: 5211, src: 11, endpoint: "", params };
|
|
58203
58218
|
}
|
|
58204
58219
|
function wixCliLoginEnd(params) {
|
|
58205
|
-
return { evid: 5212, src: 11, endpoint: "
|
|
58220
|
+
return { evid: 5212, src: 11, endpoint: "", params };
|
|
58221
|
+
}
|
|
58222
|
+
function wixCliAppFlowStepsAnswers(params) {
|
|
58223
|
+
return { evid: 5229, src: 11, endpoint: "", params };
|
|
58224
|
+
}
|
|
58225
|
+
function wixCliCliError(params) {
|
|
58226
|
+
return { evid: 5230, src: 11, endpoint: "", params };
|
|
58227
|
+
}
|
|
58228
|
+
function wixCliAction(params) {
|
|
58229
|
+
return { evid: 5231, src: 11, endpoint: "", params };
|
|
58206
58230
|
}
|
|
58207
58231
|
|
|
58208
58232
|
// ../cli-auth/src/components/Login.tsx
|
|
@@ -65282,7 +65306,9 @@ var createEnv = () => {
|
|
|
65282
65306
|
return {
|
|
65283
65307
|
isCI: overrides2.isCI ?? import_ci_info.default.isCI,
|
|
65284
65308
|
isPR: overrides2.isPR ?? import_ci_info.default.isPR,
|
|
65285
|
-
ciName: overrides2.ciName ?? import_ci_info.default.name ?? process.env.CI_NAME ?? null
|
|
65309
|
+
ciName: overrides2.ciName ?? import_ci_info.default.name ?? process.env.CI_NAME ?? null,
|
|
65310
|
+
cliEnvName: overrides2.cliEnvName ?? process.env.WIX_RUNTIME_ENVIRONMENT ?? null,
|
|
65311
|
+
cliTrackingId: overrides2.cliTrackingId ?? process.env.TRACKING_ID ?? null
|
|
65286
65312
|
};
|
|
65287
65313
|
};
|
|
65288
65314
|
|
|
@@ -65611,6 +65637,15 @@ function getErrorComponent(code, cause) {
|
|
|
65611
65637
|
}
|
|
65612
65638
|
);
|
|
65613
65639
|
},
|
|
65640
|
+
FailedToLoginWithRefreshToken: () => {
|
|
65641
|
+
return () => /* @__PURE__ */ import_react82.default.createElement(
|
|
65642
|
+
ErrorMessage,
|
|
65643
|
+
{
|
|
65644
|
+
message: "Failed to login with refresh token",
|
|
65645
|
+
hint: "Please check that your refresh token is valid and not revoked, then try again."
|
|
65646
|
+
}
|
|
65647
|
+
);
|
|
65648
|
+
},
|
|
65614
65649
|
FailedToRevokeRefreshToken: ({ email }) => {
|
|
65615
65650
|
return () => /* @__PURE__ */ import_react82.default.createElement(
|
|
65616
65651
|
SystemErrorMessage,
|
|
@@ -69744,6 +69779,47 @@ function shouldAddPerformanceIntegrations(options) {
|
|
|
69744
69779
|
// ../cli-error-reporting/src/error-reporter.ts
|
|
69745
69780
|
var import_verror3 = __toESM(require_verror(), 1);
|
|
69746
69781
|
import EventEmitter2 from "node:events";
|
|
69782
|
+
|
|
69783
|
+
// ../cli-error-reporting/src/error-utils.ts
|
|
69784
|
+
init_esm_shims();
|
|
69785
|
+
function truncateStringValues(value2, maxLength) {
|
|
69786
|
+
if (value2 == null) {
|
|
69787
|
+
return value2;
|
|
69788
|
+
}
|
|
69789
|
+
if (typeof value2 === "string") {
|
|
69790
|
+
if (value2.length <= maxLength) {
|
|
69791
|
+
return value2;
|
|
69792
|
+
}
|
|
69793
|
+
return `${value2.slice(0, maxLength)} [Truncated]`;
|
|
69794
|
+
}
|
|
69795
|
+
if (Array.isArray(value2)) {
|
|
69796
|
+
return value2.map((item) => truncateStringValues(item, maxLength));
|
|
69797
|
+
}
|
|
69798
|
+
if (typeof value2 === "object") {
|
|
69799
|
+
return Object.fromEntries(
|
|
69800
|
+
Object.entries(value2).map(([k, v]) => [
|
|
69801
|
+
k,
|
|
69802
|
+
truncateStringValues(v, maxLength)
|
|
69803
|
+
])
|
|
69804
|
+
);
|
|
69805
|
+
}
|
|
69806
|
+
return value2;
|
|
69807
|
+
}
|
|
69808
|
+
function toSafeJson(value2) {
|
|
69809
|
+
if (typeof value2 === "string") {
|
|
69810
|
+
try {
|
|
69811
|
+
return JSON.parse(value2);
|
|
69812
|
+
} catch {
|
|
69813
|
+
return value2;
|
|
69814
|
+
}
|
|
69815
|
+
}
|
|
69816
|
+
return value2;
|
|
69817
|
+
}
|
|
69818
|
+
function normalizeRequestId(requestId) {
|
|
69819
|
+
return requestId.split(",").map((id) => id.trim()).at(0) ?? requestId;
|
|
69820
|
+
}
|
|
69821
|
+
|
|
69822
|
+
// ../cli-error-reporting/src/error-reporter.ts
|
|
69747
69823
|
var ReportErrorResult = (0, import_variant18.variant)({
|
|
69748
69824
|
Reported: (0, import_variant18.fields)(),
|
|
69749
69825
|
Ignored: {}
|
|
@@ -69758,8 +69834,15 @@ var reportError = (scope, originalError, { data } = {}) => {
|
|
|
69758
69834
|
captureContext: (localScope) => {
|
|
69759
69835
|
const httpError = extractHttpError(error);
|
|
69760
69836
|
if (httpError) {
|
|
69761
|
-
localScope.setTag(
|
|
69762
|
-
|
|
69837
|
+
localScope.setTag(
|
|
69838
|
+
"request.id",
|
|
69839
|
+
normalizeRequestId(httpError.requestId)
|
|
69840
|
+
);
|
|
69841
|
+
const errorInfo = getHttpErrorInfo(httpError);
|
|
69842
|
+
errorInfo.request.data = toSafeJson(errorInfo.request.data);
|
|
69843
|
+
errorInfo.response.data = toSafeJson(errorInfo.response.data);
|
|
69844
|
+
const truncatedErrorInfo = truncateStringValues(errorInfo, 200);
|
|
69845
|
+
localScope.setContext("Request Info", truncatedErrorInfo);
|
|
69763
69846
|
}
|
|
69764
69847
|
if (error instanceof Error) {
|
|
69765
69848
|
localScope.setContext("Error Details", {
|
|
@@ -69767,9 +69850,11 @@ var reportError = (scope, originalError, { data } = {}) => {
|
|
|
69767
69850
|
"Full Stack": import_verror3.default.fullStack(error)
|
|
69768
69851
|
});
|
|
69769
69852
|
}
|
|
69770
|
-
const { isCI: isCI3, isPR, ciName } = createEnv();
|
|
69853
|
+
const { isCI: isCI3, isPR, ciName, cliEnvName, cliTrackingId } = createEnv();
|
|
69771
69854
|
localScope.setTag("ci", yesOrNo(isCI3));
|
|
69772
69855
|
localScope.setTag("ci.name", ciName);
|
|
69856
|
+
localScope.setTag("cli.env_name", cliEnvName);
|
|
69857
|
+
localScope.setTag("cli.tracking_id", cliTrackingId);
|
|
69773
69858
|
localScope.setContext("CI", {
|
|
69774
69859
|
Name: ciName,
|
|
69775
69860
|
"Is CI": yesOrNo(isCI3),
|
|
@@ -69798,8 +69883,9 @@ function createErrorReporter({ dsn, release: release2 }) {
|
|
|
69798
69883
|
},
|
|
69799
69884
|
// Since we pass `requestInfo`, the default depth of 3
|
|
69800
69885
|
// redacts most useful info passed from API error responses
|
|
69801
|
-
// so we increase it to include more of the potential error http
|
|
69802
|
-
normalizeDepth:
|
|
69886
|
+
// so we increase it to include more of the potential error http response.
|
|
69887
|
+
normalizeDepth: 8,
|
|
69888
|
+
normalizeMaxBreadth: 20
|
|
69803
69889
|
});
|
|
69804
69890
|
const sentryScope = new Scope();
|
|
69805
69891
|
sentryScope.setClient(sentryClient);
|
|
@@ -71566,20 +71652,6 @@ var import_react102 = __toESM(require_react(), 1);
|
|
|
71566
71652
|
|
|
71567
71653
|
// ../create-new-packages/app-command/src/bi/events.ts
|
|
71568
71654
|
init_esm_shims();
|
|
71569
|
-
|
|
71570
|
-
// ../../node_modules/@wix/bi-logger-dev-tools-data/dist/esm/v2/index.js
|
|
71571
|
-
init_esm_shims();
|
|
71572
|
-
function wixCliAppFlowStepsAnswers(params) {
|
|
71573
|
-
return { evid: 5229, src: 11, endpoint: "", params };
|
|
71574
|
-
}
|
|
71575
|
-
function wixCliCliError(params) {
|
|
71576
|
-
return { evid: 5230, src: 11, endpoint: "", params };
|
|
71577
|
-
}
|
|
71578
|
-
function wixCliAction(params) {
|
|
71579
|
-
return { evid: 5231, src: 11, endpoint: "", params };
|
|
71580
|
-
}
|
|
71581
|
-
|
|
71582
|
-
// ../create-new-packages/app-command/src/bi/events.ts
|
|
71583
71655
|
var createAppBiEvents = (biLogger) => ({
|
|
71584
71656
|
cliAction: ({
|
|
71585
71657
|
question,
|
|
@@ -71769,7 +71841,7 @@ function reportCommandStartEvent({
|
|
|
71769
71841
|
}) {
|
|
71770
71842
|
const options = command.opts();
|
|
71771
71843
|
const args = command.args;
|
|
71772
|
-
const privateOptions = /* @__PURE__ */ new Set(["apiKey"]);
|
|
71844
|
+
const privateOptions = /* @__PURE__ */ new Set(["apiKey", "refreshToken"]);
|
|
71773
71845
|
const sanitizedOptions = Object.fromEntries(
|
|
71774
71846
|
Object.entries(options).map(([flagName, flagValue]) => {
|
|
71775
71847
|
const value2 = privateOptions.has(flagName) ? "<censored>" : flagValue;
|
|
@@ -79825,10 +79897,10 @@ var EMPTY_SITE_TEMPLATE = "24bafe8a-7c80-4b63-8a71-08752062f246";
|
|
|
79825
79897
|
var DevCenterClient = class {
|
|
79826
79898
|
constructor(httpClient) {
|
|
79827
79899
|
this.httpClient = httpClient;
|
|
79828
|
-
const { minRetryTimeout:
|
|
79900
|
+
const { minRetryTimeout: minRetryTimeout4 } = getTestOverrides();
|
|
79829
79901
|
this.retryOptions = {
|
|
79830
79902
|
retries: 3,
|
|
79831
|
-
minTimeout:
|
|
79903
|
+
minTimeout: minRetryTimeout4,
|
|
79832
79904
|
maxTimeout: 3 * 1e3
|
|
79833
79905
|
};
|
|
79834
79906
|
}
|
|
@@ -81999,7 +82071,7 @@ function getTasks({
|
|
|
81999
82071
|
cause: e2
|
|
82000
82072
|
});
|
|
82001
82073
|
}
|
|
82002
|
-
const { generateApp } = await import("./generator-
|
|
82074
|
+
const { generateApp } = await import("./generator-L3CXBMWA.js");
|
|
82003
82075
|
await generateApp({
|
|
82004
82076
|
packageName,
|
|
82005
82077
|
packageFolder,
|
|
@@ -82524,7 +82596,7 @@ var validateProjectName = (value2) => {
|
|
|
82524
82596
|
// ../create-new-packages/headless-command/src/components/LinkCommand/LinkCommand.tsx
|
|
82525
82597
|
init_esm_shims();
|
|
82526
82598
|
var import_react139 = __toESM(require_react(), 1);
|
|
82527
|
-
var
|
|
82599
|
+
var import_variant43 = __toESM(require_lib(), 1);
|
|
82528
82600
|
|
|
82529
82601
|
// ../create-new-packages/headless-command/src/components/WelcomeMessage.tsx
|
|
82530
82602
|
init_esm_shims();
|
|
@@ -82643,17 +82715,10 @@ var CreateProjectResponseSchema = external_exports.object({
|
|
|
82643
82715
|
});
|
|
82644
82716
|
|
|
82645
82717
|
// ../create-new-packages/headless-command/src/clients/funnel-projects/funnel-projects-client.ts
|
|
82646
|
-
var { minRetryTimeout: minRetryTimeout2 } = getTestOverrides();
|
|
82647
82718
|
var FunnelProjectsClient = class {
|
|
82648
82719
|
constructor(httpClient) {
|
|
82649
82720
|
this.httpClient = httpClient;
|
|
82650
|
-
this.retryOptions = {
|
|
82651
|
-
retries: 3,
|
|
82652
|
-
minTimeout: minRetryTimeout2,
|
|
82653
|
-
maxTimeout: 3 * 1e3
|
|
82654
|
-
};
|
|
82655
82721
|
}
|
|
82656
|
-
retryOptions;
|
|
82657
82722
|
createProject = async (siteName, templateId) => {
|
|
82658
82723
|
try {
|
|
82659
82724
|
const { data } = await this.httpClient.request(
|
|
@@ -82979,8 +83044,16 @@ function useMetasiteManagerClient() {
|
|
|
82979
83044
|
|
|
82980
83045
|
// ../create-new-packages/headless-command/src/hooks/create-project.ts
|
|
82981
83046
|
var DEFAULT_ENVIRONMENT_NAME2 = "system_global";
|
|
82982
|
-
function
|
|
82983
|
-
|
|
83047
|
+
function generateSlug(projectName) {
|
|
83048
|
+
const base = (0, import_kebabCase3.default)(projectName).replaceAll(/[^a-z0-9-]/gi, "").slice(0, 10).replace(/-$/, "");
|
|
83049
|
+
const salt = randomBytes2(4).toString("hex");
|
|
83050
|
+
return `${base}-${salt}`;
|
|
83051
|
+
}
|
|
83052
|
+
function truncateName(name, maxLength) {
|
|
83053
|
+
if (name.length > maxLength) {
|
|
83054
|
+
return `${name.slice(0, maxLength - 3)}...`;
|
|
83055
|
+
}
|
|
83056
|
+
return name;
|
|
82984
83057
|
}
|
|
82985
83058
|
var useCreateProject = (businessId) => {
|
|
82986
83059
|
const { createOAuthApp: createOAuthApp2, updateOAuthApp: updateOAuthApp2, getAppSecret } = useDevCenterClient();
|
|
@@ -82992,7 +83065,7 @@ var useCreateProject = (businessId) => {
|
|
|
82992
83065
|
cloudProviders
|
|
82993
83066
|
}) => {
|
|
82994
83067
|
const { id: projectId } = await createOAuthApp2({
|
|
82995
|
-
name: `Private App for: ${projectName}
|
|
83068
|
+
name: truncateName(`Private App for: ${projectName}`, 50)
|
|
82996
83069
|
});
|
|
82997
83070
|
const [publicKeyAndSecret, instanceId] = await Promise.all([
|
|
82998
83071
|
getAppSecret({ appId: projectId }),
|
|
@@ -83001,21 +83074,12 @@ var useCreateProject = (businessId) => {
|
|
|
83001
83074
|
appId: projectId
|
|
83002
83075
|
})
|
|
83003
83076
|
]);
|
|
83004
|
-
const
|
|
83005
|
-
|
|
83006
|
-
|
|
83007
|
-
|
|
83008
|
-
|
|
83009
|
-
|
|
83010
|
-
displayName: projectName,
|
|
83011
|
-
slug,
|
|
83012
|
-
cloudProvider: cloudProviders?.[0]
|
|
83013
|
-
});
|
|
83014
|
-
},
|
|
83015
|
-
{
|
|
83016
|
-
retries: 1
|
|
83017
|
-
}
|
|
83018
|
-
);
|
|
83077
|
+
const appProject = await createAppProject2({
|
|
83078
|
+
id: projectId,
|
|
83079
|
+
displayName: truncateName(projectName, 50),
|
|
83080
|
+
slug: generateSlug(projectName),
|
|
83081
|
+
cloudProvider: cloudProviders?.[0]
|
|
83082
|
+
});
|
|
83019
83083
|
const loginRoute = `api/auth/callback`;
|
|
83020
83084
|
const logoutRoute = `api/auth/logout-callback`;
|
|
83021
83085
|
const projectBaseURL = new URL(appProject.baseUrl);
|
|
@@ -83104,7 +83168,7 @@ var CreateProject = ({
|
|
|
83104
83168
|
// ../create-new-packages/headless-command/src/components/LinkCommand/GenerateProject.tsx
|
|
83105
83169
|
init_esm_shims();
|
|
83106
83170
|
var import_react137 = __toESM(require_react(), 1);
|
|
83107
|
-
var
|
|
83171
|
+
var import_variant42 = __toESM(require_lib(), 1);
|
|
83108
83172
|
|
|
83109
83173
|
// ../cli-project-extender/src/index.ts
|
|
83110
83174
|
init_esm_shims();
|
|
@@ -92155,83 +92219,11 @@ async function extend2(projectFolder) {
|
|
|
92155
92219
|
await modifyAstroConfig(projectFolder);
|
|
92156
92220
|
}
|
|
92157
92221
|
|
|
92158
|
-
// ../cli-project-extender/src/add-files-from-template.ts
|
|
92159
|
-
init_esm_shims();
|
|
92160
|
-
import { join as join15 } from "node:path";
|
|
92161
|
-
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
92162
|
-
var import_variant41 = __toESM(require_lib(), 1);
|
|
92163
|
-
|
|
92164
|
-
// ../cli-project-extender/src/clone-templates-repo.ts
|
|
92165
|
-
init_esm_shims();
|
|
92166
|
-
import { join as join14 } from "node:path";
|
|
92167
|
-
import { rm as rm2 } from "node:fs/promises";
|
|
92168
|
-
async function cloneTemplatesRepo(url) {
|
|
92169
|
-
const repoDir = temporaryDirectory({ prefix: "wix-cli-project-extender" });
|
|
92170
|
-
try {
|
|
92171
|
-
await gitClone(url, repoDir);
|
|
92172
|
-
await rm2(join14(repoDir, ".git"), { recursive: true, force: true });
|
|
92173
|
-
} catch (e2) {
|
|
92174
|
-
throw new CliError({
|
|
92175
|
-
code: CliErrorCode.FailedToCloneRepo(),
|
|
92176
|
-
cause: e2
|
|
92177
|
-
});
|
|
92178
|
-
}
|
|
92179
|
-
return repoDir;
|
|
92180
|
-
}
|
|
92181
|
-
|
|
92182
|
-
// ../cli-project-extender/src/add-files-from-template.ts
|
|
92183
|
-
var TEMPLATE_REPO = "git@github.com:wix-incubator/headless-cli-templates.git";
|
|
92184
|
-
async function addFilesFromTemplate(projectFolder, templateId, packageManager2, repoType2) {
|
|
92185
|
-
const repoRoot = await cloneTemplatesRepo(TEMPLATE_REPO);
|
|
92186
|
-
const templateExtensionRoot = join15(repoRoot, "templates", templateId);
|
|
92187
|
-
const sharedTemplate = join15(repoRoot, "templates-shared");
|
|
92188
|
-
if (await pathExists(sharedTemplate)) {
|
|
92189
|
-
await componentGenerator({
|
|
92190
|
-
template: sharedTemplate,
|
|
92191
|
-
projectFolder,
|
|
92192
|
-
cwd: projectFolder,
|
|
92193
|
-
data: {
|
|
92194
|
-
packageManager: {
|
|
92195
|
-
name: packageManager2.name
|
|
92196
|
-
},
|
|
92197
|
-
isMonorepo: (0, import_variant41.isType)(repoType2, RepoType.Monorepo)
|
|
92198
|
-
}
|
|
92199
|
-
});
|
|
92200
|
-
}
|
|
92201
|
-
if (!await pathExists(templateExtensionRoot)) {
|
|
92202
|
-
return;
|
|
92203
|
-
}
|
|
92204
|
-
const extensionTemplates = await globby("*", {
|
|
92205
|
-
onlyDirectories: true,
|
|
92206
|
-
cwd: templateExtensionRoot
|
|
92207
|
-
});
|
|
92208
|
-
for (const template of extensionTemplates) {
|
|
92209
|
-
const uniqueDir = await getUniqueExtensionPath(projectFolder, template, 0);
|
|
92210
|
-
await componentGenerator({
|
|
92211
|
-
template: join15(templateExtensionRoot, template),
|
|
92212
|
-
projectFolder,
|
|
92213
|
-
cwd: join15(getExtensionDir(projectFolder), uniqueDir),
|
|
92214
|
-
data: {
|
|
92215
|
-
randomUUID: () => randomUUID3(),
|
|
92216
|
-
dir: uniqueDir
|
|
92217
|
-
}
|
|
92218
|
-
});
|
|
92219
|
-
}
|
|
92220
|
-
}
|
|
92221
|
-
async function getUniqueExtensionPath(projectFolder, extensionPath, suffix) {
|
|
92222
|
-
const uniqueExtensionPath = suffix ? `${extensionPath}${suffix}` : extensionPath;
|
|
92223
|
-
const path4 = join15(getExtensionDir(projectFolder), uniqueExtensionPath);
|
|
92224
|
-
if (!await pathExists(path4)) {
|
|
92225
|
-
return uniqueExtensionPath;
|
|
92226
|
-
}
|
|
92227
|
-
return getUniqueExtensionPath(projectFolder, extensionPath, suffix + 1);
|
|
92228
|
-
}
|
|
92229
|
-
|
|
92230
92222
|
// ../create-new-packages/headless-command/src/task-runner.ts
|
|
92231
92223
|
init_esm_shims();
|
|
92232
92224
|
var import_react135 = __toESM(require_react(), 1);
|
|
92233
|
-
var
|
|
92234
|
-
var TaskRunnerStatus2 = (0,
|
|
92225
|
+
var import_variant41 = __toESM(require_lib(), 1);
|
|
92226
|
+
var TaskRunnerStatus2 = (0, import_variant41.variant)({
|
|
92235
92227
|
Idle: {},
|
|
92236
92228
|
Running: (runningTasks, totalTaskCount) => {
|
|
92237
92229
|
const taskStatuses = runningTasks.map((task, index) => {
|
|
@@ -92343,7 +92335,7 @@ var GenerateProject = ({ projectFolder, businessId, projectData, onDone, package
|
|
|
92343
92335
|
await executeTaskRunner(tasks);
|
|
92344
92336
|
onDone(true);
|
|
92345
92337
|
}, []);
|
|
92346
|
-
return (0,
|
|
92338
|
+
return (0, import_variant42.match)(taskRunnerStatus, {
|
|
92347
92339
|
Idle: () => null,
|
|
92348
92340
|
Running: (status) => /* @__PURE__ */ import_react137.default.createElement(GenerationProgress2, { ...status }),
|
|
92349
92341
|
Done: (status) => /* @__PURE__ */ import_react137.default.createElement(Box_default, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ import_react137.default.createElement(GenerationProgress2, { ...status }), /* @__PURE__ */ import_react137.default.createElement(Box_default, { marginLeft: -2, marginTop: 1 }, /* @__PURE__ */ import_react137.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react137.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react137.default.createElement(Text2, null, "Project set up successfully"))))
|
|
@@ -92411,7 +92403,7 @@ var LinkCommand = ({
|
|
|
92411
92403
|
const packageManager2 = await createPackageManager(repoType2);
|
|
92412
92404
|
return { repoType: repoType2, packageManager: packageManager2 };
|
|
92413
92405
|
}, []);
|
|
92414
|
-
return (0,
|
|
92406
|
+
return (0, import_variant43.match)(status, {
|
|
92415
92407
|
Error: () => null,
|
|
92416
92408
|
Loading: () => /* @__PURE__ */ import_react139.default.createElement(Spinner2, { text: "Loading..." }),
|
|
92417
92409
|
Success: ({ result: { packageManager: packageManager2 } }) => {
|
|
@@ -92512,12 +92504,12 @@ var validateCloudProvider = (value2) => {
|
|
|
92512
92504
|
// ../create-new-packages/headless-command/src/components/ProcessCommand.tsx
|
|
92513
92505
|
init_esm_shims();
|
|
92514
92506
|
var import_react150 = __toESM(require_react(), 1);
|
|
92515
|
-
var
|
|
92507
|
+
var import_variant53 = __toESM(require_lib(), 1);
|
|
92516
92508
|
|
|
92517
92509
|
// ../create-new-packages/headless-command/src/parse-command-options.ts
|
|
92518
92510
|
init_esm_shims();
|
|
92519
|
-
var
|
|
92520
|
-
import { join as
|
|
92511
|
+
var import_variant45 = __toESM(require_lib(), 1);
|
|
92512
|
+
import { join as join14 } from "node:path";
|
|
92521
92513
|
|
|
92522
92514
|
// ../create-new-packages/headless-command/src/validations/index.ts
|
|
92523
92515
|
init_esm_shims();
|
|
@@ -92535,11 +92527,11 @@ async function validateDirectory2(projectRoot) {
|
|
|
92535
92527
|
// ../create-new-packages/headless-command/src/validations/package-name.ts
|
|
92536
92528
|
init_esm_shims();
|
|
92537
92529
|
var import_validate_npm_package_name2 = __toESM(require_lib2(), 1);
|
|
92538
|
-
var
|
|
92539
|
-
var Result2 = (0,
|
|
92540
|
-
(0,
|
|
92541
|
-
Error: (0,
|
|
92542
|
-
Ok:
|
|
92530
|
+
var import_variant44 = __toESM(require_lib(), 1);
|
|
92531
|
+
var Result2 = (0, import_variant44.variant)(
|
|
92532
|
+
(0, import_variant44.onTerms)(({ T }) => ({
|
|
92533
|
+
Error: (0, import_variant44.payload)(T),
|
|
92534
|
+
Ok: import_variant44.nil
|
|
92543
92535
|
}))
|
|
92544
92536
|
);
|
|
92545
92537
|
async function validatePackageName2(name) {
|
|
@@ -92609,10 +92601,10 @@ var headlessTemplates = [
|
|
|
92609
92601
|
...vibeCompatibleTemplates,
|
|
92610
92602
|
...pureHeadlessTemplates
|
|
92611
92603
|
];
|
|
92612
|
-
var TemplateSource2 = (0,
|
|
92613
|
-
HeadlessApp: (0,
|
|
92614
|
-
GitRepo: (0,
|
|
92615
|
-
Local: (0,
|
|
92604
|
+
var TemplateSource2 = (0, import_variant45.variant)({
|
|
92605
|
+
HeadlessApp: (0, import_variant45.fields)(),
|
|
92606
|
+
GitRepo: (0, import_variant45.fields)(),
|
|
92607
|
+
Local: (0, import_variant45.fields)()
|
|
92616
92608
|
});
|
|
92617
92609
|
function parseProviderString(cloudProvider) {
|
|
92618
92610
|
switch (cloudProvider.trim().toLowerCase()) {
|
|
@@ -92672,7 +92664,7 @@ async function parseTemplateOptions2(options) {
|
|
|
92672
92664
|
async function parseProjectNameOptions(targetParentFolder2, options) {
|
|
92673
92665
|
const projectName = options.projectName;
|
|
92674
92666
|
if (projectName) {
|
|
92675
|
-
if (!await validateDirectory2(
|
|
92667
|
+
if (!await validateDirectory2(join14(targetParentFolder2, projectName))) {
|
|
92676
92668
|
throw new CliError({
|
|
92677
92669
|
code: CliErrorCode.ProjectNameArgumentIsInvalid({
|
|
92678
92670
|
errorMessage: `"${projectName}" directory is not empty`
|
|
@@ -92681,7 +92673,7 @@ async function parseProjectNameOptions(targetParentFolder2, options) {
|
|
|
92681
92673
|
});
|
|
92682
92674
|
}
|
|
92683
92675
|
const npmValidationErrors = await validatePackageName2(projectName);
|
|
92684
|
-
if ((0,
|
|
92676
|
+
if ((0, import_variant45.isType)(npmValidationErrors, "Error")) {
|
|
92685
92677
|
throw new CliError({
|
|
92686
92678
|
code: CliErrorCode.ProjectNameArgumentIsInvalid({
|
|
92687
92679
|
errorMessage: `Invalid package name "${projectName}". Please fix the following issues: ${npmValidationErrors.payload.join(", ")}`
|
|
@@ -92737,20 +92729,21 @@ async function parseCommandOptions2(targetParentFolder2, options) {
|
|
|
92737
92729
|
// ../create-new-packages/headless-command/src/components/CreateHeadlessSiteCommand.tsx
|
|
92738
92730
|
init_esm_shims();
|
|
92739
92731
|
var import_react149 = __toESM(require_react(), 1);
|
|
92740
|
-
var
|
|
92741
|
-
|
|
92732
|
+
var import_variant52 = __toESM(require_lib(), 1);
|
|
92733
|
+
var import_kebabCase4 = __toESM(require_kebabCase(), 1);
|
|
92734
|
+
import { join as join19 } from "node:path";
|
|
92742
92735
|
|
|
92743
92736
|
// ../create-new-packages/headless-command/src/components/ChooseFolder.tsx
|
|
92744
92737
|
init_esm_shims();
|
|
92745
92738
|
var import_react140 = __toESM(require_react(), 1);
|
|
92746
|
-
var
|
|
92747
|
-
import { join as
|
|
92739
|
+
var import_variant46 = __toESM(require_lib(), 1);
|
|
92740
|
+
import { join as join15 } from "node:path";
|
|
92748
92741
|
var validateAppDirectory = async (targetParentFolder2, packageName) => {
|
|
92749
|
-
if (!await validateDirectory2(
|
|
92742
|
+
if (!await validateDirectory2(join15(targetParentFolder2, packageName))) {
|
|
92750
92743
|
return `Provided directory "${packageName}" is not empty`;
|
|
92751
92744
|
}
|
|
92752
92745
|
const npmValidationErrors = await validatePackageName2(packageName);
|
|
92753
|
-
return (0,
|
|
92746
|
+
return (0, import_variant46.match)(npmValidationErrors, {
|
|
92754
92747
|
Ok: () => true,
|
|
92755
92748
|
Error: ({ payload: payload7 }) => `Invalid folder name. Please fix the following issues: ${payload7.join(", ")}`
|
|
92756
92749
|
});
|
|
@@ -92776,19 +92769,19 @@ var ChooseFolder = ({ initialFolderName, targetParentFolder: targetParentFolder2
|
|
|
92776
92769
|
init_esm_shims();
|
|
92777
92770
|
import { mkdir as mkdir2 } from "node:fs/promises";
|
|
92778
92771
|
var import_react141 = __toESM(require_react(), 1);
|
|
92779
|
-
var
|
|
92780
|
-
import { join as
|
|
92772
|
+
var import_variant47 = __toESM(require_lib(), 1);
|
|
92773
|
+
import { join as join17 } from "node:path";
|
|
92781
92774
|
|
|
92782
92775
|
// ../create-new-packages/headless-command/src/services/generator/template-fetcher.ts
|
|
92783
92776
|
init_esm_shims();
|
|
92784
|
-
import { join as
|
|
92785
|
-
import { rm as
|
|
92777
|
+
import { join as join16 } from "node:path";
|
|
92778
|
+
import { rm as rm2 } from "node:fs/promises";
|
|
92786
92779
|
var import_is_git_url3 = __toESM(require_is_git_url(), 1);
|
|
92787
92780
|
async function downloadAndExtractRepo(url) {
|
|
92788
92781
|
const repoDir = temporaryDirectory({ prefix: "wix-create-headless-site" });
|
|
92789
92782
|
try {
|
|
92790
92783
|
await gitClone(url, repoDir);
|
|
92791
|
-
await
|
|
92784
|
+
await rm2(join16(repoDir, ".git"), { recursive: true, force: true });
|
|
92792
92785
|
return repoDir;
|
|
92793
92786
|
} catch (e2) {
|
|
92794
92787
|
throw new CliError({
|
|
@@ -92806,7 +92799,7 @@ async function fetchTemplate(url, path4 = ".") {
|
|
|
92806
92799
|
});
|
|
92807
92800
|
}
|
|
92808
92801
|
const repoDir = await downloadAndExtractRepo(url);
|
|
92809
|
-
const templateDirInRepo =
|
|
92802
|
+
const templateDirInRepo = join16(repoDir, path4);
|
|
92810
92803
|
if (!await pathExists(templateDirInRepo)) {
|
|
92811
92804
|
throw new CliError({
|
|
92812
92805
|
code: CliErrorCode.TemplatePathNotFound({ templatePath: path4 }),
|
|
@@ -92823,7 +92816,7 @@ async function resolveTemplateFolder(templatePathOverride, selectedTemplate) {
|
|
|
92823
92816
|
if (templatePathOverride) {
|
|
92824
92817
|
return templatePathOverride;
|
|
92825
92818
|
}
|
|
92826
|
-
return (0,
|
|
92819
|
+
return (0, import_variant47.match)(selectedTemplate, {
|
|
92827
92820
|
HeadlessApp: ({ gitPath }) => fetchTemplate(headlessTemplatesGitUrl, gitPath),
|
|
92828
92821
|
GitRepo: ({ url, path: path4 }) => fetchTemplate(url, path4),
|
|
92829
92822
|
Local: ({ path: path4 }) => path4
|
|
@@ -92833,7 +92826,6 @@ var GenerationProgress3 = ({ tasks, totalTaskCount }) => {
|
|
|
92833
92826
|
return /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, /* @__PURE__ */ import_react141.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react141.default.createElement(Text2, null, "Generating your headless site...")), /* @__PURE__ */ import_react141.default.createElement(TaskList2, { tasks, totalTaskCount }));
|
|
92834
92827
|
};
|
|
92835
92828
|
var GenerateProject2 = ({
|
|
92836
|
-
repoType: repoType2,
|
|
92837
92829
|
packageManager: packageManager2,
|
|
92838
92830
|
targetParentFolder: targetParentFolder2,
|
|
92839
92831
|
folderName,
|
|
@@ -92843,10 +92835,9 @@ var GenerateProject2 = ({
|
|
|
92843
92835
|
selectedTemplate,
|
|
92844
92836
|
onDone
|
|
92845
92837
|
}) => {
|
|
92846
|
-
const { reportError: reportError2 } = useErrorReporter();
|
|
92847
92838
|
const { execute: executeTaskRunner, status: taskRunnerStatus } = useTaskRunner2();
|
|
92848
92839
|
const packageFolder = (0, import_react141.useMemo)(
|
|
92849
|
-
() =>
|
|
92840
|
+
() => join17(targetParentFolder2, folderName),
|
|
92850
92841
|
[folderName, targetParentFolder2]
|
|
92851
92842
|
);
|
|
92852
92843
|
const generateProject = (0, import_react141.useCallback)(async () => {
|
|
@@ -92892,23 +92883,7 @@ var GenerateProject2 = ({
|
|
|
92892
92883
|
]);
|
|
92893
92884
|
const extendProject = (0, import_react141.useCallback)(async () => {
|
|
92894
92885
|
await extend2(packageFolder);
|
|
92895
|
-
|
|
92896
|
-
await addFilesFromTemplate(
|
|
92897
|
-
packageFolder,
|
|
92898
|
-
selectedTemplate.siteTemplateId,
|
|
92899
|
-
packageManager2,
|
|
92900
|
-
repoType2
|
|
92901
|
-
);
|
|
92902
|
-
} catch (error) {
|
|
92903
|
-
reportError2(error);
|
|
92904
|
-
}
|
|
92905
|
-
}, [
|
|
92906
|
-
packageFolder,
|
|
92907
|
-
selectedTemplate.siteTemplateId,
|
|
92908
|
-
reportError2,
|
|
92909
|
-
packageManager2,
|
|
92910
|
-
repoType2
|
|
92911
|
-
]);
|
|
92886
|
+
}, [packageFolder]);
|
|
92912
92887
|
const initializeGit = (0, import_react141.useCallback)(async () => {
|
|
92913
92888
|
try {
|
|
92914
92889
|
await gitInit(packageFolder);
|
|
@@ -92993,7 +92968,7 @@ var GenerateProject2 = ({
|
|
|
92993
92968
|
await executeTaskRunner(tasks);
|
|
92994
92969
|
onDone(true);
|
|
92995
92970
|
}, []);
|
|
92996
|
-
return (0,
|
|
92971
|
+
return (0, import_variant47.match)(taskRunnerStatus, {
|
|
92997
92972
|
Idle: () => null,
|
|
92998
92973
|
Running: (status) => /* @__PURE__ */ import_react141.default.createElement(GenerationProgress3, { ...status }),
|
|
92999
92974
|
Done: (status) => /* @__PURE__ */ import_react141.default.createElement(Box_default, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ import_react141.default.createElement(GenerationProgress3, { ...status }), /* @__PURE__ */ import_react141.default.createElement(Box_default, { marginLeft: -2, marginTop: 1 }, /* @__PURE__ */ import_react141.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react141.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react141.default.createElement(Text2, null, "Project set up successfully"))))
|
|
@@ -93007,7 +92982,7 @@ var ChooseTemplate2 = ({ onSubmit }) => {
|
|
|
93007
92982
|
const groups = (0, import_react142.useMemo)(
|
|
93008
92983
|
() => [
|
|
93009
92984
|
{
|
|
93010
|
-
title: "
|
|
92985
|
+
title: "Wix Vibe compatible templates",
|
|
93011
92986
|
items: vibeCompatibleTemplates.map((template) => ({
|
|
93012
92987
|
key: template.siteTemplateId,
|
|
93013
92988
|
title: template.title,
|
|
@@ -93016,7 +92991,7 @@ var ChooseTemplate2 = ({ onSubmit }) => {
|
|
|
93016
92991
|
}))
|
|
93017
92992
|
},
|
|
93018
92993
|
{
|
|
93019
|
-
title: "
|
|
92994
|
+
title: "Standard templates",
|
|
93020
92995
|
// https://dev.wix.com/docs/go-headless/get-started/templates/wix-managed-templates/wix-cli-for-headless-templates
|
|
93021
92996
|
description: /* @__PURE__ */ import_react142.default.createElement(Text2, null, "(", /* @__PURE__ */ import_react142.default.createElement(Link, { url: "https://wix.to/zuKh3Fo" }, "Learn more"), ")"),
|
|
93022
92997
|
items: pureHeadlessTemplates.map((template) => ({
|
|
@@ -93042,7 +93017,7 @@ var ChooseTemplate2 = ({ onSubmit }) => {
|
|
|
93042
93017
|
// ../create-new-packages/headless-command/src/components/ReleaseProject.tsx
|
|
93043
93018
|
init_esm_shims();
|
|
93044
93019
|
var import_react144 = __toESM(require_react(), 1);
|
|
93045
|
-
var
|
|
93020
|
+
var import_variant49 = __toESM(require_lib(), 1);
|
|
93046
93021
|
|
|
93047
93022
|
// ../create-new-packages/headless-command/src/components/FinishedSuccessfullyMessage.tsx
|
|
93048
93023
|
init_esm_shims();
|
|
@@ -93068,9 +93043,9 @@ var FinishedSuccessfullyMessage3 = ({ packageManager: packageManager2, folderNam
|
|
|
93068
93043
|
|
|
93069
93044
|
// ../create-new-packages/headless-command/src/hooks/release-project.ts
|
|
93070
93045
|
init_esm_shims();
|
|
93071
|
-
var
|
|
93072
|
-
import { join as
|
|
93073
|
-
var ReleaseStateVariant = (0,
|
|
93046
|
+
var import_variant48 = __toESM(require_lib(), 1);
|
|
93047
|
+
import { join as join18 } from "node:path";
|
|
93048
|
+
var ReleaseStateVariant = (0, import_variant48.variant)({
|
|
93074
93049
|
Success: {},
|
|
93075
93050
|
Skipped: {},
|
|
93076
93051
|
Error: {}
|
|
@@ -93086,7 +93061,7 @@ var useReleaseProject = () => {
|
|
|
93086
93061
|
if (!confirmed) {
|
|
93087
93062
|
return ReleaseStateVariant.Skipped();
|
|
93088
93063
|
}
|
|
93089
|
-
const packageFolder =
|
|
93064
|
+
const packageFolder = join18(targetParentFolder2, folderName);
|
|
93090
93065
|
try {
|
|
93091
93066
|
const buildCommand = packageManager2.getRunBinaryCmd(["wix", "build"]);
|
|
93092
93067
|
const releaseCommand = packageManager2.getRunBinaryCmd([
|
|
@@ -93142,10 +93117,10 @@ var ReleaseProject = ({
|
|
|
93142
93117
|
});
|
|
93143
93118
|
}
|
|
93144
93119
|
}
|
|
93145
|
-
)), (0,
|
|
93120
|
+
)), (0, import_variant49.match)(status, {
|
|
93146
93121
|
NotRequested: () => null,
|
|
93147
93122
|
Success: ({ result }) => {
|
|
93148
|
-
return /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, (0,
|
|
93123
|
+
return /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, (0, import_variant49.match)(result, {
|
|
93149
93124
|
Success: () => /* @__PURE__ */ import_react144.default.createElement(Box_default, { marginLeft: -2 }, /* @__PURE__ */ import_react144.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react144.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react144.default.createElement(Text2, null, "Site published successfully"))),
|
|
93150
93125
|
Skipped: () => /* @__PURE__ */ import_react144.default.createElement(Text2, null, `No worries, you can publish your site later by running ${packageManager2.getRunCmd()} release`),
|
|
93151
93126
|
Error: () => /* @__PURE__ */ import_react144.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react144.default.createElement(Alert, { type: "error" }, "Failed to publish your site"), /* @__PURE__ */ import_react144.default.createElement(Text2, null, `No worries, you can publish your site later by running ${packageManager2.getRunCmd()} release`))
|
|
@@ -93155,7 +93130,7 @@ var ReleaseProject = ({
|
|
|
93155
93130
|
packageManager: packageManager2,
|
|
93156
93131
|
folderName,
|
|
93157
93132
|
projectData,
|
|
93158
|
-
isReleased: (0,
|
|
93133
|
+
isReleased: (0, import_variant49.isType)(result, "Success")
|
|
93159
93134
|
}
|
|
93160
93135
|
));
|
|
93161
93136
|
},
|
|
@@ -93167,8 +93142,8 @@ var ReleaseProject = ({
|
|
|
93167
93142
|
// ../create-new-packages/headless-command/src/components/ChooseVibeSetup.tsx
|
|
93168
93143
|
init_esm_shims();
|
|
93169
93144
|
var import_react145 = __toESM(require_react(), 1);
|
|
93170
|
-
var
|
|
93171
|
-
var VibeSetupChoice = (0,
|
|
93145
|
+
var import_variant50 = __toESM(require_lib(), 1);
|
|
93146
|
+
var VibeSetupChoice = (0, import_variant50.variant)({
|
|
93172
93147
|
SetupVibe: {},
|
|
93173
93148
|
Skip: {}
|
|
93174
93149
|
});
|
|
@@ -93200,7 +93175,7 @@ var ChooseVibeSetup = ({ onSubmit }) => {
|
|
|
93200
93175
|
// ../create-new-packages/headless-command/src/components/VibeRepositorySetupPolling.tsx
|
|
93201
93176
|
init_esm_shims();
|
|
93202
93177
|
var import_react148 = __toESM(require_react(), 1);
|
|
93203
|
-
var
|
|
93178
|
+
var import_variant51 = __toESM(require_lib(), 1);
|
|
93204
93179
|
|
|
93205
93180
|
// ../velo-client/src/index.ts
|
|
93206
93181
|
init_esm_shims();
|
|
@@ -93713,13 +93688,13 @@ var getResolveNpmDependenciesResultSchema = external_exports.object({
|
|
|
93713
93688
|
var getWixLockFileSchema = external_exports.string();
|
|
93714
93689
|
|
|
93715
93690
|
// ../velo-client/src/velo-client.ts
|
|
93716
|
-
var { minRetryTimeout:
|
|
93691
|
+
var { minRetryTimeout: minRetryTimeout2, pollInterval, pollTimeout } = getTestOverrides();
|
|
93717
93692
|
var VeloClient = class {
|
|
93718
93693
|
constructor(httpClient) {
|
|
93719
93694
|
this.httpClient = httpClient;
|
|
93720
93695
|
this.retryOptions = {
|
|
93721
93696
|
retries: 3,
|
|
93722
|
-
minTimeout:
|
|
93697
|
+
minTimeout: minRetryTimeout2,
|
|
93723
93698
|
maxTimeout: 3 * 1e3
|
|
93724
93699
|
};
|
|
93725
93700
|
}
|
|
@@ -94055,13 +94030,13 @@ var CreateProjectResponseSchema2 = external_exports.object({
|
|
|
94055
94030
|
});
|
|
94056
94031
|
|
|
94057
94032
|
// ../codestore-client/src/codestore-client.ts
|
|
94058
|
-
var { minRetryTimeout:
|
|
94033
|
+
var { minRetryTimeout: minRetryTimeout3 } = getTestOverrides();
|
|
94059
94034
|
var CodestoreClient = class {
|
|
94060
94035
|
constructor(httpClient) {
|
|
94061
94036
|
this.httpClient = httpClient;
|
|
94062
94037
|
this.retryOptions = {
|
|
94063
94038
|
retries: 3,
|
|
94064
|
-
minTimeout:
|
|
94039
|
+
minTimeout: minRetryTimeout3,
|
|
94065
94040
|
maxTimeout: 3 * 1e3
|
|
94066
94041
|
};
|
|
94067
94042
|
}
|
|
@@ -94116,8 +94091,8 @@ function useCodestoreClient() {
|
|
|
94116
94091
|
}
|
|
94117
94092
|
|
|
94118
94093
|
// ../create-new-packages/headless-command/src/components/VibeRepositorySetupPolling.tsx
|
|
94119
|
-
var VibeSetupResult = (0,
|
|
94120
|
-
Success: (0,
|
|
94094
|
+
var VibeSetupResult = (0, import_variant51.variant)({
|
|
94095
|
+
Success: (0, import_variant51.fields)(),
|
|
94121
94096
|
Canceled: {},
|
|
94122
94097
|
Failed: {}
|
|
94123
94098
|
});
|
|
@@ -94179,7 +94154,7 @@ var VibeRepositorySetupPolling = ({
|
|
|
94179
94154
|
[projectFolder, projectId],
|
|
94180
94155
|
{
|
|
94181
94156
|
onSuccess: (result) => {
|
|
94182
|
-
if ((0,
|
|
94157
|
+
if ((0, import_variant51.isType)(result, VibeSetupResult.Success)) {
|
|
94183
94158
|
onSubmit?.();
|
|
94184
94159
|
}
|
|
94185
94160
|
},
|
|
@@ -94190,10 +94165,10 @@ var VibeRepositorySetupPolling = ({
|
|
|
94190
94165
|
}
|
|
94191
94166
|
}
|
|
94192
94167
|
);
|
|
94193
|
-
return (0,
|
|
94168
|
+
return (0, import_variant51.match)(status, {
|
|
94194
94169
|
Error: () => /* @__PURE__ */ import_react148.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react148.default.createElement(Text2, { skin: "error" }, "Failed to connect to Wix Vibe")),
|
|
94195
94170
|
Loading: () => /* @__PURE__ */ import_react148.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react148.default.createElement(Spinner2, { text: "Opening browser for Wix Vibe setup..." }), /* @__PURE__ */ import_react148.default.createElement(Text2, { skin: "secondary" }, "Complete the setup in your browser. We're waiting for you to finish...")),
|
|
94196
|
-
Success: ({ result }) => (0,
|
|
94171
|
+
Success: ({ result }) => (0, import_variant51.match)(result, {
|
|
94197
94172
|
Success: ({ repoName, htmlUrl }) => /* @__PURE__ */ import_react148.default.createElement(Box_default, { marginLeft: -2, marginBottom: 1 }, /* @__PURE__ */ import_react148.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react148.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react148.default.createElement(Text2, null, "GitHub repository '", repoName, "' created and Synced.", " ", /* @__PURE__ */ import_react148.default.createElement(Link, { url: htmlUrl }, "View Repository.")))),
|
|
94198
94173
|
Canceled: () => null
|
|
94199
94174
|
})
|
|
@@ -94223,22 +94198,22 @@ var CreateHeadlessSiteCommand = ({
|
|
|
94223
94198
|
const [vibeSetupChoice, setVibeSetupChoice] = (0, import_react149.useState)();
|
|
94224
94199
|
const [vibeSetupDone, setVibeSetupDone] = (0, import_react149.useState)(false);
|
|
94225
94200
|
const projectFolder = (0, import_react149.useMemo)(
|
|
94226
|
-
() => folderName ?
|
|
94201
|
+
() => folderName ? join19(targetParentFolder2, folderName) : void 0,
|
|
94227
94202
|
[targetParentFolder2, folderName]
|
|
94228
94203
|
);
|
|
94229
94204
|
const { status } = useAsync2(async () => {
|
|
94230
94205
|
const repoType2 = await getRepoType(targetParentFolder2);
|
|
94231
94206
|
const packageManager2 = await createPackageManager(repoType2);
|
|
94232
|
-
return {
|
|
94207
|
+
return { packageManager: packageManager2 };
|
|
94233
94208
|
}, []);
|
|
94234
94209
|
const isVibeCompatible = (0, import_react149.useMemo)(
|
|
94235
|
-
() => (0,
|
|
94210
|
+
() => (0, import_variant52.isType)(selectedTemplate, "HeadlessApp") && selectedTemplate.vibeCompatible,
|
|
94236
94211
|
[selectedTemplate]
|
|
94237
94212
|
);
|
|
94238
|
-
return (0,
|
|
94213
|
+
return (0, import_variant52.match)(status, {
|
|
94239
94214
|
Error: () => null,
|
|
94240
94215
|
Loading: () => /* @__PURE__ */ import_react149.default.createElement(Spinner2, { text: "Loading..." }),
|
|
94241
|
-
Success: ({ result: { packageManager: packageManager2
|
|
94216
|
+
Success: ({ result: { packageManager: packageManager2 } }) => {
|
|
94242
94217
|
return /* @__PURE__ */ import_react149.default.createElement(
|
|
94243
94218
|
Box_default,
|
|
94244
94219
|
{
|
|
@@ -94276,7 +94251,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
94276
94251
|
!defaultProjectName && businessName && selectedTemplate && businessId && /* @__PURE__ */ import_react149.default.createElement(
|
|
94277
94252
|
ChooseFolder,
|
|
94278
94253
|
{
|
|
94279
|
-
initialFolderName: businessName,
|
|
94254
|
+
initialFolderName: (0, import_kebabCase4.default)(businessName),
|
|
94280
94255
|
targetParentFolder: targetParentFolder2,
|
|
94281
94256
|
onSubmit: ({ folderName: folderName2 }) => setFolderName(folderName2)
|
|
94282
94257
|
}
|
|
@@ -94285,7 +94260,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
94285
94260
|
CreateProject,
|
|
94286
94261
|
{
|
|
94287
94262
|
businessId,
|
|
94288
|
-
projectName:
|
|
94263
|
+
projectName: businessName,
|
|
94289
94264
|
cloudProviders,
|
|
94290
94265
|
onSubmit: (data) => setProjectData(data)
|
|
94291
94266
|
}
|
|
@@ -94296,7 +94271,6 @@ var CreateHeadlessSiteCommand = ({
|
|
|
94296
94271
|
folderName,
|
|
94297
94272
|
businessId,
|
|
94298
94273
|
projectData,
|
|
94299
|
-
repoType: repoType2,
|
|
94300
94274
|
packageManager: packageManager2,
|
|
94301
94275
|
targetParentFolder: targetParentFolder2,
|
|
94302
94276
|
commandOptions,
|
|
@@ -94310,7 +94284,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
94310
94284
|
onSubmit: (choice) => setVibeSetupChoice(choice)
|
|
94311
94285
|
}
|
|
94312
94286
|
),
|
|
94313
|
-
businessName && selectedTemplate && businessId && projectData && projectFolder && generationDone && isVibeCompatible && (0,
|
|
94287
|
+
businessName && selectedTemplate && businessId && projectData && projectFolder && generationDone && isVibeCompatible && (0, import_variant52.isType)(vibeSetupChoice, "SetupVibe") && /* @__PURE__ */ import_react149.default.createElement(AccountAuthProvider, null, /* @__PURE__ */ import_react149.default.createElement(
|
|
94314
94288
|
VibeRepositorySetupPolling,
|
|
94315
94289
|
{
|
|
94316
94290
|
projectId: projectData.projectId,
|
|
@@ -94318,7 +94292,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
94318
94292
|
onSubmit: () => setVibeSetupDone(true)
|
|
94319
94293
|
}
|
|
94320
94294
|
)),
|
|
94321
|
-
businessName && selectedTemplate && businessId && projectData && folderName && generationDone && (vibeSetupDone || (0,
|
|
94295
|
+
businessName && selectedTemplate && businessId && projectData && folderName && generationDone && (vibeSetupDone || (0, import_variant52.isType)(vibeSetupChoice, "Skip") || !isVibeCompatible) && /* @__PURE__ */ import_react149.default.createElement(
|
|
94322
94296
|
ReleaseProject,
|
|
94323
94297
|
{
|
|
94324
94298
|
folderName,
|
|
@@ -94356,7 +94330,7 @@ var ProcessCommand = ({ targetParentFolder: targetParentFolder2, commandOptions
|
|
|
94356
94330
|
}
|
|
94357
94331
|
return result;
|
|
94358
94332
|
}, []);
|
|
94359
|
-
return (0,
|
|
94333
|
+
return (0, import_variant53.match)(status, {
|
|
94360
94334
|
Error: () => null,
|
|
94361
94335
|
Loading: () => /* @__PURE__ */ import_react150.default.createElement(Spinner2, { text: "Loading..." }),
|
|
94362
94336
|
Success: ({
|
|
@@ -94383,12 +94357,12 @@ init_esm_shims();
|
|
|
94383
94357
|
|
|
94384
94358
|
// ../create-new-packages/headless-command/src/bi/createBiLogger.ts
|
|
94385
94359
|
init_esm_shims();
|
|
94386
|
-
import { randomUUID as
|
|
94360
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
94387
94361
|
var createBiLogger3 = async (errorReporter2, cliVersion, userId) => {
|
|
94388
94362
|
const biLogger = await createBiLogger(
|
|
94389
94363
|
{
|
|
94390
94364
|
command: "create-headless-site",
|
|
94391
|
-
cliSessionId:
|
|
94365
|
+
cliSessionId: randomUUID3(),
|
|
94392
94366
|
cliVersion
|
|
94393
94367
|
},
|
|
94394
94368
|
userId
|
|
@@ -94566,7 +94540,7 @@ var getHeadlessCommand = ({
|
|
|
94566
94540
|
var package_default = {
|
|
94567
94541
|
name: "@wix/create-new",
|
|
94568
94542
|
description: "General entry point for creating Wix projects",
|
|
94569
|
-
version: "0.0.
|
|
94543
|
+
version: "0.0.31",
|
|
94570
94544
|
bin: "bin/index.cjs",
|
|
94571
94545
|
devDependencies: {
|
|
94572
94546
|
"@commander-js/extra-typings": "^13.0.0",
|