@wix/create-new 0.0.49 → 0.0.50
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 +83 -73
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -81245,15 +81245,13 @@ async function parseAppNameOptions(targetParentFolder2, options) {
|
|
|
81245
81245
|
return AppNameOptions.Missing();
|
|
81246
81246
|
}
|
|
81247
81247
|
async function parseCommandOptions(targetParentFolder2, options, clients) {
|
|
81248
|
-
|
|
81248
|
+
let template = await parseTemplateOptions(
|
|
81249
|
+
options,
|
|
81250
|
+
clients
|
|
81251
|
+
);
|
|
81249
81252
|
const appNameOptions = await parseAppNameOptions(targetParentFolder2, options);
|
|
81250
|
-
if ((0, import_variant28.isType)(appNameOptions, "Provided")
|
|
81251
|
-
|
|
81252
|
-
code: CliErrorCode.AppNameArgumentIsInvalid({
|
|
81253
|
-
errorMessage: "An application name was provided, but no template was specified. Please specify a template when defining the application name."
|
|
81254
|
-
}),
|
|
81255
|
-
cause: void 0
|
|
81256
|
-
});
|
|
81253
|
+
if (!template && (0, import_variant28.isType)(appNameOptions, "Provided")) {
|
|
81254
|
+
template = TemplateSource.Default();
|
|
81257
81255
|
}
|
|
81258
81256
|
return { template, appName: appNameOptions };
|
|
81259
81257
|
}
|
|
@@ -93993,54 +93991,8 @@ var LinkCommand = ({
|
|
|
93993
93991
|
});
|
|
93994
93992
|
};
|
|
93995
93993
|
|
|
93996
|
-
// ../create-new-packages/headless-command/src/validations/
|
|
93994
|
+
// ../create-new-packages/headless-command/src/validations/site-template.ts
|
|
93997
93995
|
init_esm_shims();
|
|
93998
|
-
function validateUUID2(value2) {
|
|
93999
|
-
const parsed = external_exports.string().uuid().safeParse(value2);
|
|
94000
|
-
if (parsed.success) {
|
|
94001
|
-
return parsed.data;
|
|
94002
|
-
}
|
|
94003
|
-
throw new InvalidArgumentError("Value must be a valid GUID");
|
|
94004
|
-
}
|
|
94005
|
-
|
|
94006
|
-
// ../create-new-packages/headless-command/src/validations/git-url.ts
|
|
94007
|
-
init_esm_shims();
|
|
94008
|
-
var import_is_git_url2 = __toESM(require_is_git_url(), 1);
|
|
94009
|
-
function validateGitUrl2(value2) {
|
|
94010
|
-
if ((0, import_is_git_url2.default)(value2)) {
|
|
94011
|
-
return value2;
|
|
94012
|
-
}
|
|
94013
|
-
throw new InvalidArgumentError("Value must be a valid Git URL");
|
|
94014
|
-
}
|
|
94015
|
-
|
|
94016
|
-
// ../create-new-packages/headless-command/src/validations/validate-template-params.ts
|
|
94017
|
-
init_esm_shims();
|
|
94018
|
-
var schema4 = external_exports.string().transform((value2) => JSON.parse(value2)).pipe(external_exports.record(external_exports.unknown()));
|
|
94019
|
-
function validateTemplateParams2(value2) {
|
|
94020
|
-
try {
|
|
94021
|
-
return schema4.parse(value2);
|
|
94022
|
-
} catch {
|
|
94023
|
-
throw new InvalidArgumentError("Value must be a valid JSON object string.");
|
|
94024
|
-
}
|
|
94025
|
-
}
|
|
94026
|
-
|
|
94027
|
-
// ../create-new-packages/headless-command/src/validations/validate-cloud-provider.ts
|
|
94028
|
-
init_esm_shims();
|
|
94029
|
-
var validateCloudProvider = (value2) => {
|
|
94030
|
-
const allowedValues = ["cloudflare", "kubernetes"];
|
|
94031
|
-
const normalizedValue = value2.toLowerCase();
|
|
94032
|
-
if (!allowedValues.includes(normalizedValue)) {
|
|
94033
|
-
throw new Error(
|
|
94034
|
-
`Invalid cloud provider: ${value2}. Allowed values are: ${allowedValues.join(", ")}`
|
|
94035
|
-
);
|
|
94036
|
-
}
|
|
94037
|
-
return normalizedValue;
|
|
94038
|
-
};
|
|
94039
|
-
|
|
94040
|
-
// ../create-new-packages/headless-command/src/components/ProcessCommand.tsx
|
|
94041
|
-
init_esm_shims();
|
|
94042
|
-
var import_react155 = __toESM(require_react(), 1);
|
|
94043
|
-
var import_variant60 = __toESM(require_lib(), 1);
|
|
94044
93996
|
|
|
94045
93997
|
// ../create-new-packages/headless-command/src/parse-command-options.ts
|
|
94046
93998
|
init_esm_shims();
|
|
@@ -94082,6 +94034,7 @@ async function validatePackageName2(name) {
|
|
|
94082
94034
|
// ../create-new-packages/headless-command/src/parse-command-options.ts
|
|
94083
94035
|
var pureHeadlessTemplates = [
|
|
94084
94036
|
{
|
|
94037
|
+
name: "commerce",
|
|
94085
94038
|
title: "Commerce (Wix Stores)",
|
|
94086
94039
|
subtitle: "Product catalog, checkout, and more",
|
|
94087
94040
|
siteTemplateId: "e5da13f4-c01e-4b61-a9c7-55dacd961d54",
|
|
@@ -94089,6 +94042,7 @@ var pureHeadlessTemplates = [
|
|
|
94089
94042
|
vibeCompatible: false
|
|
94090
94043
|
},
|
|
94091
94044
|
{
|
|
94045
|
+
name: "scheduler",
|
|
94092
94046
|
title: "Scheduler (Wix Bookings)",
|
|
94093
94047
|
subtitle: "Appointment booking and calendar",
|
|
94094
94048
|
siteTemplateId: "72ade0e3-1871-4c04-ac54-419ca874d9d3",
|
|
@@ -94096,6 +94050,7 @@ var pureHeadlessTemplates = [
|
|
|
94096
94050
|
vibeCompatible: false
|
|
94097
94051
|
},
|
|
94098
94052
|
{
|
|
94053
|
+
name: "registration",
|
|
94099
94054
|
title: "Registration (Wix Forms)",
|
|
94100
94055
|
subtitle: "Inputs, dropdowns and field validations",
|
|
94101
94056
|
siteTemplateId: "e5d63bf1-cd06-48eb-ad77-0da9235adcf1",
|
|
@@ -94103,6 +94058,7 @@ var pureHeadlessTemplates = [
|
|
|
94103
94058
|
vibeCompatible: false
|
|
94104
94059
|
},
|
|
94105
94060
|
{
|
|
94061
|
+
name: "blank",
|
|
94106
94062
|
title: "Blank",
|
|
94107
94063
|
subtitle: "Basic Astro project",
|
|
94108
94064
|
siteTemplateId: "212b41cb-0da6-4401-9c72-7c579e6477a2",
|
|
@@ -94143,31 +94099,31 @@ function parseCloudProviders(cloudProvider) {
|
|
|
94143
94099
|
return [parseProviderString(cloudProvider)];
|
|
94144
94100
|
}
|
|
94145
94101
|
async function parseTemplateOptions2(options) {
|
|
94146
|
-
if (options.
|
|
94102
|
+
if (options.siteTemplate) {
|
|
94103
|
+
const appTemplate = headlessTemplates.find(
|
|
94104
|
+
(item) => item.name === options.siteTemplate
|
|
94105
|
+
);
|
|
94106
|
+
if (!appTemplate) {
|
|
94107
|
+
throw new CliError({
|
|
94108
|
+
code: CliErrorCode.CliAppTemplateNotFound({
|
|
94109
|
+
id: options.siteTemplate
|
|
94110
|
+
}),
|
|
94111
|
+
cause: null
|
|
94112
|
+
});
|
|
94113
|
+
}
|
|
94147
94114
|
if (options.templateRepo && options.templateRepoPath) {
|
|
94148
94115
|
return TemplateSource2.GitRepo({
|
|
94149
|
-
siteTemplateId:
|
|
94116
|
+
siteTemplateId: appTemplate.siteTemplateId,
|
|
94150
94117
|
url: options.templateRepo,
|
|
94151
94118
|
path: options.templateRepoPath
|
|
94152
94119
|
});
|
|
94153
94120
|
}
|
|
94154
94121
|
if (options.templatePath) {
|
|
94155
94122
|
return TemplateSource2.Local({
|
|
94156
|
-
siteTemplateId:
|
|
94123
|
+
siteTemplateId: appTemplate.siteTemplateId,
|
|
94157
94124
|
path: options.templatePath
|
|
94158
94125
|
});
|
|
94159
94126
|
}
|
|
94160
|
-
const appTemplate = headlessTemplates.find(
|
|
94161
|
-
(item) => item.siteTemplateId === options.siteTemplateId
|
|
94162
|
-
);
|
|
94163
|
-
if (!appTemplate) {
|
|
94164
|
-
throw new CliError({
|
|
94165
|
-
code: CliErrorCode.CliAppTemplateNotFound({
|
|
94166
|
-
id: options.siteTemplateId
|
|
94167
|
-
}),
|
|
94168
|
-
cause: null
|
|
94169
|
-
});
|
|
94170
|
-
}
|
|
94171
94127
|
return TemplateSource2.HeadlessApp(appTemplate);
|
|
94172
94128
|
}
|
|
94173
94129
|
}
|
|
@@ -94236,6 +94192,60 @@ async function parseCommandOptions2(targetParentFolder2, options) {
|
|
|
94236
94192
|
};
|
|
94237
94193
|
}
|
|
94238
94194
|
|
|
94195
|
+
// ../create-new-packages/headless-command/src/validations/site-template.ts
|
|
94196
|
+
function validateSiteTemplate(value2) {
|
|
94197
|
+
const normalized = value2.trim().toLowerCase();
|
|
94198
|
+
const match37 = pureHeadlessTemplates.find(
|
|
94199
|
+
(template) => template.name === normalized
|
|
94200
|
+
);
|
|
94201
|
+
if (!match37) {
|
|
94202
|
+
const available = pureHeadlessTemplates.map((template) => template.name).join(", ");
|
|
94203
|
+
throw new InvalidArgumentError(
|
|
94204
|
+
`Unknown template "${value2}". Available templates: ${available}`
|
|
94205
|
+
);
|
|
94206
|
+
}
|
|
94207
|
+
return match37.name;
|
|
94208
|
+
}
|
|
94209
|
+
|
|
94210
|
+
// ../create-new-packages/headless-command/src/validations/git-url.ts
|
|
94211
|
+
init_esm_shims();
|
|
94212
|
+
var import_is_git_url2 = __toESM(require_is_git_url(), 1);
|
|
94213
|
+
function validateGitUrl2(value2) {
|
|
94214
|
+
if ((0, import_is_git_url2.default)(value2)) {
|
|
94215
|
+
return value2;
|
|
94216
|
+
}
|
|
94217
|
+
throw new InvalidArgumentError("Value must be a valid Git URL");
|
|
94218
|
+
}
|
|
94219
|
+
|
|
94220
|
+
// ../create-new-packages/headless-command/src/validations/validate-template-params.ts
|
|
94221
|
+
init_esm_shims();
|
|
94222
|
+
var schema4 = external_exports.string().transform((value2) => JSON.parse(value2)).pipe(external_exports.record(external_exports.unknown()));
|
|
94223
|
+
function validateTemplateParams2(value2) {
|
|
94224
|
+
try {
|
|
94225
|
+
return schema4.parse(value2);
|
|
94226
|
+
} catch {
|
|
94227
|
+
throw new InvalidArgumentError("Value must be a valid JSON object string.");
|
|
94228
|
+
}
|
|
94229
|
+
}
|
|
94230
|
+
|
|
94231
|
+
// ../create-new-packages/headless-command/src/validations/validate-cloud-provider.ts
|
|
94232
|
+
init_esm_shims();
|
|
94233
|
+
var validateCloudProvider = (value2) => {
|
|
94234
|
+
const allowedValues = ["cloudflare", "kubernetes"];
|
|
94235
|
+
const normalizedValue = value2.toLowerCase();
|
|
94236
|
+
if (!allowedValues.includes(normalizedValue)) {
|
|
94237
|
+
throw new Error(
|
|
94238
|
+
`Invalid cloud provider: ${value2}. Allowed values are: ${allowedValues.join(", ")}`
|
|
94239
|
+
);
|
|
94240
|
+
}
|
|
94241
|
+
return normalizedValue;
|
|
94242
|
+
};
|
|
94243
|
+
|
|
94244
|
+
// ../create-new-packages/headless-command/src/components/ProcessCommand.tsx
|
|
94245
|
+
init_esm_shims();
|
|
94246
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
94247
|
+
var import_variant60 = __toESM(require_lib(), 1);
|
|
94248
|
+
|
|
94239
94249
|
// ../create-new-packages/headless-command/src/components/CreateHeadlessSiteCommand.tsx
|
|
94240
94250
|
init_esm_shims();
|
|
94241
94251
|
var import_react154 = __toESM(require_react(), 1);
|
|
@@ -95982,9 +95992,9 @@ var getHeadlessCommand = ({
|
|
|
95982
95992
|
)
|
|
95983
95993
|
).addOption(
|
|
95984
95994
|
new Option(
|
|
95985
|
-
"--site-template
|
|
95986
|
-
"Site
|
|
95987
|
-
).argParser(
|
|
95995
|
+
"--site-template <site-template>",
|
|
95996
|
+
"Site template to use for the app creation"
|
|
95997
|
+
).choices(pureHeadlessTemplates.map((template) => template.name)).argParser(validateSiteTemplate)
|
|
95988
95998
|
).addOption(
|
|
95989
95999
|
new Option(
|
|
95990
96000
|
"--template-repo <template-repo>",
|
|
@@ -96070,7 +96080,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
|
|
|
96070
96080
|
var package_default = {
|
|
96071
96081
|
name: "@wix/create-new",
|
|
96072
96082
|
description: "General entry point for creating Wix projects",
|
|
96073
|
-
version: "0.0.
|
|
96083
|
+
version: "0.0.50",
|
|
96074
96084
|
bin: "bin/index.cjs",
|
|
96075
96085
|
devDependencies: {
|
|
96076
96086
|
"@commander-js/extra-typings": "^13.0.0",
|