@share-crm/sharedev-cli 0.0.4-rc.50-test.1 → 0.0.4-rc.50-test.2
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/sharedev.js +12 -11
- package/package.json +1 -1
package/dist/sharedev.js
CHANGED
|
@@ -14877,7 +14877,10 @@ async function findSharedevPath(startDir) {
|
|
|
14877
14877
|
let currentDir = node_path_1.default.resolve(startDir);
|
|
14878
14878
|
while (true) {
|
|
14879
14879
|
const candidate = node_path_1.default.join(currentDir, SHAREDEV_RELATIVE_PATH);
|
|
14880
|
-
|
|
14880
|
+
// .sharedev 目录必须包含 settings.json 才算已初始化的工作区:
|
|
14881
|
+
// 只存在 .sharedev 目录(如家目录的文档/快照残留)时继续向上查找,
|
|
14882
|
+
// 避免误命中导致 settings 读写与 init 落位跑到错误目录
|
|
14883
|
+
if (await (0, file_ts_1.pathExists)(node_path_1.default.join(candidate, SETTINGS_NAME))) {
|
|
14881
14884
|
return candidate;
|
|
14882
14885
|
}
|
|
14883
14886
|
const parentDir = node_path_1.default.dirname(currentDir);
|
|
@@ -14902,9 +14905,8 @@ async function findSettings(startDir) {
|
|
|
14902
14905
|
return node_path_1.default.join(sharedevPath, SETTINGS_NAME);
|
|
14903
14906
|
}
|
|
14904
14907
|
function validateSettings(settings) {
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
}
|
|
14908
|
+
// certificate 允许为空(工作区可仅以 sharecrm 登录态运行);
|
|
14909
|
+
// FHH 请求在 certificate 缺失时由通道层给出明确引导
|
|
14908
14910
|
if (!settings.domain?.trim()) {
|
|
14909
14911
|
throw new Error('Missing domain in .sharedev/settings.json.');
|
|
14910
14912
|
}
|
|
@@ -14987,7 +14989,7 @@ async function createCliRuntimeContext(_options) {
|
|
|
14987
14989
|
settings = await (0, config_ts_1.loadSettings)(searchDir);
|
|
14988
14990
|
}
|
|
14989
14991
|
catch (error) {
|
|
14990
|
-
// settings
|
|
14992
|
+
// settings 文件缺失或内容损坏时,工作区内存在登录凭证(.sharedev/session.json)则降级为
|
|
14991
14993
|
// 「登录态模式」继续运行(certificate 可为空,业务请求走 open API 通道)。
|
|
14992
14994
|
// 此时 configureSharecrmSession 尚未注入,直接按 .sharedev 目录读取凭证文件。
|
|
14993
14995
|
const sharedevDir = await (0, config_ts_1.findSharedevPath)(searchDir);
|
|
@@ -29457,7 +29459,7 @@ async function collectInitSettings(options) {
|
|
|
29457
29459
|
domain = await askWithDefault('Enter enterprise domain', 'https://www.fxiaoke.com');
|
|
29458
29460
|
}
|
|
29459
29461
|
if (!certificate) {
|
|
29460
|
-
certificate = await askWithDefault('Enter developer certificate');
|
|
29462
|
+
certificate = await askWithDefault('Enter developer certificate (optional — leave empty to use sharecrm login)', '');
|
|
29461
29463
|
}
|
|
29462
29464
|
// if (!developerName) {
|
|
29463
29465
|
// developerName = await askWithDefault('Enter your developer name (optional)');
|
|
@@ -29475,9 +29477,8 @@ async function collectInitSettings(options) {
|
|
|
29475
29477
|
if (!isValidUrl(domain)) {
|
|
29476
29478
|
throw new Error('Invalid enterprise domain URL. Use a full URL, e.g. https://www.fxiaoke.com.');
|
|
29477
29479
|
}
|
|
29478
|
-
|
|
29479
|
-
|
|
29480
|
-
}
|
|
29480
|
+
// certificate 可选:留空时工作区以 sharecrm 登录态运行(sharedev auth login),
|
|
29481
|
+
// FHH 通道命令在未配置时由通道层给出引导
|
|
29481
29482
|
return {
|
|
29482
29483
|
enterpriseEA,
|
|
29483
29484
|
domain,
|
|
@@ -51281,8 +51282,8 @@ async function readCliPackageMeta() {
|
|
|
51281
51282
|
? "@share-crm/sharedev-cli".trim()
|
|
51282
51283
|
: '@share-crm/sharedev-cli';
|
|
51283
51284
|
const debugEnabled = true && Boolean(false);
|
|
51284
|
-
const rawVersion = ( true && "0.0.4-rc.50-test.
|
|
51285
|
-
? "0.0.4-rc.50-test.
|
|
51285
|
+
const rawVersion = ( true && "0.0.4-rc.50-test.2".trim())
|
|
51286
|
+
? "0.0.4-rc.50-test.2".trim()
|
|
51286
51287
|
: '0.0.0';
|
|
51287
51288
|
const version = rawVersion + (debugEnabled ? '-debug' : '');
|
|
51288
51289
|
return { name, version };
|