@wix/create-new 0.0.68 → 0.0.69

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 CHANGED
@@ -81834,23 +81834,17 @@ function getTasks({
81834
81834
  }
81835
81835
  };
81836
81836
  const addWixSkills = async () => {
81837
- const args = [
81838
- "--yes",
81839
- "skills",
81840
- "add",
81841
- "wix/skills",
81842
- // The `skills` CLI uses -y/--yes to skip prompts.
81843
- "-y"
81844
- ];
81837
+ const file = packageManager2.getRunCmd();
81838
+ const args = ["wix", "skills", "add"];
81845
81839
  try {
81846
- await runCommand(`npx ${args.join(" ")}`, {
81840
+ await runCommand(`${file} ${args.join(" ")}`, {
81847
81841
  cwd: packageFolder
81848
81842
  });
81849
81843
  } catch (e2) {
81850
81844
  throw new CliError({
81851
81845
  code: CliErrorCode.FailedToRunExternalCommand({
81852
- file: "npx",
81853
- args: [...args]
81846
+ file,
81847
+ args
81854
81848
  }),
81855
81849
  cause: e2
81856
81850
  });
@@ -91995,6 +91989,7 @@ async function validatePackageName2(name) {
91995
91989
  }
91996
91990
 
91997
91991
  // ../create-new-packages/headless-command/src/parse-command-options.ts
91992
+ var DEFAULT_HEADLESS_TEMPLATE_NAME = "blank";
91998
91993
  var pureHeadlessTemplates = [
91999
91994
  {
92000
91995
  name: "commerce",
@@ -92062,33 +92057,32 @@ function parseCloudProviders(cloudProvider) {
92062
92057
  return [parseProviderString(cloudProvider)];
92063
92058
  }
92064
92059
  async function parseTemplateOptions2(options) {
92065
- if (options.siteTemplate) {
92066
- const appTemplate = headlessTemplates.find(
92067
- (item) => item.name === options.siteTemplate
92068
- );
92069
- if (!appTemplate) {
92070
- throw new CliError({
92071
- code: CliErrorCode.CliAppTemplateNotFound({
92072
- id: options.siteTemplate
92073
- }),
92074
- cause: null
92075
- });
92076
- }
92077
- if (options.templateRepo && options.templateRepoPath) {
92078
- return TemplateSource2.GitRepo({
92079
- siteTemplateId: appTemplate.siteTemplateId,
92080
- url: options.templateRepo,
92081
- path: options.templateRepoPath
92082
- });
92083
- }
92084
- if (options.templatePath) {
92085
- return TemplateSource2.Local({
92086
- siteTemplateId: appTemplate.siteTemplateId,
92087
- path: options.templatePath
92088
- });
92089
- }
92090
- return TemplateSource2.HeadlessApp(appTemplate);
92060
+ const siteTemplate = options.siteTemplate ?? DEFAULT_HEADLESS_TEMPLATE_NAME;
92061
+ const appTemplate = headlessTemplates.find(
92062
+ (item) => item.name === siteTemplate
92063
+ );
92064
+ if (!appTemplate) {
92065
+ throw new CliError({
92066
+ code: CliErrorCode.CliAppTemplateNotFound({
92067
+ id: siteTemplate
92068
+ }),
92069
+ cause: null
92070
+ });
92071
+ }
92072
+ if (options.templateRepo && options.templateRepoPath) {
92073
+ return TemplateSource2.GitRepo({
92074
+ siteTemplateId: appTemplate.siteTemplateId,
92075
+ url: options.templateRepo,
92076
+ path: options.templateRepoPath
92077
+ });
92091
92078
  }
92079
+ if (options.templatePath) {
92080
+ return TemplateSource2.Local({
92081
+ siteTemplateId: appTemplate.siteTemplateId,
92082
+ path: options.templatePath
92083
+ });
92084
+ }
92085
+ return TemplateSource2.HeadlessApp(appTemplate);
92092
92086
  }
92093
92087
  async function parseProjectNameOptions(targetParentFolder2, options) {
92094
92088
  const projectName = options.projectName;
@@ -92138,14 +92132,6 @@ async function parseCommandOptions2(targetParentFolder2, options) {
92138
92132
  businessName: options.businessName,
92139
92133
  publish: options.publish
92140
92134
  });
92141
- if (projectName && !template) {
92142
- throw new CliError({
92143
- code: CliErrorCode.ProjectNameArgumentIsInvalid({
92144
- errorMessage: "A project name was provided, but no template was specified. Specify a template when defining the project name."
92145
- }),
92146
- cause: void 0
92147
- });
92148
- }
92149
92135
  return {
92150
92136
  template,
92151
92137
  projectName,
@@ -94110,7 +94096,7 @@ var getHeadlessCommand = ({
94110
94096
  new Option(
94111
94097
  "--site-template <site-template>",
94112
94098
  "Site template to use for the app creation"
94113
- ).choices(pureHeadlessTemplates.map((template) => template.name)).argParser(validateSiteTemplate)
94099
+ ).choices(pureHeadlessTemplates.map((template) => template.name)).argParser(validateSiteTemplate).default(DEFAULT_HEADLESS_TEMPLATE_NAME)
94114
94100
  ).addOption(
94115
94101
  new Option(
94116
94102
  "--template-repo <template-repo>",
@@ -94201,7 +94187,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
94201
94187
  var package_default = {
94202
94188
  name: "@wix/create-new",
94203
94189
  description: "General entry point for creating Wix projects",
94204
- version: "0.0.68",
94190
+ version: "0.0.69",
94205
94191
  bin: "bin/index.cjs",
94206
94192
  devDependencies: {
94207
94193
  "@commander-js/extra-typings": "^13.0.0",