@sparkelf/dsh-plus-standalone 0.1.0-rc.28 → 0.1.0-rc.30
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/lib/bin.js +35 -0
- package/lib/types/bin.d.ts +20 -0
- package/lib/types/bin.js +38 -0
- package/package.json +5 -2
package/lib/bin.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
//#region lib/types/bin.js
|
|
7
|
+
/**
|
|
8
|
+
* The installed command for a standalone Plus deployment.
|
|
9
|
+
*
|
|
10
|
+
* The CLI lives in \`@sparkelf/dsh-plus\`, but npm installs a command only for the
|
|
11
|
+
* package that declares it: a dependency's \`bin\` becomes a nested entry the shell
|
|
12
|
+
* cannot reach. This package is what a user installs, so it declares the command and
|
|
13
|
+
* forwards every argument to the CLI, keeping one implementation of start, stop,
|
|
14
|
+
* status, update, and doctor.
|
|
15
|
+
*
|
|
16
|
+
* The CLI path comes from that package's own \`bin\` field rather than a literal path,
|
|
17
|
+
* because the package's \`exports\` map does not publish its executable file — only the
|
|
18
|
+
* manifest is reachable by specifier. The resolved file is imported rather than
|
|
19
|
+
* re-executed in a child process, so the CLI runs in this process and its exit code
|
|
20
|
+
* is this exit code.
|
|
21
|
+
*
|
|
22
|
+
* @module @sparkelf/dsh-plus-standalone/bin
|
|
23
|
+
*/
|
|
24
|
+
var __rewriteRelativeImportExtension = function(path, preserveJsx) {
|
|
25
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
26
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
27
|
+
});
|
|
28
|
+
return path;
|
|
29
|
+
};
|
|
30
|
+
const manifestPath = createRequire(import.meta.url).resolve("@sparkelf/dsh-plus/package.json");
|
|
31
|
+
const declared = JSON.parse(readFileSync(manifestPath, "utf8")).bin?.["dsh-plus"];
|
|
32
|
+
if (declared === void 0) throw new Error("@sparkelf/dsh-plus declares no dsh-plus command");
|
|
33
|
+
await import(__rewriteRelativeImportExtension(pathToFileURL(join(dirname(manifestPath), declared)).href));
|
|
34
|
+
//#endregion
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The installed command for a standalone Plus deployment.
|
|
4
|
+
*
|
|
5
|
+
* The CLI lives in \`@sparkelf/dsh-plus\`, but npm installs a command only for the
|
|
6
|
+
* package that declares it: a dependency's \`bin\` becomes a nested entry the shell
|
|
7
|
+
* cannot reach. This package is what a user installs, so it declares the command and
|
|
8
|
+
* forwards every argument to the CLI, keeping one implementation of start, stop,
|
|
9
|
+
* status, update, and doctor.
|
|
10
|
+
*
|
|
11
|
+
* The CLI path comes from that package's own \`bin\` field rather than a literal path,
|
|
12
|
+
* because the package's \`exports\` map does not publish its executable file — only the
|
|
13
|
+
* manifest is reachable by specifier. The resolved file is imported rather than
|
|
14
|
+
* re-executed in a child process, so the CLI runs in this process and its exit code
|
|
15
|
+
* is this exit code.
|
|
16
|
+
*
|
|
17
|
+
* @module @sparkelf/dsh-plus-standalone/bin
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=bin.d.ts.map
|
package/lib/types/bin.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The installed command for a standalone Plus deployment.
|
|
4
|
+
*
|
|
5
|
+
* The CLI lives in \`@sparkelf/dsh-plus\`, but npm installs a command only for the
|
|
6
|
+
* package that declares it: a dependency's \`bin\` becomes a nested entry the shell
|
|
7
|
+
* cannot reach. This package is what a user installs, so it declares the command and
|
|
8
|
+
* forwards every argument to the CLI, keeping one implementation of start, stop,
|
|
9
|
+
* status, update, and doctor.
|
|
10
|
+
*
|
|
11
|
+
* The CLI path comes from that package's own \`bin\` field rather than a literal path,
|
|
12
|
+
* because the package's \`exports\` map does not publish its executable file — only the
|
|
13
|
+
* manifest is reachable by specifier. The resolved file is imported rather than
|
|
14
|
+
* re-executed in a child process, so the CLI runs in this process and its exit code
|
|
15
|
+
* is this exit code.
|
|
16
|
+
*
|
|
17
|
+
* @module @sparkelf/dsh-plus-standalone/bin
|
|
18
|
+
*/
|
|
19
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
20
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
21
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
22
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return path;
|
|
26
|
+
};
|
|
27
|
+
import { readFileSync } from 'node:fs';
|
|
28
|
+
import { createRequire } from 'node:module';
|
|
29
|
+
import { dirname, join } from 'node:path';
|
|
30
|
+
import { pathToFileURL } from 'node:url';
|
|
31
|
+
const require = createRequire(import.meta.url);
|
|
32
|
+
const manifestPath = require.resolve('@sparkelf/dsh-plus/package.json');
|
|
33
|
+
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
34
|
+
const declared = manifest.bin?.['dsh-plus'];
|
|
35
|
+
if (declared === undefined)
|
|
36
|
+
throw new Error('@sparkelf/dsh-plus declares no dsh-plus command');
|
|
37
|
+
await import(__rewriteRelativeImportExtension(pathToFileURL(join(dirname(manifestPath), declared)).href));
|
|
38
|
+
//# sourceMappingURL=bin.js.map
|
package/package.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"bin": {
|
|
3
|
+
"dsh-plus": "lib/bin.js"
|
|
4
|
+
},
|
|
2
5
|
"dependencies": {
|
|
3
6
|
"@changfenhuang/dsh-genui": "0.9.9",
|
|
4
7
|
"@deepseek-ai/dsh": ">=0.1.5-rc.2",
|
|
@@ -10,7 +13,7 @@
|
|
|
10
13
|
"@sparkelf/dsh-officecli": "0.1.2",
|
|
11
14
|
"@sparkelf/dsh-plugin-better-sidebar-office": "0.2.1",
|
|
12
15
|
"@sparkelf/dsh-plugin-supervisor": "0.1.5",
|
|
13
|
-
"@sparkelf/dsh-plus": "0.1.0-rc.
|
|
16
|
+
"@sparkelf/dsh-plus": "0.1.0-rc.30",
|
|
14
17
|
"@sparkelf/dsh-ssh-manager": "0.7.2",
|
|
15
18
|
"@sparkelf/dsh-workbench-vault": "0.1.2",
|
|
16
19
|
"dsh-better-sidebar": "0.19.1",
|
|
@@ -120,5 +123,5 @@
|
|
|
120
123
|
},
|
|
121
124
|
"type": "module",
|
|
122
125
|
"types": "lib/types/index.d.ts",
|
|
123
|
-
"version": "0.1.0-rc.
|
|
126
|
+
"version": "0.1.0-rc.30"
|
|
124
127
|
}
|