@dsh-workbench/adapter-runtime 1.2.3-beta.1 → 1.2.3-beta.10
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/bin/opencli-isolated.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { existsSync, mkdirSync } from 'node:fs';
|
|
|
4
4
|
import { homedir, userInfo } from 'node:os';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { productHomeEnv } from '@dsh-workbench/shared/host';
|
|
7
8
|
|
|
8
9
|
const dshHome = process.env.DSH_HOME?.trim() || join(homedir(), '.dsh');
|
|
9
10
|
const workbenchHome = process.env.DSH_WORKBENCH_HOME?.trim() || join(dshHome, 'workbench');
|
|
@@ -16,13 +17,13 @@ const preload = join(dirname(fileURLToPath(import.meta.url)), 'opencli-node-mode
|
|
|
16
17
|
mkdirSync(isolatedHome, { recursive: true });
|
|
17
18
|
if (!existsSync(main)) {
|
|
18
19
|
process.stderr.write(`dsh-workbench: opencli 的隔离运行时还没装好(${join(root, 'toolchain')})。\n`);
|
|
19
|
-
process.stderr.write('
|
|
20
|
+
process.stderr.write(' 在工作台里打开「启动体检」,在 cli 那一步点重试,装好再回来重试这一下。\n');
|
|
20
21
|
process.exit(127);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const env = {
|
|
24
25
|
...process.env,
|
|
25
|
-
|
|
26
|
+
...productHomeEnv(isolatedHome),
|
|
26
27
|
};
|
|
27
28
|
for (const key of Object.keys(env)) {
|
|
28
29
|
if (key.toLowerCase() === 'npm_config_cache') delete env[key];
|
package/channel/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { OPENCLI_CATALOG_ENV } from '@dsh-workbench/shared/host';
|
|
|
2
2
|
export declare function toolchainDir(): string;
|
|
3
3
|
export { OPENCLI_CATALOG_ENV };
|
|
4
4
|
export declare function toolchainManifestOf(): string;
|
|
5
|
+
export declare function toolchainNpmrcOf(): string;
|
|
5
6
|
export declare function cliCatalogPath(): string;
|
|
6
7
|
export declare function isolatedCommand(): string;
|
|
7
8
|
export { libsPrefix } from '../foundation/paths.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
-
import { OPENCLI_CATALOG_ENV, OPENCLI_PIN } from '@dsh-workbench/shared/host';
|
|
2
|
+
import { DEFAULT_NPM_REGISTRY, OPENCLI_CATALOG_ENV, OPENCLI_PIN, OPENCLI_REGISTRY_ENV, } from '@dsh-workbench/shared/host';
|
|
3
3
|
import { quoteShellArg } from '@dsh-workbench/shared/host';
|
|
4
4
|
import { isolatedRoot, libsPrefix, storeDirFor, toolchainOpencliDir } from '../foundation/paths.js';
|
|
5
5
|
import { OPENCLI_NPM_PACKAGE } from '../foundation/paths.js';
|
|
@@ -14,6 +14,12 @@ export function toolchainManifestOf() {
|
|
|
14
14
|
dependencies: { [OPENCLI_NPM_PACKAGE]: OPENCLI_PIN },
|
|
15
15
|
}, null, 2)}\n`;
|
|
16
16
|
}
|
|
17
|
+
export function toolchainNpmrcOf() {
|
|
18
|
+
const override = process.env[OPENCLI_REGISTRY_ENV]?.trim();
|
|
19
|
+
const asked = override === undefined || override === '' ? DEFAULT_NPM_REGISTRY : override;
|
|
20
|
+
const registry = asked.endsWith('/') ? asked : `${asked}/`;
|
|
21
|
+
return `${OPENCLI_NPM_PACKAGE.split('/')[0]}:registry=${registry}\n`;
|
|
22
|
+
}
|
|
17
23
|
export function cliCatalogPath() {
|
|
18
24
|
const override = process.env[OPENCLI_CATALOG_ENV]?.trim();
|
|
19
25
|
return override === undefined || override === ''
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/adapter-runtime",
|
|
3
|
-
"version": "1.2.3-beta.
|
|
3
|
+
"version": "1.2.3-beta.10",
|
|
4
4
|
"description": "Opencli, browser and data runtime adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"bin"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@dsh-workbench/shared": "1.2.3-beta.
|
|
20
|
+
"@dsh-workbench/shared": "1.2.3-beta.10"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^24.19.0",
|