@botonic/nx-plugin 2.31.0 → 2.31.1-alpha.0

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 (111) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.js +44 -0
  3. package/{src/executors/build-node-app/executor.js → libs/botonic/nx-plugin/src/executors/build-node-app/executor-impl.js} +3 -3
  4. package/libs/botonic/nx-plugin/src/executors/build-node-app/executor.js +27 -0
  5. package/{src/executors/delete-bot/executor.js → libs/botonic/nx-plugin/src/executors/delete-bot/executor-impl.js} +3 -3
  6. package/libs/botonic/nx-plugin/src/executors/delete-bot/executor.js +27 -0
  7. package/{src/executors/deploy-netlify-snapshot/executor.js → libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot/executor-impl.js} +3 -3
  8. package/libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot/executor.js +27 -0
  9. package/{src/executors/deploy-to-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/deploy-to-hubtype/executor-impl.js} +3 -3
  10. package/libs/botonic/nx-plugin/src/executors/deploy-to-hubtype/executor.js +27 -0
  11. package/{src/executors/e2e-webchat/executor.js → libs/botonic/nx-plugin/src/executors/e2e-webchat/executor-impl.js} +5 -5
  12. package/libs/botonic/nx-plugin/src/executors/e2e-webchat/executor.js +27 -0
  13. package/{src/executors/integrate-provider/executor.js → libs/botonic/nx-plugin/src/executors/integrate-provider/executor-impl.js} +3 -3
  14. package/libs/botonic/nx-plugin/src/executors/integrate-provider/executor.js +27 -0
  15. package/{src/executors/login-to-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/login-to-hubtype/executor-impl.js} +3 -3
  16. package/libs/botonic/nx-plugin/src/executors/login-to-hubtype/executor.js +27 -0
  17. package/{src/executors/logout-from-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/logout-from-hubtype/executor-impl.js} +3 -3
  18. package/libs/botonic/nx-plugin/src/executors/logout-from-hubtype/executor.js +27 -0
  19. package/{src/executors/run-lambda/executor.js → libs/botonic/nx-plugin/src/executors/run-lambda/executor-impl.js} +3 -3
  20. package/libs/botonic/nx-plugin/src/executors/run-lambda/executor.js +27 -0
  21. package/{src/executors/serve-bot/executor.js → libs/botonic/nx-plugin/src/executors/serve-bot/executor-impl.js} +3 -3
  22. package/libs/botonic/nx-plugin/src/executors/serve-bot/executor.js +27 -0
  23. package/{src/generators/action/generator.js → libs/botonic/nx-plugin/src/generators/action/generator-impl.js} +5 -5
  24. package/libs/botonic/nx-plugin/src/generators/action/generator.js +27 -0
  25. package/{src/generators/bot-app/generator.js → libs/botonic/nx-plugin/src/generators/bot-app/generator-impl.js} +6 -5
  26. package/libs/botonic/nx-plugin/src/generators/bot-app/generator.js +34 -0
  27. package/{src/generators/custom-message/generator.js → libs/botonic/nx-plugin/src/generators/custom-message/generator-impl.js} +5 -5
  28. package/libs/botonic/nx-plugin/src/generators/custom-message/generator.js +27 -0
  29. package/{src/generators/preset/generator.js → libs/botonic/nx-plugin/src/generators/preset/generator-impl.js} +5 -5
  30. package/libs/botonic/nx-plugin/src/generators/preset/generator.js +34 -0
  31. package/{src/generators/remove-custom-message/generator.js → libs/botonic/nx-plugin/src/generators/remove-custom-message/generator-impl.js} +5 -5
  32. package/libs/botonic/nx-plugin/src/generators/remove-custom-message/generator.js +27 -0
  33. package/{src/generators/webview/generator.js → libs/botonic/nx-plugin/src/generators/webview/generator-impl.js} +5 -5
  34. package/libs/botonic/nx-plugin/src/generators/webview/generator.js +27 -0
  35. package/{src → libs/botonic/nx-plugin/src}/index.js +3 -1
  36. package/libs/botonic/nx-plugin/src/lib/delegate/delegate-executor.js +119 -0
  37. package/libs/botonic/nx-plugin/src/lib/delegate/delegate-generator.js +128 -0
  38. package/libs/botonic/nx-plugin/src/lib/serve-mode/index.js +183 -0
  39. package/migrations.json +1 -8
  40. package/package.json +7 -4
  41. package/src/executors/build-node-app/executor-impl.d.ts +5 -0
  42. package/src/executors/build-node-app/executor.d.ts +4 -2
  43. package/src/executors/delete-bot/executor-impl.d.ts +5 -0
  44. package/src/executors/delete-bot/executor.d.ts +4 -2
  45. package/src/executors/deploy-netlify-snapshot/executor-impl.d.ts +8 -0
  46. package/src/executors/deploy-netlify-snapshot/executor.d.ts +4 -5
  47. package/src/executors/deploy-to-hubtype/executor-impl.d.ts +5 -0
  48. package/src/executors/deploy-to-hubtype/executor.d.ts +4 -2
  49. package/src/executors/e2e-webchat/executor-impl.d.ts +5 -0
  50. package/src/executors/e2e-webchat/executor.d.ts +4 -2
  51. package/src/executors/integrate-provider/executor-impl.d.ts +5 -0
  52. package/src/executors/integrate-provider/executor.d.ts +4 -2
  53. package/src/executors/login-to-hubtype/executor-impl.d.ts +5 -0
  54. package/src/executors/login-to-hubtype/executor.d.ts +4 -2
  55. package/src/executors/logout-from-hubtype/executor-impl.d.ts +3 -0
  56. package/src/executors/logout-from-hubtype/executor.d.ts +5 -1
  57. package/src/executors/run-lambda/executor-impl.d.ts +5 -0
  58. package/src/executors/run-lambda/executor.d.ts +4 -2
  59. package/src/executors/serve-bot/executor-impl.d.ts +5 -0
  60. package/src/executors/serve-bot/executor.d.ts +4 -2
  61. package/src/generators/action/generator-impl.d.ts +4 -0
  62. package/src/generators/action/generator.d.ts +2 -3
  63. package/src/generators/bot-app/files/vite/webchat.config.ts.template +10 -2
  64. package/src/generators/bot-app/generator-impl.d.ts +4 -0
  65. package/src/generators/bot-app/generator.d.ts +2 -4
  66. package/src/generators/custom-message/generator-impl.d.ts +4 -0
  67. package/src/generators/custom-message/generator.d.ts +2 -3
  68. package/src/generators/preset/generator-impl.d.ts +4 -0
  69. package/src/generators/preset/generator.d.ts +2 -4
  70. package/src/generators/remove-custom-message/generator-impl.d.ts +4 -0
  71. package/src/generators/remove-custom-message/generator.d.ts +2 -3
  72. package/src/generators/webview/generator-impl.d.ts +4 -0
  73. package/src/generators/webview/generator.d.ts +2 -3
  74. package/src/index.d.ts +1 -0
  75. package/src/lib/delegate/delegate-executor.d.ts +6 -0
  76. package/src/lib/delegate/delegate-generator.d.ts +2 -0
  77. package/src/lib/serve-mode/index.d.ts +25 -0
  78. package/src/generators/bot-app/files/vite/plugins/dev-log-viewer-html.plugin.ts.template +0 -65
  79. package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.d.ts +0 -2
  80. package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.js +0 -290
  81. /package/{src → libs/botonic/nx-plugin/src}/executors/build-node-app/schema.d.js +0 -0
  82. /package/{src → libs/botonic/nx-plugin/src}/executors/delete-bot/schema.d.js +0 -0
  83. /package/{src → libs/botonic/nx-plugin/src}/executors/deploy-netlify-snapshot/schema.d.js +0 -0
  84. /package/{src → libs/botonic/nx-plugin/src}/executors/deploy-to-hubtype/schema.d.js +0 -0
  85. /package/{src → libs/botonic/nx-plugin/src}/executors/e2e-webchat/schema.d.js +0 -0
  86. /package/{src → libs/botonic/nx-plugin/src}/executors/integrate-provider/schema.d.js +0 -0
  87. /package/{src → libs/botonic/nx-plugin/src}/executors/login-to-hubtype/schema.d.js +0 -0
  88. /package/{src → libs/botonic/nx-plugin/src}/executors/logout-from-hubtype/schema.d.js +0 -0
  89. /package/{src → libs/botonic/nx-plugin/src}/executors/run-lambda/schema.d.js +0 -0
  90. /package/{src → libs/botonic/nx-plugin/src}/executors/serve-bot/schema.d.js +0 -0
  91. /package/{src → libs/botonic/nx-plugin/src}/generators/action/schema.js +0 -0
  92. /package/{src → libs/botonic/nx-plugin/src}/generators/bot-app/schema.js +0 -0
  93. /package/{src → libs/botonic/nx-plugin/src}/generators/custom-message/schema.js +0 -0
  94. /package/{src → libs/botonic/nx-plugin/src}/generators/preset/schema.js +0 -0
  95. /package/{src → libs/botonic/nx-plugin/src}/generators/remove-custom-message/schema.js +0 -0
  96. /package/{src → libs/botonic/nx-plugin/src}/generators/shared/bot-app-utils.js +0 -0
  97. /package/{src → libs/botonic/nx-plugin/src}/generators/webview/schema.js +0 -0
  98. /package/{src → libs/botonic/nx-plugin/src}/lib/api-service.js +0 -0
  99. /package/{src → libs/botonic/nx-plugin/src}/lib/bot-config.js +0 -0
  100. /package/{src → libs/botonic/nx-plugin/src}/lib/cloudflared-tunnel.js +0 -0
  101. /package/{src → libs/botonic/nx-plugin/src}/lib/constants.js +0 -0
  102. /package/{src → libs/botonic/nx-plugin/src}/lib/credentials-handler.js +0 -0
  103. /package/{src → libs/botonic/nx-plugin/src}/lib/index.js +0 -0
  104. /package/{src → libs/botonic/nx-plugin/src}/lib/interfaces.js +0 -0
  105. /package/{src → libs/botonic/nx-plugin/src}/lib/util/executor-helpers.js +0 -0
  106. /package/{src → libs/botonic/nx-plugin/src}/lib/util/file-system.js +0 -0
  107. /package/{src → libs/botonic/nx-plugin/src}/lib/util/sam-container-cleanup.js +0 -0
  108. /package/{src → libs/botonic/nx-plugin/src}/lib/util/sam-template.js +0 -0
  109. /package/{src → libs/botonic/nx-plugin/src}/lib/util/system.js +0 -0
  110. /package/{src → libs/botonic/nx-plugin/src}/migrations/utils/migration-utils.js +0 -0
  111. /package/{src → libs/botonic/nx-plugin/src}/plugin.js +0 -0
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var generator_exports = {};
30
+ __export(generator_exports, {
31
+ default: () => import_generator_impl.default
32
+ });
33
+ module.exports = __toCommonJS(generator_exports);
34
+ var import_generator_impl = __toESM(require("./generator-impl"));
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var generator_exports = {};
20
- __export(generator_exports, {
21
- default: () => generator_default
19
+ var generator_impl_exports = {};
20
+ __export(generator_impl_exports, {
21
+ default: () => generator_impl_default
22
22
  });
23
- module.exports = __toCommonJS(generator_exports);
23
+ module.exports = __toCommonJS(generator_impl_exports);
24
24
  var import_devkit = require("@nx/devkit");
25
25
  var import_bot_app_utils = require("../shared/bot-app-utils");
26
26
  const MODULE_DIR = __dirname;
@@ -200,7 +200,7 @@ function updateRoutes(tree, options) {
200
200
  ` },`
201
201
  ]);
202
202
  }
203
- async function generator_default(tree, options) {
203
+ async function generator_impl_default(tree, options) {
204
204
  console.log(`Creating custom message: ${options.name}`);
205
205
  const normalizedOptions = normalizeOptions(tree, options);
206
206
  console.log(`Project: ${normalizedOptions.projectName}`);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var generator_exports = {};
20
+ __export(generator_exports, {
21
+ default: () => generator_default
22
+ });
23
+ module.exports = __toCommonJS(generator_exports);
24
+ var import_delegate_generator = require("../../lib/delegate/delegate-generator");
25
+ async function generator_default(tree, options) {
26
+ return (0, import_delegate_generator.runLocalGenerator)(__filename, "custom-message", tree, options);
27
+ }
@@ -26,11 +26,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var generator_exports = {};
30
- __export(generator_exports, {
31
- default: () => generator_default
29
+ var generator_impl_exports = {};
30
+ __export(generator_impl_exports, {
31
+ default: () => generator_impl_default
32
32
  });
33
- module.exports = __toCommonJS(generator_exports);
33
+ module.exports = __toCommonJS(generator_impl_exports);
34
34
  var import_devkit = require("@nx/devkit");
35
35
  var fs = __toESM(require("fs"));
36
36
  var path = __toESM(require("path"));
@@ -63,7 +63,7 @@ function normalizeOptions(options) {
63
63
  botonicVersion: resolveBotonicVersion(options.botonicVersion)
64
64
  };
65
65
  }
66
- async function generator_default(tree, options) {
66
+ async function generator_impl_default(tree, options) {
67
67
  const normalizedOptions = normalizeOptions(options);
68
68
  const tasks = [];
69
69
  console.log("Configuring existing TypeScript workspace with Botonic...");
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var generator_exports = {};
30
+ __export(generator_exports, {
31
+ default: () => import_generator_impl.default
32
+ });
33
+ module.exports = __toCommonJS(generator_exports);
34
+ var import_generator_impl = __toESM(require("./generator-impl"));
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var generator_exports = {};
20
- __export(generator_exports, {
21
- default: () => generator_default
19
+ var generator_impl_exports = {};
20
+ __export(generator_impl_exports, {
21
+ default: () => generator_impl_default
22
22
  });
23
- module.exports = __toCommonJS(generator_exports);
23
+ module.exports = __toCommonJS(generator_impl_exports);
24
24
  var import_devkit = require("@nx/devkit");
25
25
  function normalizeOptions(tree, options) {
26
26
  const projects = (0, import_devkit.getProjects)(tree);
@@ -212,7 +212,7 @@ function removeFromRoutes(tree, options) {
212
212
  }
213
213
  return found;
214
214
  }
215
- async function generator_default(tree, options) {
215
+ async function generator_impl_default(tree, options) {
216
216
  console.log(`\u{1F5D1}\uFE0F Removing custom message: ${options.name}`);
217
217
  const normalizedOptions = normalizeOptions(tree, options);
218
218
  console.log(`\u{1F4C1} Project: ${normalizedOptions.projectName}`);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var generator_exports = {};
20
+ __export(generator_exports, {
21
+ default: () => generator_default
22
+ });
23
+ module.exports = __toCommonJS(generator_exports);
24
+ var import_delegate_generator = require("../../lib/delegate/delegate-generator");
25
+ async function generator_default(tree, options) {
26
+ return (0, import_delegate_generator.runLocalGenerator)(__filename, "remove-custom-message", tree, options);
27
+ }
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var generator_exports = {};
20
- __export(generator_exports, {
21
- default: () => generator_default
19
+ var generator_impl_exports = {};
20
+ __export(generator_impl_exports, {
21
+ default: () => generator_impl_default
22
22
  });
23
- module.exports = __toCommonJS(generator_exports);
23
+ module.exports = __toCommonJS(generator_impl_exports);
24
24
  var import_devkit = require("@nx/devkit");
25
25
  var import_bot_app_utils = require("../shared/bot-app-utils");
26
26
  const MODULE_DIR = __dirname;
@@ -156,7 +156,7 @@ function updateWebviewsIndex(tree, options) {
156
156
  }
157
157
  tree.write(indexPath, lines.join("\n"));
158
158
  }
159
- async function generator_default(tree, options) {
159
+ async function generator_impl_default(tree, options) {
160
160
  console.log(`Creating webview: ${options.name}`);
161
161
  const normalizedOptions = normalizeOptions(tree, options);
162
162
  console.log(`Project: ${normalizedOptions.projectName}`);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var generator_exports = {};
20
+ __export(generator_exports, {
21
+ default: () => generator_default
22
+ });
23
+ module.exports = __toCommonJS(generator_exports);
24
+ var import_delegate_generator = require("../../lib/delegate/delegate-generator");
25
+ async function generator_default(tree, options) {
26
+ return (0, import_delegate_generator.runLocalGenerator)(__filename, "webview", tree, options);
27
+ }
@@ -42,6 +42,7 @@ var import_executor = __toESM(require("./executors/build-node-app/executor"));
42
42
  var import_executor2 = __toESM(require("./executors/run-lambda/executor"));
43
43
  var import_executor3 = __toESM(require("./executors/serve-bot/executor"));
44
44
  __reExport(src_exports, require("./lib"), module.exports);
45
+ __reExport(src_exports, require("./lib/serve-mode"), module.exports);
45
46
  var import_plugin = require("./plugin");
46
47
  // Annotate the CommonJS export names for ESM import in node:
47
48
  0 && (module.exports = {
@@ -52,5 +53,6 @@ var import_plugin = require("./plugin");
52
53
  serveBotExecutor,
53
54
  ...require("./generators/bot-app/generator"),
54
55
  ...require("./generators/preset/generator"),
55
- ...require("./lib")
56
+ ...require("./lib"),
57
+ ...require("./lib/serve-mode")
56
58
  });
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var delegate_executor_exports = {};
20
+ __export(delegate_executor_exports, {
21
+ runLocalExecutor: () => runLocalExecutor
22
+ });
23
+ module.exports = __toCommonJS(delegate_executor_exports);
24
+ var import_devkit = require("@nx/devkit");
25
+ var import_fs = require("fs");
26
+ var import_path = require("path");
27
+ const DEPTH_VAR = "BOTONIC_NX_PLUGIN_DELEGATION_DEPTH";
28
+ async function runLocalExecutor(wrapperFilename, executorName, options, ctx) {
29
+ const wrapperDir = (0, import_path.dirname)(wrapperFilename);
30
+ const implPath = (0, import_path.join)(wrapperDir, "executor-impl");
31
+ const impl = async () => {
32
+ const mod = await import(
33
+ /* @vite-ignore */
34
+ implPath
35
+ );
36
+ return (mod.default ?? mod)(options, ctx);
37
+ };
38
+ if (process.env[DEPTH_VAR]) return impl();
39
+ const projectRoot = ctx.projectName ? (0, import_path.join)(ctx.root, ctx.projectsConfigurations.projects[ctx.projectName].root) : ctx.root;
40
+ const myPkgJson = resolveSelfPkgJson(wrapperDir);
41
+ if (!myPkgJson) return impl();
42
+ const workspaceVersion = readVersion(myPkgJson);
43
+ let localPkgJson = null;
44
+ try {
45
+ localPkgJson = require.resolve("@botonic/nx-plugin/package.json", {
46
+ paths: [projectRoot]
47
+ });
48
+ } catch {
49
+ import_devkit.logger.info(
50
+ `[@botonic/nx-plugin v${workspaceVersion}] Running executor '${executorName}'`
51
+ );
52
+ return impl();
53
+ }
54
+ if ((0, import_fs.realpathSync)(localPkgJson) === (0, import_fs.realpathSync)(myPkgJson)) {
55
+ import_devkit.logger.info(
56
+ `[@botonic/nx-plugin v${workspaceVersion}] Running executor '${executorName}'`
57
+ );
58
+ return impl();
59
+ }
60
+ const localRoot = (0, import_path.dirname)(localPkgJson);
61
+ const execJsonPath = (0, import_path.join)(localRoot, "executors.json");
62
+ if (!(0, import_fs.existsSync)(execJsonPath)) {
63
+ import_devkit.logger.info(
64
+ `[@botonic/nx-plugin v${workspaceVersion}] Running executor '${executorName}'`
65
+ );
66
+ return impl();
67
+ }
68
+ const execJson = JSON.parse((0, import_fs.readFileSync)(execJsonPath, "utf-8"));
69
+ const entry = execJson?.executors?.[executorName];
70
+ if (!entry?.implementation) {
71
+ import_devkit.logger.info(
72
+ `[@botonic/nx-plugin v${workspaceVersion}] Running executor '${executorName}'`
73
+ );
74
+ return impl();
75
+ }
76
+ const implRelative = entry.implementation;
77
+ const implResolved = require.resolve((0, import_path.join)(localRoot, implRelative));
78
+ const localVersion = readVersion(localPkgJson);
79
+ import_devkit.logger.info(
80
+ `[@botonic/nx-plugin v${workspaceVersion}] Delegating executor '${executorName}' to local v${localVersion}`
81
+ );
82
+ process.env[DEPTH_VAR] = "1";
83
+ try {
84
+ const mod = await import(
85
+ /* @vite-ignore */
86
+ implResolved
87
+ );
88
+ return await (mod.default ?? mod)(options, ctx);
89
+ } finally {
90
+ delete process.env[DEPTH_VAR];
91
+ }
92
+ }
93
+ function readVersion(pkgJsonPath) {
94
+ try {
95
+ return JSON.parse((0, import_fs.readFileSync)(pkgJsonPath, "utf-8")).version ?? "unknown";
96
+ } catch {
97
+ return "unknown";
98
+ }
99
+ }
100
+ function resolveSelfPkgJson(startDir) {
101
+ let dir = startDir;
102
+ while (true) {
103
+ const pkgPath = (0, import_path.join)(dir, "package.json");
104
+ if ((0, import_fs.existsSync)(pkgPath)) {
105
+ try {
106
+ const pkg = JSON.parse((0, import_fs.readFileSync)(pkgPath, "utf-8"));
107
+ if (pkg.name === "@botonic/nx-plugin") return pkgPath;
108
+ } catch {
109
+ }
110
+ }
111
+ const next = (0, import_path.dirname)(dir);
112
+ if (next === dir) return null;
113
+ dir = next;
114
+ }
115
+ }
116
+ // Annotate the CommonJS export names for ESM import in node:
117
+ 0 && (module.exports = {
118
+ runLocalExecutor
119
+ });
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var delegate_generator_exports = {};
20
+ __export(delegate_generator_exports, {
21
+ runLocalGenerator: () => runLocalGenerator
22
+ });
23
+ module.exports = __toCommonJS(delegate_generator_exports);
24
+ var import_devkit = require("@nx/devkit");
25
+ var import_fs = require("fs");
26
+ var import_path = require("path");
27
+ const DEPTH_VAR = "BOTONIC_NX_PLUGIN_DELEGATION_DEPTH";
28
+ async function runLocalGenerator(wrapperFilename, generatorName, tree, options) {
29
+ const wrapperDir = (0, import_path.dirname)(wrapperFilename);
30
+ const implPath = (0, import_path.join)(wrapperDir, "generator-impl");
31
+ const impl = async () => {
32
+ const mod = await import(
33
+ /* @vite-ignore */
34
+ implPath
35
+ );
36
+ return (mod.default ?? mod)(tree, options);
37
+ };
38
+ if (process.env[DEPTH_VAR]) return impl();
39
+ let projectRoot = null;
40
+ const projectName = options.project;
41
+ if (typeof projectName === "string") {
42
+ try {
43
+ const config = (0, import_devkit.readProjectConfiguration)(tree, projectName);
44
+ projectRoot = config.root;
45
+ } catch {
46
+ }
47
+ }
48
+ if (!projectRoot) return impl();
49
+ const myPkgJson = resolveSelfPkgJson(wrapperDir);
50
+ if (!myPkgJson) return impl();
51
+ const workspaceVersion = readVersion(myPkgJson);
52
+ let localPkgJson = null;
53
+ try {
54
+ localPkgJson = require.resolve("@botonic/nx-plugin/package.json", {
55
+ paths: [projectRoot]
56
+ });
57
+ } catch {
58
+ import_devkit.logger.info(
59
+ `[@botonic/nx-plugin v${workspaceVersion}] Running generator '${generatorName}'`
60
+ );
61
+ return impl();
62
+ }
63
+ if ((0, import_fs.realpathSync)(localPkgJson) === (0, import_fs.realpathSync)(myPkgJson)) {
64
+ import_devkit.logger.info(
65
+ `[@botonic/nx-plugin v${workspaceVersion}] Running generator '${generatorName}'`
66
+ );
67
+ return impl();
68
+ }
69
+ const localRoot = (0, import_path.dirname)(localPkgJson);
70
+ const genJsonPath = (0, import_path.join)(localRoot, "generators.json");
71
+ if (!(0, import_fs.existsSync)(genJsonPath)) {
72
+ import_devkit.logger.info(
73
+ `[@botonic/nx-plugin v${workspaceVersion}] Running generator '${generatorName}'`
74
+ );
75
+ return impl();
76
+ }
77
+ const genJson = JSON.parse((0, import_fs.readFileSync)(genJsonPath, "utf-8"));
78
+ const entry = genJson?.generators?.[generatorName];
79
+ if (!entry?.factory) {
80
+ import_devkit.logger.info(
81
+ `[@botonic/nx-plugin v${workspaceVersion}] Running generator '${generatorName}'`
82
+ );
83
+ return impl();
84
+ }
85
+ const factoryRelative = entry.factory;
86
+ const factoryResolved = require.resolve((0, import_path.join)(localRoot, factoryRelative));
87
+ const localVersion = readVersion(localPkgJson);
88
+ import_devkit.logger.info(
89
+ `[@botonic/nx-plugin v${workspaceVersion}] Delegating generator '${generatorName}' to local v${localVersion}`
90
+ );
91
+ process.env[DEPTH_VAR] = "1";
92
+ try {
93
+ const mod = await import(
94
+ /* @vite-ignore */
95
+ factoryResolved
96
+ );
97
+ return await (mod.default ?? mod)(tree, options);
98
+ } finally {
99
+ delete process.env[DEPTH_VAR];
100
+ }
101
+ }
102
+ function readVersion(pkgJsonPath) {
103
+ try {
104
+ return JSON.parse((0, import_fs.readFileSync)(pkgJsonPath, "utf-8")).version ?? "unknown";
105
+ } catch {
106
+ return "unknown";
107
+ }
108
+ }
109
+ function resolveSelfPkgJson(startDir) {
110
+ let dir = startDir;
111
+ while (true) {
112
+ const pkgPath = (0, import_path.join)(dir, "package.json");
113
+ if ((0, import_fs.existsSync)(pkgPath)) {
114
+ try {
115
+ const pkg = JSON.parse((0, import_fs.readFileSync)(pkgPath, "utf-8"));
116
+ if (pkg.name === "@botonic/nx-plugin") return pkgPath;
117
+ } catch {
118
+ }
119
+ }
120
+ const next = (0, import_path.dirname)(dir);
121
+ if (next === dir) return null;
122
+ dir = next;
123
+ }
124
+ }
125
+ // Annotate the CommonJS export names for ESM import in node:
126
+ 0 && (module.exports = {
127
+ runLocalGenerator
128
+ });