eddev 0.1.27 → 0.1.28

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.
Files changed (70) hide show
  1. package/blocks/installGutenbergHooks.js +1 -0
  2. package/build/codegen-worker-script.js +4 -4
  3. package/build/create-codegen-worker.d.ts +1 -1
  4. package/build/create-codegen-worker.js +1 -1
  5. package/build/create-webpack-worker.js +2 -2
  6. package/build/get-webpack-config.js +26 -27
  7. package/build/graphql-codegen/graphql-codegen-files.js +3 -3
  8. package/build/graphql-codegen/graphql-codegen-no-duplicates.js +1 -1
  9. package/build/graphql-codegen/graphql-codegen-queries.js +17 -17
  10. package/build/reporter.js +1 -1
  11. package/build/workers/codegen-worker-script.d.ts +5 -0
  12. package/build/workers/codegen-worker-script.js +543 -0
  13. package/build/workers/webpack-worker-script.d.ts +2 -0
  14. package/build/workers/webpack-worker-script.js +160 -0
  15. package/cli/cli.js +3 -28
  16. package/cli/display/components/BundleDisplay.js +1 -1
  17. package/cli/display/components/CodegenDisplay.js +2 -2
  18. package/cli/generate.js +1 -15
  19. package/components/routing.d.ts +1 -1
  20. package/components/routing.js +4 -5
  21. package/hooks/queryUtils.js +2 -2
  22. package/package.json +5 -7
  23. package/style/createStitches.d.ts +5 -4
  24. package/style/createStitches.js +9 -9
  25. package/style/index.d.ts +0 -1
  26. package/style/index.js +0 -1
  27. package/utils/promptIfRepoNameIncorrect.js +1 -1
  28. package/utils/remoteProps.d.ts +2 -2
  29. package/build/dev/codegen-state.d.ts +0 -6
  30. package/build/dev/codegen-state.js +0 -2
  31. package/build/dev/compiler-state.d.ts +0 -11
  32. package/build/dev/compiler-state.js +0 -2
  33. package/build/getWebpackConfig.d.ts +0 -11
  34. package/build/getWebpackConfig.js +0 -428
  35. package/cli/build.dev2.d.ts +0 -5
  36. package/cli/build.dev2.js +0 -88
  37. package/cli/dev/codegen-state.d.ts +0 -6
  38. package/cli/dev/codegen-state.js +0 -2
  39. package/cli/dev/compiler-state.d.ts +0 -11
  40. package/cli/dev/compiler-state.js +0 -2
  41. package/cli/dev/dev-command.d.ts +0 -5
  42. package/cli/dev/dev-command.js +0 -56
  43. package/cli/dev/webpack-worker.d.ts +0 -1
  44. package/cli/dev/webpack-worker.js +0 -5
  45. package/cli/dev/worker.d.ts +0 -0
  46. package/cli/dev/worker.js +0 -2
  47. package/cli/display/components/SyntaxErrorBox.d.ts +0 -0
  48. package/cli/display/components/SyntaxErrorBox.js +0 -1
  49. package/cli/lib/create-webpack-worker.d.ts +0 -0
  50. package/cli/lib/create-webpack-worker.js +0 -1
  51. package/cli/lib/webpack-worker-script.d.ts +0 -1
  52. package/cli/lib/webpack-worker-script.js +0 -5
  53. package/cli/lib/webpack-worker.d.ts +0 -1
  54. package/cli/lib/webpack-worker.js +0 -5
  55. package/hooks/createUseQuery.d.ts +0 -9
  56. package/hooks/createUseQuery.js +0 -12
  57. package/style/themeDefinition.d.ts +0 -22
  58. package/style/themeDefinition.js +0 -2
  59. package/utils/cxBabelPlugin.d.ts +0 -0
  60. package/utils/cxBabelPlugin.js +0 -21
  61. package/utils/generateSchemaTypes.d.ts +0 -6
  62. package/utils/generateSchemaTypes.js +0 -169
  63. package/utils/graphql-codegen/graphql-codegen-blocks.d.ts +0 -1
  64. package/utils/graphql-codegen/graphql-codegen-blocks.js +0 -8
  65. package/utils/graphql-codegen/graphql-codegen-files.d.ts +0 -1
  66. package/utils/graphql-codegen/graphql-codegen-files.js +0 -64
  67. package/utils/graphql-codegen/graphql-codegen-no-duplicates.d.ts +0 -1
  68. package/utils/graphql-codegen/graphql-codegen-no-duplicates.js +0 -13
  69. package/utils/jsx/jsx-runtime.d.ts +0 -2
  70. package/utils/jsx/jsx-runtime.js +0 -27
@@ -25,6 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.installEDGutenbergHooks = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
+ // @ts-ignore
28
29
  var hooks_1 = require("@wordpress/hooks");
29
30
  var react_1 = require("react");
30
31
  // @ts-ignore
@@ -230,7 +230,7 @@ function beginWork(opts) {
230
230
  return [3 /*break*/, 3];
231
231
  case 2:
232
232
  err_3 = _a.sent();
233
- parseErrors.push("Error parsing \"" + file.replace(opts.baseDirectory, "") + ":\n" + err_3);
233
+ parseErrors.push("Error parsing \"".concat(file.replace(opts.baseDirectory, ""), ":\n").concat(err_3));
234
234
  return [3 /*break*/, 3];
235
235
  case 3: return [2 /*return*/];
236
236
  }
@@ -332,15 +332,15 @@ function beginWork(opts) {
332
332
  var item = _d[_i];
333
333
  if (item.name.value === "block") {
334
334
  var blockField = (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.selectionSet) === null || _a === void 0 ? void 0 : _a.selections[0]) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.value;
335
- blockSelection = "Exclude<" + importedName + "[\"block\"][" + JSON.stringify(blockField) + "], null>";
335
+ blockSelection = "Exclude<".concat(importedName, "[\"block\"][").concat(JSON.stringify(blockField), "], null>");
336
336
  }
337
337
  else {
338
- queryKeyVals.push([JSON.stringify(item.name.value), importedName + "[" + JSON.stringify(item.name.value) + "]"].join(": "));
338
+ queryKeyVals.push([JSON.stringify(item.name.value), "".concat(importedName, "[").concat(JSON.stringify(item.name.value), "]")].join(": "));
339
339
  }
340
340
  }
341
341
  var type = [];
342
342
  if (queryKeyVals.length)
343
- type.push("{" + queryKeyVals.join(",\n") + "}");
343
+ type.push("{".concat(queryKeyVals.join(",\n"), "}"));
344
344
  if (blockSelection)
345
345
  type.push(blockSelection);
346
346
  if (type.length === 0)
@@ -1,4 +1,4 @@
1
1
  import { Observable } from "../cli/display/lib/Observable";
2
- import { CodegenOptions } from "./codegen-worker-script";
2
+ import { CodegenOptions } from "./workers/codegen-worker-script";
3
3
  import { CodegenState } from "./state/codegen-state";
4
4
  export declare function createCodegenWorker(opts: CodegenOptions): Observable<CodegenState>;
@@ -16,7 +16,7 @@ var worker_threads_1 = require("worker_threads");
16
16
  var path_1 = require("path");
17
17
  var Observable_1 = require("../cli/display/lib/Observable");
18
18
  function createCodegenWorker(opts) {
19
- var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "codegen-worker-script.js"), {
19
+ var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "workers/codegen-worker-script.js"), {
20
20
  workerData: opts,
21
21
  stderr: true,
22
22
  stdin: false,
@@ -16,7 +16,7 @@ var worker_threads_1 = require("worker_threads");
16
16
  var path_1 = require("path");
17
17
  var Observable_1 = require("../cli/display/lib/Observable");
18
18
  function createWebpackWorker(opts) {
19
- var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "webpack-worker-script.js"), {
19
+ var worker = new worker_threads_1.Worker((0, path_1.join)(__dirname, "workers/webpack-worker-script.js"), {
20
20
  workerData: opts,
21
21
  stderr: true,
22
22
  stdin: false,
@@ -48,7 +48,7 @@ function createWebpackWorker(opts) {
48
48
  }
49
49
  else if (data.code === "invalidated") {
50
50
  subject.update(function (state) { return (__assign(__assign({}, state), { status: "compiling", statusLabel: data.changedFile
51
- ? "Rebuilding (" + data.changedFile.replace(opts.baseDirectory, "") + ")"
51
+ ? "Rebuilding (".concat(data.changedFile.replace(opts.baseDirectory, ""), ")")
52
52
  : "Rebuilding (changes detected)", log: "", duration: 0, errors: [] })); });
53
53
  }
54
54
  });
@@ -95,24 +95,24 @@ function getWebpackConfig(opts) {
95
95
  entryDir = path_1.default.resolve(path_1.default.dirname(__dirname), "./entry");
96
96
  if (isDev) {
97
97
  if (opts.isAdmin) {
98
- ENTRY["main"] = [entryDir + "/entry.publicPath.js", entryDir + "/entry.admin.dev.js"];
98
+ ENTRY["main"] = ["".concat(entryDir, "/entry.publicPath.js"), "".concat(entryDir, "/entry.admin.dev.js")];
99
99
  }
100
100
  else if (isServerless) {
101
- ENTRY["main"] = [entryDir + "/entry.serverless.dev.js"];
101
+ ENTRY["main"] = ["".concat(entryDir, "/entry.serverless.dev.js")];
102
102
  }
103
103
  else {
104
- ENTRY["main"] = [entryDir + "/entry.publicPath.js", entryDir + "/entry.monolith.dev.js"];
104
+ ENTRY["main"] = ["".concat(entryDir, "/entry.publicPath.js"), "".concat(entryDir, "/entry.monolith.dev.js")];
105
105
  }
106
106
  }
107
107
  else {
108
108
  if (opts.isAdmin) {
109
- ENTRY["main"] = [entryDir + "/entry.publicPath.js", entryDir + "/entry.admin.prod.js"];
109
+ ENTRY["main"] = ["".concat(entryDir, "/entry.publicPath.js"), "".concat(entryDir, "/entry.admin.prod.js")];
110
110
  }
111
111
  else if (isServerless) {
112
- ENTRY["main"] = [entryDir + "/entry.serverless.prod.js"];
112
+ ENTRY["main"] = ["".concat(entryDir, "/entry.serverless.prod.js")];
113
113
  }
114
114
  else {
115
- ENTRY["main"] = [entryDir + "/entry.publicPath.js", entryDir + "/entry.monolith.prod.js"];
115
+ ENTRY["main"] = ["".concat(entryDir, "/entry.publicPath.js"), "".concat(entryDir, "/entry.monolith.prod.js")];
116
116
  }
117
117
  }
118
118
  distSuffix = opts.isAdmin ? "admin" : "frontend";
@@ -145,13 +145,11 @@ function getWebpackConfig(opts) {
145
145
  require.resolve("@babel/preset-react"),
146
146
  {
147
147
  runtime: "automatic",
148
- // importSource: Path.resolve(__dirname, "../utils/jsx"),
149
148
  },
150
149
  ],
151
150
  require.resolve("@babel/preset-typescript"),
152
151
  ],
153
152
  plugins: [
154
- // Path.resolve(__dirname, "../utils/cxBabelPlugin.js"),
155
153
  isBrowser && isDev && [require.resolve("react-refresh/babel"), { skipEnvCheck: true }],
156
154
  require.resolve("@loadable/babel-plugin"),
157
155
  ].filter(Boolean),
@@ -169,7 +167,7 @@ function getWebpackConfig(opts) {
169
167
  {
170
168
  loader: mini_css_extract_plugin_1.default.loader,
171
169
  options: {
172
- publicPath: "/wp-content/themes/" + opts.themeName + "/dist/" + distSuffix,
170
+ publicPath: "/wp-content/themes/".concat(opts.themeName, "/dist/").concat(distSuffix),
173
171
  },
174
172
  },
175
173
  {
@@ -199,9 +197,10 @@ function getWebpackConfig(opts) {
199
197
  DEFINES["process.LOADABLE_STATS_FILE"] = JSON.stringify(loadableManifestFile);
200
198
  DEFINES["process.dev"] = isDev ? "true" : "false";
201
199
  DEFINES["process.admin"] = opts.isAdmin ? "true" : "false";
202
- DEFINES["process.env.themePath"] = JSON.stringify("/wp-content/themes/" + opts.themeName);
200
+ DEFINES["process.env.themePath"] = JSON.stringify("/wp-content/themes/".concat(opts.themeName));
201
+ DEFINES["process.themePath"] = JSON.stringify("/wp-content/themes/".concat(opts.themeName));
203
202
  if (isBrowser) {
204
- DEFINES["process.env.themePath"] = "window.THEME_PATH || " + DEFINES["process.env.themePath"];
203
+ DEFINES["process.env.themePath"] = "window.THEME_PATH || ".concat(DEFINES["process.env.themePath"]);
205
204
  }
206
205
  // Bundle analyser
207
206
  if (!opts.isAdmin && !isDev) {
@@ -261,25 +260,25 @@ function getWebpackConfig(opts) {
261
260
  var componentName = (0, change_case_1.pascalCase)(name);
262
261
  return { relative: relative, name: name, module: module, componentName: componentName };
263
262
  });
264
- writeVirtualModule(ALIAS["@manifest/views"], "\n " + (!isServerless && "import loadable from '" + require.resolve("@loadable/component") + "';") + "\n import App from " + JSON.stringify("./views/_app.tsx") + "\n\n " + (isServerless
263
+ writeVirtualModule(ALIAS["@manifest/views"], "\n ".concat(!isServerless && "import loadable from '".concat(require.resolve("@loadable/component"), "';"), "\n import App from ").concat(JSON.stringify("./views/_app.tsx"), "\n\n ").concat(isServerless
265
264
  ? files.map(function (_a) {
266
265
  var componentName = _a.componentName, module = _a.module;
267
- return "import " + componentName + " from " + module;
266
+ return "import ".concat(componentName, " from ").concat(module);
268
267
  }).join("\n")
269
- : "") + "\n\n export { App }\n\n export default {\n " + files
268
+ : "", "\n\n export { App }\n\n export default {\n ").concat(files
270
269
  .map(function (_a) {
271
270
  var relative = _a.relative, componentName = _a.componentName, module = _a.module;
272
271
  if (!isServerless) {
273
272
  // In serverless mode, export @loadable components. Script tags will be
274
273
  // auto-included in output HTML
275
- return "\"" + relative + "\": loadable(() => import(" + module + "))";
274
+ return "\"".concat(relative, "\": loadable(() => import(").concat(module, "))");
276
275
  }
277
276
  else {
278
277
  // On non-serverless, the templates are bundled straight into the main app.
279
- return "\"" + relative + "\": " + componentName;
278
+ return "\"".concat(relative, "\": ").concat(componentName);
280
279
  }
281
280
  })
282
- .join(",\n") + "\n }\n ");
281
+ .join(",\n"), "\n }\n "));
283
282
  };
284
283
  templateLookupPattern = path_1.default.resolve(opts.baseDirectory, "views/**/*.tsx");
285
284
  if (!opts.isAdmin) return [3 /*break*/, 1];
@@ -310,31 +309,31 @@ function getWebpackConfig(opts) {
310
309
  return { relative: relative, name: name, module: module, componentName: componentName };
311
310
  });
312
311
  if (opts.isAdmin) {
313
- writeVirtualModule(ALIAS["@manifest/blocks"], "\n import coreBlocks from './blocks/_core.tsx'\n " + (!isServerless && "import loadable from '" + require.resolve("@loadable/component") + "';") + "\n\n export default {\n ...coreBlocks,\n " + files
312
+ writeVirtualModule(ALIAS["@manifest/blocks"], "\n import coreBlocks from './blocks/_core.tsx'\n ".concat(!isServerless && "import loadable from '".concat(require.resolve("@loadable/component"), "';"), "\n\n export default {\n ...coreBlocks,\n ").concat(files
314
313
  .map(function (_a) {
315
314
  var relative = _a.relative, componentName = _a.componentName, module = _a.module;
316
315
  var parts = relative.replace(/\.tsx$/, "").split("/");
317
316
  var blockName = "acf/" + parts.slice(1).join("-");
318
- return "\"" + blockName + "\": loadable(() => import(" + module + "))";
317
+ return "\"".concat(blockName, "\": loadable(() => import(").concat(module, "))");
319
318
  })
320
- .join(",\n") + "\n }\n ");
319
+ .join(",\n"), "\n }\n "));
321
320
  }
322
321
  else {
323
- writeVirtualModule(ALIAS["@manifest/blocks"], "\n import coreBlocks from './blocks/_core.tsx'\n\n " + files
322
+ writeVirtualModule(ALIAS["@manifest/blocks"], "\n import coreBlocks from './blocks/_core.tsx'\n\n ".concat(files
324
323
  .map(function (_a) {
325
324
  var relative = _a.relative, componentName = _a.componentName, module = _a.module;
326
325
  var parts = relative.replace(/\.tsx$/, "").split("/");
327
326
  var blockName = "acf/" + parts.slice(1).join("-");
328
- return "import " + componentName + " from " + module;
327
+ return "import ".concat(componentName, " from ").concat(module);
329
328
  })
330
- .join("\n") + "\n\n export default {\n ...coreBlocks,\n " + files
329
+ .join("\n"), "\n\n export default {\n ...coreBlocks,\n ").concat(files
331
330
  .map(function (_a) {
332
331
  var relative = _a.relative, componentName = _a.componentName, module = _a.module;
333
332
  var parts = relative.replace(/\.tsx$/, "").split("/");
334
333
  var blockName = "acf/" + parts.slice(1).join("-");
335
- return "\"" + blockName + "\": " + componentName;
334
+ return "\"".concat(blockName, "\": ").concat(componentName);
336
335
  })
337
- .join(",\n") + "\n }\n ");
336
+ .join(",\n"), "\n }\n "));
338
337
  }
339
338
  };
340
339
  blockLookupManifest = path_1.default.resolve(opts.baseDirectory, "blocks/**/*.tsx");
@@ -373,8 +372,8 @@ function getWebpackConfig(opts) {
373
372
  // chunkIds: "named",
374
373
  },
375
374
  output: {
376
- filename: "[name]." + (opts.isAdmin ? "admin" : "frontend") + ".js",
377
- publicPath: isDev ? "//127.0.0.1:" + opts.hotPort + "/" : "/wp-content/themes/" + opts.themeName + "/dist/" + distSuffix + "/",
375
+ filename: "[name].".concat(opts.isAdmin ? "admin" : "frontend", ".js"),
376
+ publicPath: isDev ? "//127.0.0.1:".concat(opts.hotPort, "/") : "/wp-content/themes/".concat(opts.themeName, "/dist/").concat(distSuffix, "/"),
378
377
  path: outputFolder,
379
378
  globalObject: isSSR ? "this" : "self",
380
379
  clean: true,
@@ -45,20 +45,20 @@ module.exports = {
45
45
  var typeName = ((_a = config.getType) === null || _a === void 0 ? void 0 : _a.call(config, importedName, doc.document.definitions[0])) || importedName;
46
46
  imports.push(importedName);
47
47
  var key = relative.replace(/\.graphql/, "");
48
- items.push(JSON.stringify(key) + ": " + typeForFile(key, typeName));
48
+ items.push("".concat(JSON.stringify(key), ": ").concat(typeForFile(key, typeName)));
49
49
  }
50
50
  });
51
51
  for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
52
52
  var file = files_1[_i];
53
53
  if (!filesFound[file.replace(/\.tsx/, "")]) {
54
54
  var key = getRelative(file).replace(/\.tsx$/, "");
55
- items.push(JSON.stringify(key) + ": " + typeForFile(key, ""));
55
+ items.push("".concat(JSON.stringify(key), ": ").concat(typeForFile(key, "")));
56
56
  }
57
57
  }
58
58
  if (imports.length === 0) {
59
59
  process.exit();
60
60
  return "export { };";
61
61
  }
62
- return "import { " + imports.sort().join(", ") + " } from \"./types.graphql\"\nexport { };\n\ndeclare global {\n type " + config.globalName + " = {\n" + items.sort().join(",\n") + "\n }\n}\n ";
62
+ return "import { ".concat(imports.sort().join(", "), " } from \"./types.graphql\"\nexport { };\n\ndeclare global {\n type ").concat(config.globalName, " = {\n").concat(items.sort().join(",\n"), "\n }\n}\n ");
63
63
  },
64
64
  };
@@ -5,7 +5,7 @@ module.exports = {
5
5
  validate: function (schema, documents, config, info) {
6
6
  documents.forEach(function (doc) {
7
7
  if (doc.document.definitions.length === 0) {
8
- throw new Error("GraphQL file '" + doc.location + "' does not contain any uniquely named operations.");
8
+ throw new Error("GraphQL file '".concat(doc.location, "' does not contain any uniquely named operations."));
9
9
  process.exit();
10
10
  }
11
11
  });
@@ -40,7 +40,7 @@ module.exports = {
40
40
  fullMessage += ":\n\n" + printedSource;
41
41
  }
42
42
  else {
43
- fullMessage += " (in " + fileName + ")";
43
+ fullMessage += " (in ".concat(fileName, ")");
44
44
  }
45
45
  var err = new Error(fullMessage);
46
46
  err.name = "QueryError";
@@ -68,12 +68,12 @@ module.exports = {
68
68
  var resultTypeName = name + (type === "mutation" ? "Mutation" : "Query");
69
69
  // For conventions sake, the name of the operation should start with 'Use'
70
70
  if (!name.match(/^Use/)) {
71
- throwErrorAtLocation(item.name.loc, "Expected your query name to start with 'Use', but found '" + name + "'. Did you mean 'Use" + name + "'");
71
+ throwErrorAtLocation(item.name.loc, "Expected your query name to start with 'Use', but found '".concat(name, "'. Did you mean 'Use").concat(name, "'"));
72
72
  }
73
73
  // Another convention, the query name and file name should be the same
74
74
  var baseName = (0, path_1.basename)(fileName);
75
75
  if (baseName.replace(".graphql", "") !== name) {
76
- throwErrorAtLocation(item.name.loc, "Expected your query name and file name to match, for conventions sake (eg. '" + baseName + "' should be '" + name + ".graphql')");
76
+ throwErrorAtLocation(item.name.loc, "Expected your query name and file name to match, for conventions sake (eg. '".concat(baseName, "' should be '").concat(name, ".graphql')"));
77
77
  }
78
78
  // Only import variables if the operation has variables
79
79
  if (variablesTypeName) {
@@ -83,12 +83,12 @@ module.exports = {
83
83
  if (type === "normal") {
84
84
  // Just a normal query!
85
85
  importUtils["createUseQuery"] = true;
86
- hooks[hookName] = "\n createUseQuery<" + resultTypeName + ", " + (variablesTypeName || "undefined") + ">({\n name: " + JSON.stringify(name) + "\n })\n ";
86
+ hooks[hookName] = "\n createUseQuery<".concat(resultTypeName, ", ").concat(variablesTypeName || "undefined", ">({\n name: ").concat(JSON.stringify(name), "\n })\n ");
87
87
  }
88
88
  else if (type === "mutation") {
89
89
  // A triggerable mutation
90
90
  importUtils["createUseMutation"] = true;
91
- hooks[hookName] = "\n createUseMutation<" + resultTypeName + ", " + (variablesTypeName || "undefined") + ">({\n name: " + JSON.stringify(name) + "\n })\n ";
91
+ hooks[hookName] = "\n createUseMutation<".concat(resultTypeName, ", ").concat(variablesTypeName || "undefined", ">({\n name: ").concat(JSON.stringify(name), "\n })\n ");
92
92
  }
93
93
  else if (type === "infinite") {
94
94
  // Ensure the query has 'limit' and 'cursor' variables
@@ -106,13 +106,13 @@ module.exports = {
106
106
  defaultLimit_1 = Number(defaultValue.value);
107
107
  }
108
108
  else {
109
- throwErrorAtLocation(loc, "For infinite queries, be sure to give the '$limit' variable a default value!\nFor example: posts($limit: Int = 10, $cursor: String)");
109
+ throwErrorAtLocation(loc, "For infinite queries, be sure to give the '$limit' variable a default value!\nFor example: posts($limit: Int = 10, $cursor: String)\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks");
110
110
  }
111
111
  }
112
112
  else {
113
113
  // @ts-ignore
114
114
  var wrongType = (_b = type === null || type === void 0 ? void 0 : type.name) === null || _b === void 0 ? void 0 : _b.value;
115
- throwErrorAtLocation(loc, "For infinite queries, the '$limit' variable is expected to be an 'Int' type, but you've used '" + wrongType + "' instead!\nFor example: posts($limit: Int = 10, $cursor: String)");
115
+ throwErrorAtLocation(loc, "For infinite queries, the '$limit' variable is expected to be an 'Int' type, but you've used '".concat(wrongType, "' instead!\nFor example: posts($limit: Int = 10, $cursor: String)\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks"));
116
116
  }
117
117
  }
118
118
  else if (variable.name.value === "cursor") {
@@ -122,14 +122,14 @@ module.exports = {
122
122
  cursorVariableIsValid_1 = true;
123
123
  }
124
124
  else {
125
- throwErrorAtLocation(loc, "For infinite queries, the required '$cursor' variable must be an optional String.\nFor example: posts($limit: Int = 10, $cursor: String)");
125
+ throwErrorAtLocation(loc, "For infinite queries, the required '$cursor' variable must be an optional String.\nFor example: posts($limit: Int = 10, $cursor: String)\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks");
126
126
  }
127
127
  }
128
128
  }
129
129
  });
130
130
  // Check that both the 'limit' and 'cursor' variables are present!
131
131
  if (!cursorVariableIsValid_1 || !limitVariableIsValid_1) {
132
- throwErrorAtLocation(item.loc, "For infinite queries, you must supply and use the '$limit' and '$cursor' variables\nFor example: posts($limit: Int = 10, $cursor: String) " + cursorVariableIsValid_1 + " " + limitVariableIsValid_1);
132
+ throwErrorAtLocation(item.loc, "For infinite queries, you must supply and use the '$limit' and '$cursor' variables\nFor example: posts($limit: Int = 10, $cursor: String) ".concat(cursorVariableIsValid_1, " ").concat(limitVariableIsValid_1, "\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks"));
133
133
  }
134
134
  // Finally, ensure that pageInfo is queried somewhere
135
135
  // We actually want the selection path for a whole bunch of fields, so that we can extract pagination info, and the list of data
@@ -182,7 +182,7 @@ module.exports = {
182
182
  });
183
183
  // Make sure we found pageInfo { endCursor, hasNextPage }
184
184
  if (!pageInfo_1.pageInfoPath || !pageInfo_1.endCursorPath || !pageInfo_1.hasNextPagePath) {
185
- throwErrorAtLocation(undefined, "For infinite queries, you need to ensure you select the 'pageInfo' field and it's child 'hasNextPage' and 'endCursor' fields");
185
+ throwErrorAtLocation(undefined, "For infinite queries, you need to ensure you select the 'pageInfo' field and it's child 'hasNextPage' and 'endCursor' fields\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks");
186
186
  }
187
187
  // Look for a nodes path which shares the same parent as the pageInfo path
188
188
  var expectedNodesPath_1 = pageInfo_1.pageInfoPath.slice(0, -1).join(",");
@@ -191,7 +191,7 @@ module.exports = {
191
191
  return testPath === expectedNodesPath_1;
192
192
  });
193
193
  if (!pageInfo_1.nodesPath || !parentNode_1) {
194
- throwErrorAtLocation(undefined, "For infinite queries, be sure to select some nodes using the 'nodes' field, adjacent to the 'pageInfo' field which has been selected.");
194
+ throwErrorAtLocation(undefined, "For infinite queries, be sure to select some nodes using the 'nodes' field, adjacent to the 'pageInfo' field which has been selected.\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks");
195
195
  }
196
196
  var firstArgumentIsValid_1 = false;
197
197
  var afterArgumentIsValid_1 = false;
@@ -214,15 +214,15 @@ module.exports = {
214
214
  }
215
215
  });
216
216
  if (parentNode_1 && (!firstArgumentIsValid_1 || !afterArgumentIsValid_1)) {
217
- throwErrorAtLocation(parentNode_1.loc, "You must use the arguments \"first: $limit, after: $cursor:\" when using infinite queries.");
217
+ throwErrorAtLocation(parentNode_1.loc, "You must use the arguments (first: $limit, after: $cursor) when using infinite queries.\nRead more -> https://eddev.ed.studio/docs/graphql/query-hooks");
218
218
  }
219
219
  // Drill down to the path type
220
220
  var finalResultTypeName_1 = resultTypeName;
221
221
  pageInfo_1.nodesPath.forEach(function (key) {
222
- finalResultTypeName_1 = "Exclude<" + finalResultTypeName_1 + "[" + JSON.stringify(key) + "], null>";
222
+ finalResultTypeName_1 = "Exclude<".concat(finalResultTypeName_1, "[").concat(JSON.stringify(key), "], null>");
223
223
  });
224
224
  importUtils["createUseInfiniteQuery"] = true;
225
- hooks[hookName] = "\n createUseInfiniteQuery<Exclude<" + finalResultTypeName_1 + "[0], null>, Omit<" + (variablesTypeName || "undefined") + ", 'limit' | 'cursor'>>({\n name: " + JSON.stringify(name) + ",\n defaultLimit: " + defaultLimit_1 + ",\n paths: " + JSON.stringify(pageInfo_1) + "\n })\n ";
225
+ hooks[hookName] = "\n createUseInfiniteQuery<Exclude<".concat(finalResultTypeName_1, "[0], null>, Omit<").concat(variablesTypeName || "undefined", ", 'limit' | 'cursor'>>({\n name: ").concat(JSON.stringify(name), ",\n defaultLimit: ").concat(defaultLimit_1, ",\n paths: ").concat(JSON.stringify(pageInfo_1), "\n })\n ");
226
226
  }
227
227
  });
228
228
  }
@@ -233,15 +233,15 @@ module.exports = {
233
233
  var codeBlocks = [];
234
234
  // Import required utility functions
235
235
  if (utilsToImport.length) {
236
- codeBlocks.push("import { " + utilsToImport.join(", ") + " } from 'eddev/hooks/queryUtils'");
236
+ codeBlocks.push("import { ".concat(utilsToImport.join(", "), " } from 'eddev/hooks/queryUtils'"));
237
237
  }
238
238
  // Import types from types.graphql
239
239
  if (importTypes.length) {
240
- codeBlocks.push("import { " + importTypes + " } from '../types.graphql'");
240
+ codeBlocks.push("import { ".concat(importTypes, " } from '../types.graphql'"));
241
241
  }
242
242
  for (var hookName in hooks) {
243
243
  var hookCode = hooks[hookName];
244
- codeBlocks.push("export const " + hookName + " = " + hookCode);
244
+ codeBlocks.push("export const ".concat(hookName, " = ").concat(hookCode));
245
245
  }
246
246
  return codeBlocks.join("\n\n");
247
247
  },
package/build/reporter.js CHANGED
@@ -61,7 +61,7 @@ var ReporterPlugin = /** @class */ (function () {
61
61
  // // ],
62
62
  // })
63
63
  var log = function (type, message, errors) {
64
- var label = " " + type.toUpperCase() + " (" + _this.title + ") ";
64
+ var label = " ".concat(type.toUpperCase(), " (").concat(_this.title, ") ");
65
65
  if (type === "done") {
66
66
  label = chalk_1.default.bgGreenBright.black(label);
67
67
  }
@@ -0,0 +1,5 @@
1
+ export declare type CodegenOptions = {
2
+ baseDirectory: string;
3
+ watch: boolean;
4
+ };
5
+ export declare function beginWork(opts: CodegenOptions): Promise<void>;