@chatbotkit/cli 1.27.0 → 1.27.1
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/dist/cjs/loader/hooks.cjs +12 -1
- package/dist/esm/loader/hooks.js +12 -1
- package/package.json +1 -1
|
@@ -5,7 +5,18 @@ const fs_1 = require("fs");
|
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const url_1 = require("url");
|
|
7
7
|
const __dirname = (0, path_1.dirname)((0, url_1.fileURLToPath)(import.meta.url));
|
|
8
|
-
|
|
8
|
+
function findCliRoot() {
|
|
9
|
+
let root = (0, path_1.join)(__dirname, '..', '..');
|
|
10
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(root, 'package.json'))) {
|
|
11
|
+
return root;
|
|
12
|
+
}
|
|
13
|
+
root = (0, path_1.join)(__dirname, '..', '..', '..');
|
|
14
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(root, 'package.json'))) {
|
|
15
|
+
return root;
|
|
16
|
+
}
|
|
17
|
+
return (0, path_1.join)(__dirname, '..', '..');
|
|
18
|
+
}
|
|
19
|
+
const cliRoot = findCliRoot();
|
|
9
20
|
const cliNodeModules = (0, path_1.join)(cliRoot, 'node_modules');
|
|
10
21
|
function resolvePackageExport(packagePath, subpath) {
|
|
11
22
|
const packageJsonPath = (0, path_1.join)(packagePath, 'package.json');
|
package/dist/esm/loader/hooks.js
CHANGED
|
@@ -2,7 +2,18 @@ import { existsSync, readFileSync } from 'fs';
|
|
|
2
2
|
import { dirname, join } from 'path';
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
4
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
|
|
5
|
+
function findCliRoot() {
|
|
6
|
+
let root = join(__dirname, '..', '..');
|
|
7
|
+
if (existsSync(join(root, 'package.json'))) {
|
|
8
|
+
return root;
|
|
9
|
+
}
|
|
10
|
+
root = join(__dirname, '..', '..', '..');
|
|
11
|
+
if (existsSync(join(root, 'package.json'))) {
|
|
12
|
+
return root;
|
|
13
|
+
}
|
|
14
|
+
return join(__dirname, '..', '..');
|
|
15
|
+
}
|
|
16
|
+
const cliRoot = findCliRoot();
|
|
6
17
|
const cliNodeModules = join(cliRoot, 'node_modules');
|
|
7
18
|
function resolvePackageExport(packagePath, subpath) {
|
|
8
19
|
const packageJsonPath = join(packagePath, 'package.json');
|