@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.
- package/CHANGELOG.md +14 -0
- package/index.js +44 -0
- package/{src/executors/build-node-app/executor.js → libs/botonic/nx-plugin/src/executors/build-node-app/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/build-node-app/executor.js +27 -0
- package/{src/executors/delete-bot/executor.js → libs/botonic/nx-plugin/src/executors/delete-bot/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/delete-bot/executor.js +27 -0
- package/{src/executors/deploy-netlify-snapshot/executor.js → libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/deploy-netlify-snapshot/executor.js +27 -0
- package/{src/executors/deploy-to-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/deploy-to-hubtype/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/deploy-to-hubtype/executor.js +27 -0
- package/{src/executors/e2e-webchat/executor.js → libs/botonic/nx-plugin/src/executors/e2e-webchat/executor-impl.js} +5 -5
- package/libs/botonic/nx-plugin/src/executors/e2e-webchat/executor.js +27 -0
- package/{src/executors/integrate-provider/executor.js → libs/botonic/nx-plugin/src/executors/integrate-provider/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/integrate-provider/executor.js +27 -0
- package/{src/executors/login-to-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/login-to-hubtype/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/login-to-hubtype/executor.js +27 -0
- package/{src/executors/logout-from-hubtype/executor.js → libs/botonic/nx-plugin/src/executors/logout-from-hubtype/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/logout-from-hubtype/executor.js +27 -0
- package/{src/executors/run-lambda/executor.js → libs/botonic/nx-plugin/src/executors/run-lambda/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/run-lambda/executor.js +27 -0
- package/{src/executors/serve-bot/executor.js → libs/botonic/nx-plugin/src/executors/serve-bot/executor-impl.js} +3 -3
- package/libs/botonic/nx-plugin/src/executors/serve-bot/executor.js +27 -0
- package/{src/generators/action/generator.js → libs/botonic/nx-plugin/src/generators/action/generator-impl.js} +5 -5
- package/libs/botonic/nx-plugin/src/generators/action/generator.js +27 -0
- package/{src/generators/bot-app/generator.js → libs/botonic/nx-plugin/src/generators/bot-app/generator-impl.js} +6 -5
- package/libs/botonic/nx-plugin/src/generators/bot-app/generator.js +34 -0
- package/{src/generators/custom-message/generator.js → libs/botonic/nx-plugin/src/generators/custom-message/generator-impl.js} +5 -5
- package/libs/botonic/nx-plugin/src/generators/custom-message/generator.js +27 -0
- package/{src/generators/preset/generator.js → libs/botonic/nx-plugin/src/generators/preset/generator-impl.js} +5 -5
- package/libs/botonic/nx-plugin/src/generators/preset/generator.js +34 -0
- package/{src/generators/remove-custom-message/generator.js → libs/botonic/nx-plugin/src/generators/remove-custom-message/generator-impl.js} +5 -5
- package/libs/botonic/nx-plugin/src/generators/remove-custom-message/generator.js +27 -0
- package/{src/generators/webview/generator.js → libs/botonic/nx-plugin/src/generators/webview/generator-impl.js} +5 -5
- package/libs/botonic/nx-plugin/src/generators/webview/generator.js +27 -0
- package/{src → libs/botonic/nx-plugin/src}/index.js +3 -1
- package/libs/botonic/nx-plugin/src/lib/delegate/delegate-executor.js +119 -0
- package/libs/botonic/nx-plugin/src/lib/delegate/delegate-generator.js +128 -0
- package/libs/botonic/nx-plugin/src/lib/serve-mode/index.js +183 -0
- package/migrations.json +1 -8
- package/package.json +7 -4
- package/src/executors/build-node-app/executor-impl.d.ts +5 -0
- package/src/executors/build-node-app/executor.d.ts +4 -2
- package/src/executors/delete-bot/executor-impl.d.ts +5 -0
- package/src/executors/delete-bot/executor.d.ts +4 -2
- package/src/executors/deploy-netlify-snapshot/executor-impl.d.ts +8 -0
- package/src/executors/deploy-netlify-snapshot/executor.d.ts +4 -5
- package/src/executors/deploy-to-hubtype/executor-impl.d.ts +5 -0
- package/src/executors/deploy-to-hubtype/executor.d.ts +4 -2
- package/src/executors/e2e-webchat/executor-impl.d.ts +5 -0
- package/src/executors/e2e-webchat/executor.d.ts +4 -2
- package/src/executors/integrate-provider/executor-impl.d.ts +5 -0
- package/src/executors/integrate-provider/executor.d.ts +4 -2
- package/src/executors/login-to-hubtype/executor-impl.d.ts +5 -0
- package/src/executors/login-to-hubtype/executor.d.ts +4 -2
- package/src/executors/logout-from-hubtype/executor-impl.d.ts +3 -0
- package/src/executors/logout-from-hubtype/executor.d.ts +5 -1
- package/src/executors/run-lambda/executor-impl.d.ts +5 -0
- package/src/executors/run-lambda/executor.d.ts +4 -2
- package/src/executors/serve-bot/executor-impl.d.ts +5 -0
- package/src/executors/serve-bot/executor.d.ts +4 -2
- package/src/generators/action/generator-impl.d.ts +4 -0
- package/src/generators/action/generator.d.ts +2 -3
- package/src/generators/bot-app/files/vite/webchat.config.ts.template +10 -2
- package/src/generators/bot-app/generator-impl.d.ts +4 -0
- package/src/generators/bot-app/generator.d.ts +2 -4
- package/src/generators/custom-message/generator-impl.d.ts +4 -0
- package/src/generators/custom-message/generator.d.ts +2 -3
- package/src/generators/preset/generator-impl.d.ts +4 -0
- package/src/generators/preset/generator.d.ts +2 -4
- package/src/generators/remove-custom-message/generator-impl.d.ts +4 -0
- package/src/generators/remove-custom-message/generator.d.ts +2 -3
- package/src/generators/webview/generator-impl.d.ts +4 -0
- package/src/generators/webview/generator.d.ts +2 -3
- package/src/index.d.ts +1 -0
- package/src/lib/delegate/delegate-executor.d.ts +6 -0
- package/src/lib/delegate/delegate-generator.d.ts +2 -0
- package/src/lib/serve-mode/index.d.ts +25 -0
- package/src/generators/bot-app/files/vite/plugins/dev-log-viewer-html.plugin.ts.template +0 -65
- package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.d.ts +0 -2
- package/src/migrations/install-claude-update-skills/install-claude-update-skills.migration.js +0 -290
- /package/{src → libs/botonic/nx-plugin/src}/executors/build-node-app/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/delete-bot/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/deploy-netlify-snapshot/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/deploy-to-hubtype/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/e2e-webchat/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/integrate-provider/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/login-to-hubtype/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/logout-from-hubtype/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/run-lambda/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/executors/serve-bot/schema.d.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/action/schema.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/bot-app/schema.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/custom-message/schema.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/preset/schema.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/remove-custom-message/schema.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/shared/bot-app-utils.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/generators/webview/schema.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/api-service.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/bot-config.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/cloudflared-tunnel.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/constants.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/credentials-handler.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/index.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/interfaces.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/util/executor-helpers.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/util/file-system.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/util/sam-container-cleanup.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/util/sam-template.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/lib/util/system.js +0 -0
- /package/{src → libs/botonic/nx-plugin/src}/migrations/utils/migration-utils.js +0 -0
- /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
|
|
20
|
-
__export(
|
|
21
|
-
default: () =>
|
|
19
|
+
var generator_impl_exports = {};
|
|
20
|
+
__export(generator_impl_exports, {
|
|
21
|
+
default: () => generator_impl_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
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
|
|
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
|
|
30
|
-
__export(
|
|
31
|
-
default: () =>
|
|
29
|
+
var generator_impl_exports = {};
|
|
30
|
+
__export(generator_impl_exports, {
|
|
31
|
+
default: () => generator_impl_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
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
|
|
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
|
|
20
|
-
__export(
|
|
21
|
-
default: () =>
|
|
19
|
+
var generator_impl_exports = {};
|
|
20
|
+
__export(generator_impl_exports, {
|
|
21
|
+
default: () => generator_impl_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
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
|
|
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
|
|
20
|
-
__export(
|
|
21
|
-
default: () =>
|
|
19
|
+
var generator_impl_exports = {};
|
|
20
|
+
__export(generator_impl_exports, {
|
|
21
|
+
default: () => generator_impl_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
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
|
|
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
|
+
});
|