@wix/create-app 0.0.98 → 0.0.100

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
@@ -40895,8 +40895,8 @@ var require_graceful_fs = __commonJS({
40895
40895
  }
40896
40896
  var fs$copyFile = fs12.copyFile;
40897
40897
  if (fs$copyFile)
40898
- fs12.copyFile = copyFile;
40899
- function copyFile(src, dest, flags, cb) {
40898
+ fs12.copyFile = copyFile2;
40899
+ function copyFile2(src, dest, flags, cb) {
40900
40900
  if (typeof flags === "function") {
40901
40901
  cb = flags;
40902
40902
  flags = 0;
@@ -41675,11 +41675,11 @@ var require_util3 = __commonJS({
41675
41675
  if (files.includes("node_modules") || files.includes("package.json") || files.includes("package.json5") || files.includes("package.yaml") || files.includes("pnpm-workspace.yaml")) {
41676
41676
  return name2;
41677
41677
  }
41678
- const dirname5 = path8.dirname(name2);
41679
- if (dirname5 === name2) {
41678
+ const dirname6 = path8.dirname(name2);
41679
+ if (dirname6 === name2) {
41680
41680
  return original;
41681
41681
  }
41682
- return find(dirname5, original);
41682
+ return find(dirname6, original);
41683
41683
  } catch (error) {
41684
41684
  if (name2 === original) {
41685
41685
  if (error.code === "ENOENT") {
@@ -43120,11 +43120,11 @@ var require_ejs = __commonJS({
43120
43120
  exports.localsName = _DEFAULT_LOCALS_NAME;
43121
43121
  exports.promiseImpl = new Function("return this;")().Promise;
43122
43122
  exports.resolveInclude = function(name, filename, isDir) {
43123
- var dirname5 = path8.dirname;
43124
- var extname = path8.extname;
43123
+ var dirname6 = path8.dirname;
43124
+ var extname2 = path8.extname;
43125
43125
  var resolve5 = path8.resolve;
43126
- var includePath = resolve5(isDir ? filename : dirname5(filename), name);
43127
- var ext = extname(name);
43126
+ var includePath = resolve5(isDir ? filename : dirname6(filename), name);
43127
+ var ext = extname2(name);
43128
43128
  if (!ext) {
43129
43129
  includePath += ".ejs";
43130
43130
  }
@@ -56748,16 +56748,32 @@ ZodReadonly.create = (type, params) => {
56748
56748
  ...processCreateParams(params)
56749
56749
  });
56750
56750
  };
56751
- function custom(check, params = {}, fatal) {
56751
+ function cleanParams(params, data) {
56752
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
56753
+ const p2 = typeof p === "string" ? { message: p } : p;
56754
+ return p2;
56755
+ }
56756
+ function custom(check, _params = {}, fatal) {
56752
56757
  if (check)
56753
56758
  return ZodAny.create().superRefine((data, ctx) => {
56754
56759
  var _a3, _b;
56755
- if (!check(data)) {
56756
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
56757
- const _fatal = (_b = (_a3 = p.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b !== void 0 ? _b : true;
56758
- const p2 = typeof p === "string" ? { message: p } : p;
56759
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
56760
+ const r2 = check(data);
56761
+ if (r2 instanceof Promise) {
56762
+ return r2.then((r3) => {
56763
+ var _a4, _b2;
56764
+ if (!r3) {
56765
+ const params = cleanParams(_params, data);
56766
+ const _fatal = (_b2 = (_a4 = params.fatal) !== null && _a4 !== void 0 ? _a4 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
56767
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
56768
+ }
56769
+ });
56760
56770
  }
56771
+ if (!r2) {
56772
+ const params = cleanParams(_params, data);
56773
+ const _fatal = (_b = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b !== void 0 ? _b : true;
56774
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
56775
+ }
56776
+ return;
56761
56777
  });
56762
56778
  return ZodAny.create();
56763
56779
  }
@@ -57147,7 +57163,11 @@ var CliSystemErrorCode = (0, import_variant11.variant)({
57147
57163
  EditorPendingInstallationCheckTimedout: {},
57148
57164
  FailedToParseLatestVersion: (0, import_variant11.fields)(),
57149
57165
  FailedToGetMonitoringLoaderScript: (0, import_variant11.fields)(),
57150
- FailedToFetchWixLockFile: {}
57166
+ FailedToFetchWixLockFile: {},
57167
+ FailedToGetSdkSlotData: {},
57168
+ FailedToListComponentByComponentType: {},
57169
+ FailedToParseBackofficeExtensionContainer: {},
57170
+ FailedToParseBackofficePages: {}
57151
57171
  });
57152
57172
  var CliUserErrorCode = (0, import_variant11.variant)({
57153
57173
  LatestVersionOfCreateAppRequired: (0, import_variant11.fields)(),
@@ -57245,7 +57265,8 @@ var CliUserErrorCode = (0, import_variant11.variant)({
57245
57265
  FailedToUpdateIntellisenseAdapterTypes: {},
57246
57266
  WebMethodOutsideOfProjectDirectory: (0, import_variant11.fields)(),
57247
57267
  FailedToEvalBackendExtension: (0, import_variant11.fields)(),
57248
- DeploymentPipelineFailed: (0, import_variant11.fields)()
57268
+ DeploymentPipelineFailed: (0, import_variant11.fields)(),
57269
+ InsufficientNonInterractiveReleaseParameters: {}
57249
57270
  });
57250
57271
  var CliErrorCode = (0, import_variant11.variant)({
57251
57272
  ...CliSystemErrorCode,
@@ -59607,7 +59628,9 @@ var fixComponentProps = (component, index, translation) => {
59607
59628
  function Componentized() {
59608
59629
  return (0, import_react64.createElement)(import_react64.Fragment, null, comp);
59609
59630
  }
59610
- return (0, import_react64.createElement)(Componentized);
59631
+ return (0, import_react64.createElement)(Componentized, {
59632
+ key: componentKey
59633
+ });
59611
59634
  };
59612
59635
  var generateArrayComponents = (components, translation) => components.map((c2, index) => fixComponentProps(c2, index, translation));
59613
59636
  var generateObjectComponents = (components, translation) => {
@@ -67170,7 +67193,7 @@ function getErrorComponent(code, cause) {
67170
67193
  return () => /* @__PURE__ */ import_react77.default.createElement(ErrorMessage, { message: "You used invalid API key to log in." });
67171
67194
  },
67172
67195
  SiteConfiguredRequired: () => {
67173
- return () => /* @__PURE__ */ import_react77.default.createElement(ErrorMessage, { message: "You must configure the development site before running this command, or provide a site-id in the command options." });
67196
+ return () => /* @__PURE__ */ import_react77.default.createElement(ErrorMessage, { message: "You must provide a `--site` in the command options." });
67174
67197
  },
67175
67198
  FailedAddingPackageToWorkspace: () => {
67176
67199
  return () => /* @__PURE__ */ import_react77.default.createElement(
@@ -67608,6 +67631,33 @@ function getErrorComponent(code, cause) {
67608
67631
  }
67609
67632
  );
67610
67633
  },
67634
+ FailedToGetSdkSlotData: () => {
67635
+ return () => /* @__PURE__ */ import_react77.default.createElement(
67636
+ SystemErrorMessage,
67637
+ {
67638
+ message: `Unable to retrieve slot details to extend`
67639
+ }
67640
+ );
67641
+ },
67642
+ FailedToListComponentByComponentType: () => {
67643
+ return () => /* @__PURE__ */ import_react77.default.createElement(
67644
+ SystemErrorMessage,
67645
+ {
67646
+ message: `Unable to retrieve the list of available extensions for your application`
67647
+ }
67648
+ );
67649
+ },
67650
+ FailedToParseBackofficeExtensionContainer: () => {
67651
+ return () => /* @__PURE__ */ import_react77.default.createElement(
67652
+ SystemErrorMessage,
67653
+ {
67654
+ message: `Failed to parse backoffice extension containers data`
67655
+ }
67656
+ );
67657
+ },
67658
+ FailedToParseBackofficePages: () => {
67659
+ return () => /* @__PURE__ */ import_react77.default.createElement(SystemErrorMessage, { message: `Failed to parse backoffice pages data` });
67660
+ },
67611
67661
  FailedToDeployDocument: () => {
67612
67662
  return () => /* @__PURE__ */ import_react77.default.createElement(SystemErrorMessage, { message: "Failed to deploy site document." });
67613
67663
  },
@@ -67628,6 +67678,14 @@ ${errorMessage}`
67628
67678
  }
67629
67679
  );
67630
67680
  },
67681
+ InsufficientNonInterractiveReleaseParameters: () => {
67682
+ return () => /* @__PURE__ */ import_react77.default.createElement(
67683
+ ErrorMessage,
67684
+ {
67685
+ message: `Release command in non-interactive mode requires following parameters: --comment, --version-type, --approve-minor`
67686
+ }
67687
+ );
67688
+ },
67631
67689
  DeploymentPipelineFailed: ({ tasksDescriptions }) => {
67632
67690
  return () => /* @__PURE__ */ import_react77.default.createElement(import_react77.default.Fragment, null, /* @__PURE__ */ import_react77.default.createElement(
67633
67691
  ErrorMessage,
@@ -71146,7 +71204,7 @@ function reportCommandStartEvent({
71146
71204
  }
71147
71205
 
71148
71206
  // package.json
71149
- var version = "0.0.98";
71207
+ var version = "0.0.100";
71150
71208
  var package_default = {
71151
71209
  name: "@wix/create-app",
71152
71210
  description: "Create Wix apps",
@@ -71185,7 +71243,7 @@ var package_default = {
71185
71243
  tempy: "^3.1.0",
71186
71244
  "validate-npm-package-name": "^5.0.1",
71187
71245
  variant: "^3.0.0-dev.27",
71188
- zod: "^3.24.1"
71246
+ zod: "^3.24.2"
71189
71247
  },
71190
71248
  engines: {
71191
71249
  node: ">= 18.16"
@@ -80799,8 +80857,8 @@ init_esm_shims();
80799
80857
  init_esm_shims();
80800
80858
  var import_ejs = __toESM(require_ejs(), 1);
80801
80859
  var import_front_matter = __toESM(require_front_matter(), 1);
80802
- import { resolve as resolve4 } from "node:path";
80803
- import { readFile as readFile2 } from "node:fs/promises";
80860
+ import { resolve as resolve4, dirname as dirname5, extname } from "node:path";
80861
+ import { readFile as readFile2, copyFile } from "node:fs/promises";
80804
80862
 
80805
80863
  // ../gena/src/fs-extra.ts
80806
80864
  init_esm_shims();
@@ -80810,12 +80868,28 @@ function getFiles(cwd3) {
80810
80868
 
80811
80869
  // ../gena/src/generator.ts
80812
80870
  var fm = import_front_matter.default;
80871
+ function shouldSkipParsing(file) {
80872
+ return [".png", ".jpg", ".gif"].includes(extname(file).toLowerCase());
80873
+ }
80874
+ async function justCopy({
80875
+ cwd: cwd3,
80876
+ template,
80877
+ path: path8
80878
+ }) {
80879
+ const to = resolve4(cwd3, template);
80880
+ await outputDir(dirname5(to));
80881
+ await copyFile(path8, to);
80882
+ return to;
80883
+ }
80813
80884
  async function generator(opts) {
80814
80885
  const { template: templateRoot, data, cwd: cwd3 } = opts;
80815
80886
  const templates = await getFiles(templateRoot);
80816
- await Promise.all(
80887
+ const generatedFiles = await Promise.all(
80817
80888
  templates.map(async (template) => {
80818
80889
  const path8 = resolve4(templateRoot, template);
80890
+ if (shouldSkipParsing(path8)) {
80891
+ return justCopy({ cwd: cwd3, template, path: path8 });
80892
+ }
80819
80893
  const raw = await readFile2(path8, "utf8");
80820
80894
  const content = (0, import_ejs.render)(raw, data);
80821
80895
  const { attributes, body } = fm(content);
@@ -80824,8 +80898,10 @@ async function generator(opts) {
80824
80898
  }
80825
80899
  const file = resolve4(cwd3, attributes.to ?? template);
80826
80900
  await outputFile(file, body);
80901
+ return file;
80827
80902
  })
80828
80903
  );
80904
+ return generatedFiles.filter((file) => file !== void 0);
80829
80905
  }
80830
80906
 
80831
80907
  // ../gena/src/component-generator.ts