@wix/create-app 0.0.98 → 0.0.99

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
+ });
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 });
56760
56775
  }
56776
+ return;
56761
56777
  });
56762
56778
  return ZodAny.create();
56763
56779
  }
@@ -59607,7 +59623,9 @@ var fixComponentProps = (component, index, translation) => {
59607
59623
  function Componentized() {
59608
59624
  return (0, import_react64.createElement)(import_react64.Fragment, null, comp);
59609
59625
  }
59610
- return (0, import_react64.createElement)(Componentized);
59626
+ return (0, import_react64.createElement)(Componentized, {
59627
+ key: componentKey
59628
+ });
59611
59629
  };
59612
59630
  var generateArrayComponents = (components, translation) => components.map((c2, index) => fixComponentProps(c2, index, translation));
59613
59631
  var generateObjectComponents = (components, translation) => {
@@ -67170,7 +67188,7 @@ function getErrorComponent(code, cause) {
67170
67188
  return () => /* @__PURE__ */ import_react77.default.createElement(ErrorMessage, { message: "You used invalid API key to log in." });
67171
67189
  },
67172
67190
  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." });
67191
+ return () => /* @__PURE__ */ import_react77.default.createElement(ErrorMessage, { message: "You must provide a `--site` in the command options." });
67174
67192
  },
67175
67193
  FailedAddingPackageToWorkspace: () => {
67176
67194
  return () => /* @__PURE__ */ import_react77.default.createElement(
@@ -71146,7 +71164,7 @@ function reportCommandStartEvent({
71146
71164
  }
71147
71165
 
71148
71166
  // package.json
71149
- var version = "0.0.98";
71167
+ var version = "0.0.99";
71150
71168
  var package_default = {
71151
71169
  name: "@wix/create-app",
71152
71170
  description: "Create Wix apps",
@@ -71185,7 +71203,7 @@ var package_default = {
71185
71203
  tempy: "^3.1.0",
71186
71204
  "validate-npm-package-name": "^5.0.1",
71187
71205
  variant: "^3.0.0-dev.27",
71188
- zod: "^3.24.1"
71206
+ zod: "^3.24.2"
71189
71207
  },
71190
71208
  engines: {
71191
71209
  node: ">= 18.16"
@@ -80799,8 +80817,8 @@ init_esm_shims();
80799
80817
  init_esm_shims();
80800
80818
  var import_ejs = __toESM(require_ejs(), 1);
80801
80819
  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";
80820
+ import { resolve as resolve4, dirname as dirname5, extname } from "node:path";
80821
+ import { readFile as readFile2, copyFile } from "node:fs/promises";
80804
80822
 
80805
80823
  // ../gena/src/fs-extra.ts
80806
80824
  init_esm_shims();
@@ -80810,12 +80828,28 @@ function getFiles(cwd3) {
80810
80828
 
80811
80829
  // ../gena/src/generator.ts
80812
80830
  var fm = import_front_matter.default;
80831
+ function shouldSkipParsing(file) {
80832
+ return [".png", ".jpg", ".gif"].includes(extname(file).toLowerCase());
80833
+ }
80834
+ async function justCopy({
80835
+ cwd: cwd3,
80836
+ template,
80837
+ path: path8
80838
+ }) {
80839
+ const to = resolve4(cwd3, template);
80840
+ await outputDir(dirname5(to));
80841
+ await copyFile(path8, to);
80842
+ return to;
80843
+ }
80813
80844
  async function generator(opts) {
80814
80845
  const { template: templateRoot, data, cwd: cwd3 } = opts;
80815
80846
  const templates = await getFiles(templateRoot);
80816
- await Promise.all(
80847
+ const generatedFiles = await Promise.all(
80817
80848
  templates.map(async (template) => {
80818
80849
  const path8 = resolve4(templateRoot, template);
80850
+ if (shouldSkipParsing(path8)) {
80851
+ return justCopy({ cwd: cwd3, template, path: path8 });
80852
+ }
80819
80853
  const raw = await readFile2(path8, "utf8");
80820
80854
  const content = (0, import_ejs.render)(raw, data);
80821
80855
  const { attributes, body } = fm(content);
@@ -80824,8 +80858,10 @@ async function generator(opts) {
80824
80858
  }
80825
80859
  const file = resolve4(cwd3, attributes.to ?? template);
80826
80860
  await outputFile(file, body);
80861
+ return file;
80827
80862
  })
80828
80863
  );
80864
+ return generatedFiles.filter((file) => file !== void 0);
80829
80865
  }
80830
80866
 
80831
80867
  // ../gena/src/component-generator.ts