@botonic/nx-plugin 2.31.0 → 2.32.0-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 (78) hide show
  1. package/migrations.json +1 -8
  2. package/package.json +7 -4
  3. package/src/executors/build-node-app/executor-impl.d.ts +5 -0
  4. package/src/executors/build-node-app/executor-impl.js +65 -0
  5. package/src/executors/build-node-app/executor.d.ts +4 -2
  6. package/src/executors/build-node-app/executor.js +3 -41
  7. package/src/executors/delete-bot/executor-impl.d.ts +5 -0
  8. package/src/executors/delete-bot/executor-impl.js +110 -0
  9. package/src/executors/delete-bot/executor.d.ts +4 -2
  10. package/src/executors/delete-bot/executor.js +3 -86
  11. package/src/executors/deploy-netlify-snapshot/executor-impl.d.ts +8 -0
  12. package/src/executors/deploy-netlify-snapshot/executor-impl.js +79 -0
  13. package/src/executors/deploy-netlify-snapshot/executor.d.ts +4 -5
  14. package/src/executors/deploy-netlify-snapshot/executor.js +3 -55
  15. package/src/executors/deploy-to-hubtype/executor-impl.d.ts +5 -0
  16. package/src/executors/deploy-to-hubtype/executor-impl.js +172 -0
  17. package/src/executors/deploy-to-hubtype/executor.d.ts +4 -2
  18. package/src/executors/deploy-to-hubtype/executor.js +3 -148
  19. package/src/executors/e2e-webchat/executor-impl.d.ts +5 -0
  20. package/src/executors/e2e-webchat/executor-impl.js +134 -0
  21. package/src/executors/e2e-webchat/executor.d.ts +4 -2
  22. package/src/executors/e2e-webchat/executor.js +4 -111
  23. package/src/executors/integrate-provider/executor-impl.d.ts +5 -0
  24. package/src/executors/integrate-provider/executor-impl.js +153 -0
  25. package/src/executors/integrate-provider/executor.d.ts +4 -2
  26. package/src/executors/integrate-provider/executor.js +3 -129
  27. package/src/executors/login-to-hubtype/executor-impl.d.ts +5 -0
  28. package/src/executors/login-to-hubtype/executor-impl.js +77 -0
  29. package/src/executors/login-to-hubtype/executor.d.ts +4 -2
  30. package/src/executors/login-to-hubtype/executor.js +3 -53
  31. package/src/executors/logout-from-hubtype/executor-impl.d.ts +3 -0
  32. package/src/executors/logout-from-hubtype/executor-impl.js +54 -0
  33. package/src/executors/logout-from-hubtype/executor.d.ts +5 -1
  34. package/src/executors/logout-from-hubtype/executor.js +3 -30
  35. package/src/executors/run-lambda/executor-impl.d.ts +5 -0
  36. package/src/executors/run-lambda/executor-impl.js +65 -0
  37. package/src/executors/run-lambda/executor.d.ts +4 -2
  38. package/src/executors/run-lambda/executor.js +3 -41
  39. package/src/executors/serve-bot/executor-impl.d.ts +5 -0
  40. package/src/executors/serve-bot/executor-impl.js +530 -0
  41. package/src/executors/serve-bot/executor.d.ts +4 -2
  42. package/src/executors/serve-bot/executor.js +3 -506
  43. package/src/generators/action/generator-impl.d.ts +4 -0
  44. package/src/generators/action/generator-impl.js +112 -0
  45. package/src/generators/action/generator.d.ts +2 -3
  46. package/src/generators/action/generator.js +2 -87
  47. package/src/generators/bot-app/files/vite/webchat.config.ts.template +10 -2
  48. package/src/generators/bot-app/generator-impl.d.ts +4 -0
  49. package/src/generators/bot-app/generator-impl.js +328 -0
  50. package/src/generators/bot-app/generator.d.ts +2 -4
  51. package/src/generators/bot-app/generator.js +2 -295
  52. package/src/generators/custom-message/generator-impl.d.ts +4 -0
  53. package/src/generators/custom-message/generator-impl.js +235 -0
  54. package/src/generators/custom-message/generator.d.ts +2 -3
  55. package/src/generators/custom-message/generator.js +2 -210
  56. package/src/generators/preset/generator-impl.d.ts +4 -0
  57. package/src/generators/preset/generator-impl.js +127 -0
  58. package/src/generators/preset/generator.d.ts +2 -4
  59. package/src/generators/preset/generator.js +2 -95
  60. package/src/generators/remove-custom-message/generator-impl.d.ts +4 -0
  61. package/src/generators/remove-custom-message/generator-impl.js +259 -0
  62. package/src/generators/remove-custom-message/generator.d.ts +2 -3
  63. package/src/generators/remove-custom-message/generator.js +2 -234
  64. package/src/generators/webview/generator-impl.d.ts +4 -0
  65. package/src/generators/webview/generator-impl.js +179 -0
  66. package/src/generators/webview/generator.d.ts +2 -3
  67. package/src/generators/webview/generator.js +2 -154
  68. package/src/index.d.ts +1 -0
  69. package/src/index.js +3 -1
  70. package/src/lib/delegate/delegate-executor.d.ts +6 -0
  71. package/src/lib/delegate/delegate-executor.js +119 -0
  72. package/src/lib/delegate/delegate-generator.d.ts +2 -0
  73. package/src/lib/delegate/delegate-generator.js +128 -0
  74. package/src/lib/serve-mode/index.d.ts +25 -0
  75. package/src/lib/serve-mode/index.js +183 -0
  76. package/src/generators/bot-app/files/vite/plugins/dev-log-viewer-html.plugin.ts.template +0 -65
  77. package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.d.ts +0 -2
  78. package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.js +0 -290
package/migrations.json CHANGED
@@ -1,10 +1,3 @@
1
1
  {
2
- "generators": {
3
- "install-claude-update-skills": {
4
- "version": "2.29.0",
5
- "description": "Replace .cursor/.claude command stubs with .claude/skills/botonic-update and .claude/skills/botonic-bot-update",
6
- "cli": "nx",
7
- "implementation": "./src/migrations/install-claude-update-skills/install-claude-update-skills.migration"
8
- }
9
- }
2
+ "generators": {}
10
3
  }
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@botonic/nx-plugin",
3
- "version": "2.31.0",
3
+ "version": "2.32.0-alpha.0",
4
4
  "description": "Nx plugin for creating Botonic bot applications",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./src/index.d.ts",
10
- "require": "./src/index.js"
10
+ "require": "./src/index.js",
11
+ "import": "./src/index.js",
12
+ "default": "./src/index.js"
11
13
  },
12
14
  "./generators.json": "./generators.json",
13
15
  "./executors.json": "./executors.json",
14
16
  "./migrations.json": "./migrations.json",
15
- "./package.json": "./package.json"
17
+ "./package.json": "./package.json",
18
+ "./serve-mode/serve-mode.js": "./serve-mode/serve-mode.js"
16
19
  },
17
20
  "generators": "./generators.json",
18
21
  "executors": "./executors.json",
@@ -52,4 +55,4 @@
52
55
  "publishConfig": {
53
56
  "access": "public"
54
57
  }
55
- }
58
+ }
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { BuildNodeAppExecutorSchema } from './schema';
3
+ export default function buildNodeAppExecutor(options: BuildNodeAppExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -0,0 +1,65 @@
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 executor_impl_exports = {};
20
+ __export(executor_impl_exports, {
21
+ default: () => buildNodeAppExecutor
22
+ });
23
+ module.exports = __toCommonJS(executor_impl_exports);
24
+ var import_child_process = require("child_process");
25
+ var import_path = require("path");
26
+ var import_util = require("util");
27
+ async function buildNodeAppExecutor(options, context) {
28
+ if (!context.projectName) {
29
+ throw new Error("Project name is required");
30
+ }
31
+ const projectRoot = context.projectsConfigurations?.projects?.[context.projectName]?.root;
32
+ if (!projectRoot) {
33
+ throw new Error(`Could not find project root for ${context.projectName}`);
34
+ }
35
+ const configPath = options.configPath || "vite.config.ts";
36
+ const buildTarget = options.buildTarget || "node";
37
+ const watch = options.watch || false;
38
+ const fullConfigPath = (0, import_path.join)(context.root, projectRoot, configPath);
39
+ console.info(`\u{1F528} Building Node.js app...`);
40
+ console.info(`\u{1F4C1} Project: ${context.projectName}`);
41
+ console.info(`\u2699\uFE0F Config: ${fullConfigPath}`);
42
+ console.info(`\u{1F3AF} Target: ${buildTarget}`);
43
+ console.info(`\u{1F440} Watch mode: ${watch ? "enabled" : "disabled"}`);
44
+ try {
45
+ const watchFlag = watch ? "--watch" : "";
46
+ const command = `VITE_CJS_IGNORE_WARNING=true BUILD_TARGET=${buildTarget} vite build --config ${fullConfigPath} ${watchFlag}`.trim();
47
+ console.info(`\u{1F680} Running: ${command}`);
48
+ const { stdout, stderr } = await (0, import_util.promisify)(import_child_process.exec)(command, {
49
+ cwd: context.root
50
+ });
51
+ if (stdout) {
52
+ console.log(stdout);
53
+ }
54
+ if (stderr) {
55
+ console.error(stderr);
56
+ throw new Error(stderr);
57
+ }
58
+ console.info(`\u2705 Build completed successfully!`);
59
+ return { success: true };
60
+ } catch (error) {
61
+ const errorMessage = error instanceof Error ? error.message : String(error);
62
+ console.error(`\u274C Error building Node.js app:`, errorMessage);
63
+ return { success: false };
64
+ }
65
+ }
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { BuildNodeAppExecutorSchema } from './schema';
3
- export default function buildNodeAppExecutor(options: BuildNodeAppExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function buildNodeAppExecutor(options: BuildNodeAppExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -21,45 +21,7 @@ __export(executor_exports, {
21
21
  default: () => buildNodeAppExecutor
22
22
  });
23
23
  module.exports = __toCommonJS(executor_exports);
24
- var import_child_process = require("child_process");
25
- var import_path = require("path");
26
- var import_util = require("util");
27
- async function buildNodeAppExecutor(options, context) {
28
- if (!context.projectName) {
29
- throw new Error("Project name is required");
30
- }
31
- const projectRoot = context.projectsConfigurations?.projects?.[context.projectName]?.root;
32
- if (!projectRoot) {
33
- throw new Error(`Could not find project root for ${context.projectName}`);
34
- }
35
- const configPath = options.configPath || "vite.config.ts";
36
- const buildTarget = options.buildTarget || "node";
37
- const watch = options.watch || false;
38
- const fullConfigPath = (0, import_path.join)(context.root, projectRoot, configPath);
39
- console.info(`\u{1F528} Building Node.js app...`);
40
- console.info(`\u{1F4C1} Project: ${context.projectName}`);
41
- console.info(`\u2699\uFE0F Config: ${fullConfigPath}`);
42
- console.info(`\u{1F3AF} Target: ${buildTarget}`);
43
- console.info(`\u{1F440} Watch mode: ${watch ? "enabled" : "disabled"}`);
44
- try {
45
- const watchFlag = watch ? "--watch" : "";
46
- const command = `VITE_CJS_IGNORE_WARNING=true BUILD_TARGET=${buildTarget} vite build --config ${fullConfigPath} ${watchFlag}`.trim();
47
- console.info(`\u{1F680} Running: ${command}`);
48
- const { stdout, stderr } = await (0, import_util.promisify)(import_child_process.exec)(command, {
49
- cwd: context.root
50
- });
51
- if (stdout) {
52
- console.log(stdout);
53
- }
54
- if (stderr) {
55
- console.error(stderr);
56
- throw new Error(stderr);
57
- }
58
- console.info(`\u2705 Build completed successfully!`);
59
- return { success: true };
60
- } catch (error) {
61
- const errorMessage = error instanceof Error ? error.message : String(error);
62
- console.error(`\u274C Error building Node.js app:`, errorMessage);
63
- return { success: false };
64
- }
24
+ var import_delegate_executor = require("../../lib/delegate/delegate-executor");
25
+ async function buildNodeAppExecutor(options, ctx) {
26
+ return (0, import_delegate_executor.runLocalExecutor)(__filename, "build-node-app", options, ctx);
65
27
  }
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { DeleteBotExecutorSchema } from './schema';
3
+ export default function deleteBotExecutor(options: DeleteBotExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;
@@ -0,0 +1,110 @@
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 executor_impl_exports = {};
20
+ __export(executor_impl_exports, {
21
+ default: () => deleteBotExecutor
22
+ });
23
+ module.exports = __toCommonJS(executor_impl_exports);
24
+ var import_enquirer = require("enquirer");
25
+ var import_api_service = require("../../lib/api-service");
26
+ var import_executor_helpers = require("../../lib/util/executor-helpers");
27
+ async function deleteBotExecutor(options, context) {
28
+ if (!context.projectName) {
29
+ throw new Error("Project name is not defined in executor context");
30
+ }
31
+ try {
32
+ const { targetEnvironment, environmentVariables } = (0, import_executor_helpers.resolveHubtypeEnvironment)(context, options);
33
+ const botonicApiService = new import_api_service.BotonicAPIService({
34
+ environmentVariables,
35
+ targetEnvironment
36
+ });
37
+ if (!botonicApiService.oauth) {
38
+ if (options.email && options.password) {
39
+ await botonicApiService.login(options.email, options.password);
40
+ botonicApiService.saveAllCredentials();
41
+ } else {
42
+ await (0, import_executor_helpers.handleAuthentication)(botonicApiService);
43
+ }
44
+ }
45
+ await (0, import_executor_helpers.logWorkingAsAndEnvironment)(botonicApiService);
46
+ console.log(
47
+ `\u{1F5D1}\uFE0F Deleting bot from Hubtype... [${environmentVariables["VITE_HUBTYPE_API_URL"]}]
48
+ `
49
+ );
50
+ const botToDelete = await findBotToDelete(botonicApiService, options);
51
+ if (!botToDelete) {
52
+ console.log("\u274C No bot found to delete");
53
+ return { success: false };
54
+ }
55
+ if (!options.skipConfirmation) {
56
+ const response = await (0, import_enquirer.prompt)({
57
+ type: "confirm",
58
+ name: "confirm_delete",
59
+ message: `\u26A0\uFE0F Are you sure you want to delete bot "${botToDelete.name}" (ID: ${botToDelete.id})? This action cannot be undone.`
60
+ });
61
+ if (!response.confirm_delete) {
62
+ console.log("\u274C Deletion cancelled");
63
+ return { success: false };
64
+ }
65
+ }
66
+ console.log(
67
+ `\u{1F5D1}\uFE0F Deleting bot "${botToDelete.name}" (ID: ${botToDelete.id})...`
68
+ );
69
+ await botonicApiService.deleteBot(botToDelete.id);
70
+ console.log(`\u2705 Bot "${botToDelete.name}" deleted successfully!`);
71
+ return { success: true };
72
+ } catch (error) {
73
+ return (0, import_executor_helpers.handleExecutorError)(error, "Delete bot");
74
+ }
75
+ }
76
+ async function findBotToDelete(botonicApiService, options) {
77
+ const bots = await (0, import_executor_helpers.getAvailableBots)(botonicApiService);
78
+ if (options.botId) {
79
+ const bot = bots.find((b) => b.id === options.botId);
80
+ if (bot) {
81
+ return { id: bot.id, name: bot.name };
82
+ }
83
+ console.log(`\u274C Bot with ID "${options.botId}" not found`);
84
+ return null;
85
+ }
86
+ if (options.botName) {
87
+ const bot = bots.find((b) => b.name === options.botName);
88
+ if (bot) {
89
+ return { id: bot.id, name: bot.name };
90
+ }
91
+ console.log(`\u274C Bot with name "${options.botName}" not found`);
92
+ return null;
93
+ }
94
+ if (!bots.length) {
95
+ console.log("No bots available to delete");
96
+ return null;
97
+ }
98
+ const response = await (0, import_enquirer.prompt)({
99
+ type: "select",
100
+ name: "bot_to_delete",
101
+ message: "\u{1F5D1}\uFE0F Select a bot to delete:",
102
+ choices: bots.map((bot) => ({
103
+ name: bot.id,
104
+ message: `${bot.name} (ID: ${bot.id})`
105
+ }))
106
+ });
107
+ const selectedBotId = response.bot_to_delete;
108
+ const selectedBot = bots.find((bot) => bot.id === selectedBotId);
109
+ return selectedBot ? { id: selectedBot.id, name: selectedBot.name } : null;
110
+ }
@@ -1,5 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { DeleteBotExecutorSchema } from './schema';
3
- export default function deleteBotExecutor(options: DeleteBotExecutorSchema, context: ExecutorContext): Promise<{
3
+ export default function deleteBotExecutor(options: DeleteBotExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- }>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -21,90 +21,7 @@ __export(executor_exports, {
21
21
  default: () => deleteBotExecutor
22
22
  });
23
23
  module.exports = __toCommonJS(executor_exports);
24
- var import_enquirer = require("enquirer");
25
- var import_api_service = require("../../lib/api-service");
26
- var import_executor_helpers = require("../../lib/util/executor-helpers");
27
- async function deleteBotExecutor(options, context) {
28
- if (!context.projectName) {
29
- throw new Error("Project name is not defined in executor context");
30
- }
31
- try {
32
- const { targetEnvironment, environmentVariables } = (0, import_executor_helpers.resolveHubtypeEnvironment)(context, options);
33
- const botonicApiService = new import_api_service.BotonicAPIService({
34
- environmentVariables,
35
- targetEnvironment
36
- });
37
- if (!botonicApiService.oauth) {
38
- if (options.email && options.password) {
39
- await botonicApiService.login(options.email, options.password);
40
- botonicApiService.saveAllCredentials();
41
- } else {
42
- await (0, import_executor_helpers.handleAuthentication)(botonicApiService);
43
- }
44
- }
45
- await (0, import_executor_helpers.logWorkingAsAndEnvironment)(botonicApiService);
46
- console.log(
47
- `\u{1F5D1}\uFE0F Deleting bot from Hubtype... [${environmentVariables["VITE_HUBTYPE_API_URL"]}]
48
- `
49
- );
50
- const botToDelete = await findBotToDelete(botonicApiService, options);
51
- if (!botToDelete) {
52
- console.log("\u274C No bot found to delete");
53
- return { success: false };
54
- }
55
- if (!options.skipConfirmation) {
56
- const response = await (0, import_enquirer.prompt)({
57
- type: "confirm",
58
- name: "confirm_delete",
59
- message: `\u26A0\uFE0F Are you sure you want to delete bot "${botToDelete.name}" (ID: ${botToDelete.id})? This action cannot be undone.`
60
- });
61
- if (!response.confirm_delete) {
62
- console.log("\u274C Deletion cancelled");
63
- return { success: false };
64
- }
65
- }
66
- console.log(
67
- `\u{1F5D1}\uFE0F Deleting bot "${botToDelete.name}" (ID: ${botToDelete.id})...`
68
- );
69
- await botonicApiService.deleteBot(botToDelete.id);
70
- console.log(`\u2705 Bot "${botToDelete.name}" deleted successfully!`);
71
- return { success: true };
72
- } catch (error) {
73
- return (0, import_executor_helpers.handleExecutorError)(error, "Delete bot");
74
- }
75
- }
76
- async function findBotToDelete(botonicApiService, options) {
77
- const bots = await (0, import_executor_helpers.getAvailableBots)(botonicApiService);
78
- if (options.botId) {
79
- const bot = bots.find((b) => b.id === options.botId);
80
- if (bot) {
81
- return { id: bot.id, name: bot.name };
82
- }
83
- console.log(`\u274C Bot with ID "${options.botId}" not found`);
84
- return null;
85
- }
86
- if (options.botName) {
87
- const bot = bots.find((b) => b.name === options.botName);
88
- if (bot) {
89
- return { id: bot.id, name: bot.name };
90
- }
91
- console.log(`\u274C Bot with name "${options.botName}" not found`);
92
- return null;
93
- }
94
- if (!bots.length) {
95
- console.log("No bots available to delete");
96
- return null;
97
- }
98
- const response = await (0, import_enquirer.prompt)({
99
- type: "select",
100
- name: "bot_to_delete",
101
- message: "\u{1F5D1}\uFE0F Select a bot to delete:",
102
- choices: bots.map((bot) => ({
103
- name: bot.id,
104
- message: `${bot.name} (ID: ${bot.id})`
105
- }))
106
- });
107
- const selectedBotId = response.bot_to_delete;
108
- const selectedBot = bots.find((bot) => bot.id === selectedBotId);
109
- return selectedBot ? { id: selectedBot.id, name: selectedBot.name } : null;
24
+ var import_delegate_executor = require("../../lib/delegate/delegate-executor");
25
+ async function deleteBotExecutor(options, ctx) {
26
+ return (0, import_delegate_executor.runLocalExecutor)(__filename, "delete-bot", options, ctx);
110
27
  }
@@ -0,0 +1,8 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { DeployNetlifySnapshotExecutorSchema } from './schema';
3
+ export interface DeployNetlifySnapshotResult {
4
+ success: boolean;
5
+ deployUrl?: string;
6
+ claimUrl?: string;
7
+ }
8
+ export default function deployNetlifySnapshotExecutor(options: DeployNetlifySnapshotExecutorSchema, context: ExecutorContext): Promise<DeployNetlifySnapshotResult>;
@@ -0,0 +1,79 @@
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 executor_impl_exports = {};
20
+ __export(executor_impl_exports, {
21
+ default: () => deployNetlifySnapshotExecutor
22
+ });
23
+ module.exports = __toCommonJS(executor_impl_exports);
24
+ var import_child_process = require("child_process");
25
+ var import_fs = require("fs");
26
+ var import_path = require("path");
27
+ async function deployNetlifySnapshotExecutor(options, context) {
28
+ const siteId = options.siteId || process.env["BOTONIC_E2E_NETLIFY_SITE_ID"];
29
+ const authToken = options.authToken || process.env["NETLIFY_AUTH_TOKEN"];
30
+ const alias = options.alias || `deploy-${Date.now()}`;
31
+ if (!siteId) {
32
+ console.error(
33
+ "\u274C No Netlify site ID provided. Pass --siteId or set BOTONIC_E2E_NETLIFY_SITE_ID env var."
34
+ );
35
+ return { success: false };
36
+ }
37
+ if (!authToken) {
38
+ console.error(
39
+ "\u274C No Netlify auth token provided. Pass --authToken or set NETLIFY_AUTH_TOKEN env var."
40
+ );
41
+ return { success: false };
42
+ }
43
+ const projectRoot = context.projectsConfigurations?.projects[context.projectName ?? ""]?.root ?? "";
44
+ const dir = (0, import_path.resolve)(context.root, projectRoot, options.dir);
45
+ if (!(0, import_fs.existsSync)(dir)) {
46
+ console.error(`\u274C Deploy directory does not exist: ${dir}`);
47
+ return { success: false };
48
+ }
49
+ const deployArgs = [
50
+ `--dir="${dir}"`,
51
+ `--site="${siteId}"`,
52
+ `--auth="${authToken}"`,
53
+ "--json"
54
+ ];
55
+ if (options.prod) {
56
+ deployArgs.push("--prod");
57
+ } else {
58
+ deployArgs.push(`--alias="${alias}"`);
59
+ }
60
+ console.log(`\u{1F680} Deploying ${dir} to Netlify...`);
61
+ console.log(` Site: ${siteId}`);
62
+ console.log(` Alias: ${options.prod ? "production" : alias}`);
63
+ try {
64
+ const output = (0, import_child_process.execSync)(`npx netlify-cli deploy ${deployArgs.join(" ")}`, {
65
+ encoding: "utf-8",
66
+ stdio: ["pipe", "pipe", "inherit"],
67
+ cwd: dir
68
+ });
69
+ const result = JSON.parse(output);
70
+ const deployUrl = result.deploy_url || result.url;
71
+ console.log(`\u2705 Snapshot deployed successfully!`);
72
+ console.log(` Deploy URL: ${deployUrl}`);
73
+ console.log(`NETLIFY_DEPLOY_URL=${deployUrl}`);
74
+ return { success: true, deployUrl, claimUrl: result.claim_url };
75
+ } catch (error) {
76
+ console.error(`\u274C Netlify deploy failed: ${error.message}`);
77
+ return { success: false };
78
+ }
79
+ }
@@ -1,8 +1,7 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { DeployNetlifySnapshotExecutorSchema } from './schema';
3
- export interface DeployNetlifySnapshotResult {
3
+ export default function deployNetlifySnapshotExecutor(options: DeployNetlifySnapshotExecutorSchema, ctx: ExecutorContext): Promise<{
4
4
  success: boolean;
5
- deployUrl?: string;
6
- claimUrl?: string;
7
- }
8
- export default function deployNetlifySnapshotExecutor(options: DeployNetlifySnapshotExecutorSchema, context: ExecutorContext): Promise<DeployNetlifySnapshotResult>;
5
+ } | AsyncIterableIterator<{
6
+ success: boolean;
7
+ }>>;
@@ -21,59 +21,7 @@ __export(executor_exports, {
21
21
  default: () => deployNetlifySnapshotExecutor
22
22
  });
23
23
  module.exports = __toCommonJS(executor_exports);
24
- var import_child_process = require("child_process");
25
- var import_fs = require("fs");
26
- var import_path = require("path");
27
- async function deployNetlifySnapshotExecutor(options, context) {
28
- const siteId = options.siteId || process.env["BOTONIC_E2E_NETLIFY_SITE_ID"];
29
- const authToken = options.authToken || process.env["NETLIFY_AUTH_TOKEN"];
30
- const alias = options.alias || `deploy-${Date.now()}`;
31
- if (!siteId) {
32
- console.error(
33
- "\u274C No Netlify site ID provided. Pass --siteId or set BOTONIC_E2E_NETLIFY_SITE_ID env var."
34
- );
35
- return { success: false };
36
- }
37
- if (!authToken) {
38
- console.error(
39
- "\u274C No Netlify auth token provided. Pass --authToken or set NETLIFY_AUTH_TOKEN env var."
40
- );
41
- return { success: false };
42
- }
43
- const projectRoot = context.projectsConfigurations?.projects[context.projectName ?? ""]?.root ?? "";
44
- const dir = (0, import_path.resolve)(context.root, projectRoot, options.dir);
45
- if (!(0, import_fs.existsSync)(dir)) {
46
- console.error(`\u274C Deploy directory does not exist: ${dir}`);
47
- return { success: false };
48
- }
49
- const deployArgs = [
50
- `--dir="${dir}"`,
51
- `--site="${siteId}"`,
52
- `--auth="${authToken}"`,
53
- "--json"
54
- ];
55
- if (options.prod) {
56
- deployArgs.push("--prod");
57
- } else {
58
- deployArgs.push(`--alias="${alias}"`);
59
- }
60
- console.log(`\u{1F680} Deploying ${dir} to Netlify...`);
61
- console.log(` Site: ${siteId}`);
62
- console.log(` Alias: ${options.prod ? "production" : alias}`);
63
- try {
64
- const output = (0, import_child_process.execSync)(`npx netlify-cli deploy ${deployArgs.join(" ")}`, {
65
- encoding: "utf-8",
66
- stdio: ["pipe", "pipe", "inherit"],
67
- cwd: dir
68
- });
69
- const result = JSON.parse(output);
70
- const deployUrl = result.deploy_url || result.url;
71
- console.log(`\u2705 Snapshot deployed successfully!`);
72
- console.log(` Deploy URL: ${deployUrl}`);
73
- console.log(`NETLIFY_DEPLOY_URL=${deployUrl}`);
74
- return { success: true, deployUrl, claimUrl: result.claim_url };
75
- } catch (error) {
76
- console.error(`\u274C Netlify deploy failed: ${error.message}`);
77
- return { success: false };
78
- }
24
+ var import_delegate_executor = require("../../lib/delegate/delegate-executor");
25
+ async function deployNetlifySnapshotExecutor(options, ctx) {
26
+ return (0, import_delegate_executor.runLocalExecutor)(__filename, "deploy-netlify-snapshot", options, ctx);
79
27
  }
@@ -0,0 +1,5 @@
1
+ import type { ExecutorContext } from '@nx/devkit';
2
+ import type { DeployToHubtypeExecutorSchema } from './schema';
3
+ export default function deployToHubtypeExecutor(options: DeployToHubtypeExecutorSchema, context: ExecutorContext): Promise<{
4
+ success: boolean;
5
+ }>;