@ghini/xstart 26.1.6203852 → 26.1.6205313

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/utils.ts
2
- import { normalize, join, isAbsolute, sep, dirname } from "node:path";
2
+ import { normalize, join, isAbsolute, sep, dirname } from "path";
3
3
  var exefile = process.env.KIT_EXEPATH || process.env.KIT_EXEFILE || process.argv[1] || "";
4
4
  var exedir = dirname(exefile);
5
5
  function xpath(targetPath = ".", basePath = exedir, separator = "/") {
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/utils.ts"],
4
- "sourcesContent": ["// src/utils.ts\nimport {normalize, join, isAbsolute, sep, dirname} from 'node:path';\n\nexport {xpath, exefile, exedir};\n\n/** \u6267\u884C\u6587\u4EF6\u8DEF\u5F84\uFF0C\u652F\u6301 pm2 \u7B49\u5DE5\u5177\u901A\u8FC7\u73AF\u5883\u53D8\u91CF\u8986\u76D6 */\nconst exefile = process.env.KIT_EXEPATH || process.env.KIT_EXEFILE || process.argv[1] || '';\n\n/** \u6267\u884C\u6587\u4EF6\u6240\u5728\u76EE\u5F55 */\nconst exedir = dirname(exefile);\n\n/**\n * \u5F3A\u5927\u53EF\u9760\u7684\u8DEF\u5F84\u5904\u7406\n * - \u76F8\u5BF9\u8DEF\u5F84\u5728\u540E\uFF0C\u7EDD\u5BF9\u8DEF\u5F84\u5728\u524D\uFF0C\u6700\u7EC8\u90FD\u8F6C\u6362\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\n * - \u7EDF\u4E00\u5206\u9694\u7B26\uFF0C\u65B9\u4FBF\u6BD4\u8F83\u8DEF\u5F84\n * - \u81EA\u52A8\u5904\u7406 file:/// \u534F\u8BAE\u3001../\u88C1\u5207\u7B49\n * @param targetPath - \u76EE\u6807\u8DEF\u5F84\uFF08\u53EF\u4EE5\u662F\u76F8\u5BF9\u8DEF\u5F84\u6216\u7EDD\u5BF9\u8DEF\u5F84\uFF09\n * @param basePath - \u57FA\u51C6\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A process.cwd()\n * @param separator - \u8DEF\u5F84\u5206\u9694\u7B26\uFF0C\u9ED8\u8BA4\u4E3A '/'\n */\nfunction xpath(targetPath: string = '.', basePath: string = exedir, separator: '/' | '\\\\' = '/'): string {\n // \u5904\u7406 file:/// \u534F\u8BAE\n const stripFileProtocol = (p: string): string => {\n if (p.startsWith('file:///')) {\n // Windows: file:///C:/path \u2192 C:/path (\u53BB\u63898\u4E2A\u5B57\u7B26)\n // Unix: file:///path \u2192 /path (\u53BB\u63897\u4E2A\u5B57\u7B26)\n return process.platform === 'win32' ? p.slice(8) : p.slice(7);\n }\n return p;\n };\n\n // \u5904\u7406 basePath\n let resolvedBase = stripFileProtocol(basePath);\n if (!isAbsolute(resolvedBase)) {\n resolvedBase = join(process.cwd(), resolvedBase);\n }\n\n // \u5904\u7406 targetPath\n let result: string;\n const cleanTarget = stripFileProtocol(targetPath);\n\n if (isAbsolute(cleanTarget)) {\n result = normalize(cleanTarget);\n } else {\n result = normalize(join(resolvedBase, cleanTarget));\n }\n\n // \u7EDF\u4E00\u5206\u9694\u7B26\n if (separator === '/' && sep === '\\\\') {\n return result.split(sep).join('/');\n }\n if (separator === '\\\\' && sep === '/') {\n return result.split(sep).join('\\\\');\n }\n return result;\n}\n"],
4
+ "sourcesContent": ["// src/utils.ts\nimport {normalize, join, isAbsolute, sep, dirname} from 'path';\n\nexport {xpath, exefile, exedir};\n\n/** \u6267\u884C\u6587\u4EF6\u8DEF\u5F84\uFF0C\u652F\u6301 pm2 \u7B49\u5DE5\u5177\u901A\u8FC7\u73AF\u5883\u53D8\u91CF\u8986\u76D6 */\nconst exefile = process.env.KIT_EXEPATH || process.env.KIT_EXEFILE || process.argv[1] || '';\n\n/** \u6267\u884C\u6587\u4EF6\u6240\u5728\u76EE\u5F55 */\nconst exedir = dirname(exefile);\n\n/**\n * \u5F3A\u5927\u53EF\u9760\u7684\u8DEF\u5F84\u5904\u7406\n * - \u76F8\u5BF9\u8DEF\u5F84\u5728\u540E\uFF0C\u7EDD\u5BF9\u8DEF\u5F84\u5728\u524D\uFF0C\u6700\u7EC8\u90FD\u8F6C\u6362\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\n * - \u7EDF\u4E00\u5206\u9694\u7B26\uFF0C\u65B9\u4FBF\u6BD4\u8F83\u8DEF\u5F84\n * - \u81EA\u52A8\u5904\u7406 file:/// \u534F\u8BAE\u3001../\u88C1\u5207\u7B49\n * @param targetPath - \u76EE\u6807\u8DEF\u5F84\uFF08\u53EF\u4EE5\u662F\u76F8\u5BF9\u8DEF\u5F84\u6216\u7EDD\u5BF9\u8DEF\u5F84\uFF09\n * @param basePath - \u57FA\u51C6\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A process.cwd()\n * @param separator - \u8DEF\u5F84\u5206\u9694\u7B26\uFF0C\u9ED8\u8BA4\u4E3A '/'\n */\nfunction xpath(targetPath: string = '.', basePath: string = exedir, separator: '/' | '\\\\' = '/'): string {\n // \u5904\u7406 file:/// \u534F\u8BAE\n const stripFileProtocol = (p: string): string => {\n if (p.startsWith('file:///')) {\n // Windows: file:///C:/path \u2192 C:/path (\u53BB\u63898\u4E2A\u5B57\u7B26)\n // Unix: file:///path \u2192 /path (\u53BB\u63897\u4E2A\u5B57\u7B26)\n return process.platform === 'win32' ? p.slice(8) : p.slice(7);\n }\n return p;\n };\n\n // \u5904\u7406 basePath\n let resolvedBase = stripFileProtocol(basePath);\n if (!isAbsolute(resolvedBase)) {\n resolvedBase = join(process.cwd(), resolvedBase);\n }\n\n // \u5904\u7406 targetPath\n let result: string;\n const cleanTarget = stripFileProtocol(targetPath);\n\n if (isAbsolute(cleanTarget)) {\n result = normalize(cleanTarget);\n } else {\n result = normalize(join(resolvedBase, cleanTarget));\n }\n\n // \u7EDF\u4E00\u5206\u9694\u7B26\n if (separator === '/' && sep === '\\\\') {\n return result.split(sep).join('/');\n }\n if (separator === '\\\\' && sep === '/') {\n return result.split(sep).join('\\\\');\n }\n return result;\n}\n"],
5
5
  "mappings": ";AACA,SAAQ,WAAW,MAAM,YAAY,KAAK,eAAc;AAKxD,IAAM,UAAU,QAAQ,IAAI,eAAe,QAAQ,IAAI,eAAe,QAAQ,KAAK,CAAC,KAAK;AAGzF,IAAM,SAAS,QAAQ,OAAO;AAW9B,SAAS,MAAM,aAAqB,KAAK,WAAmB,QAAQ,YAAwB,KAAa;AAEvG,QAAM,oBAAoB,CAAC,MAAsB;AAC/C,QAAI,EAAE,WAAW,UAAU,GAAG;AAG5B,aAAO,QAAQ,aAAa,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,kBAAkB,QAAQ;AAC7C,MAAI,CAAC,WAAW,YAAY,GAAG;AAC7B,mBAAe,KAAK,QAAQ,IAAI,GAAG,YAAY;AAAA,EACjD;AAGA,MAAI;AACJ,QAAM,cAAc,kBAAkB,UAAU;AAEhD,MAAI,WAAW,WAAW,GAAG;AAC3B,aAAS,UAAU,WAAW;AAAA,EAChC,OAAO;AACL,aAAS,UAAU,KAAK,cAAc,WAAW,CAAC;AAAA,EACpD;AAGA,MAAI,cAAc,OAAO,QAAQ,MAAM;AACrC,WAAO,OAAO,MAAM,GAAG,EAAE,KAAK,GAAG;AAAA,EACnC;AACA,MAAI,cAAc,QAAQ,QAAQ,KAAK;AACrC,WAAO,OAAO,MAAM,GAAG,EAAE,KAAK,IAAI;AAAA,EACpC;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghini/xstart",
3
- "version": "26.1.6203852",
3
+ "version": "26.1.6205313",
4
4
  "type": "module",
5
5
  "author": "Ghini",
6
6
  "license": "MIT",
package/src/utils.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/utils.ts
2
- import {normalize, join, isAbsolute, sep, dirname} from 'node:path';
2
+ import {normalize, join, isAbsolute, sep, dirname} from 'path';
3
3
 
4
4
  export {xpath, exefile, exedir};
5
5