@vltpkg/git-scp-url 1.0.0-rc.10 → 1.0.0-rc.12

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+EA,eAAO,MAAM,SAAS,QAAS,MAAM,oBAkBpC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,OAAO;IACP,QAAQ;IACR,MAAM;IACN,UAAU;IACV,YAAY;IACZ,MAAM;CACP,CAAC,CAAA;AAEF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAe,CAAA;AAEnC,iEAAiE;AACjE,kEAAkE;AAClE,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE;IACtC,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAA;IAC1C,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,IAAI,WAAW,KAAK,UAAU,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,GAAG,CAAA;QACZ,CAAC;QACD,OAAO,KAAK,GAAG,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC;QACjB,IAAI,OAAO,GAAG,UAAU,EAAE,CAAC;Y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CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,sBAAsB;QACtB,qBAAqB;QACrB,kCAAkC;QAClC,6BAA6B;QAC7B,SAAS,GAAG,aAAa,SAAS,EAAE,CAAA;IACtC,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;YACrB,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;YACrB,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["const knownProtocols = new Set([\n 'http:',\n 'https:',\n 'git:',\n 'git+ssh:',\n 'git+https:',\n 'ssh:',\n])\n\nconst memo = new Map<string, URL>()\n\n// git+ssh:github.com:user/repo => git+ssh://github.com:user/repo\n// git@github.com:user/repo => git+ssh://user@github.com:user/repo\nconst correctProtocol = (arg: string) => {\n const firstColon = arg.indexOf(':')\n const proto = arg.slice(0, firstColon + 1)\n const doubleSlash = arg.indexOf('//')\n if (knownProtocols.has(proto)) {\n if (doubleSlash === firstColon + 1) {\n return arg\n }\n return proto + '//' + arg.slice(firstColon + 1)\n }\n\n const firstAt = arg.indexOf('@')\n if (firstAt > -1) {\n if (firstAt > firstColon) {\n return `git+ssh://${arg}`\n } else {\n return arg\n }\n // it would've parsed just fine otherwise, but just in case */\n /* c8 ignore start */\n }\n\n return proto + '//' + arg.slice(firstColon + 1)\n}\n/* c8 ignore stop */\n\n// git+ssh://github.com:user/repo => git+ssh://github.com/user/repo\nconst correctUrl = (url: string): string => {\n const firstAt = url.indexOf('@')\n const lastHash = url.lastIndexOf('#')\n let firstColon = url.indexOf(':')\n let lastColon = url.lastIndexOf(\n ':',\n lastHash > -1 ? lastHash : Infinity,\n )\n\n let corrected = url\n if (lastColon > firstAt) {\n // the last : comes after the first @ (or there is no @)\n // like it would in:\n // proto://hostname.com:user/repo\n // username@hostname.com:user/repo\n // :password@hostname.com:user/repo\n // username:password@hostname.com:user/repo\n // proto://username@hostname.com:user/repo\n // proto://:password@hostname.com:user/repo\n // proto://username:password@hostname.com:user/repo\n // then we replace the last : with a / to create a valid path\n corrected =\n url.slice(0, lastColon) + '/' + url.slice(lastColon + 1)\n // // and we find our new : positions\n firstColon = corrected.indexOf(':')\n lastColon = corrected.lastIndexOf(':')\n }\n\n if (firstColon === -1 && !url.includes('//')) {\n // we have no : at all\n // as it would be in:\n // username@hostname.com/user/repo\n // then we prepend a protocol\n corrected = `git+ssh://${corrected}`\n }\n\n return corrected\n}\n\nexport const gitScpURL = (url: string) => {\n const memoized = memo.get(url)\n if (memoized) return memoized\n try {\n const result = new URL(url)\n if (result.hostname) {\n memo.set(url, result)\n return result\n }\n } catch {}\n try {\n const result = new URL(correctUrl(correctProtocol(url)))\n if (result.hostname) {\n memo.set(url, result)\n return result\n }\n } catch {}\n return undefined\n}\n"]}
package/package.json CHANGED
@@ -1,31 +1,19 @@
1
1
  {
2
2
  "name": "@vltpkg/git-scp-url",
3
3
  "description": "Parse scp-style git URLs like `git+ssh://host:some/path`",
4
- "version": "1.0.0-rc.10",
4
+ "version": "1.0.0-rc.12",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
8
8
  "directory": "src/git-scp-url"
9
9
  },
10
10
  "author": "vlt technology inc. <support@vlt.sh> (http://vlt.sh)",
11
- "tshy": {
12
- "selfLink": false,
13
- "liveDev": true,
14
- "dialects": [
15
- "esm"
16
- ],
17
- "exports": {
18
- "./package.json": "./package.json",
19
- ".": "./src/index.ts"
20
- }
21
- },
22
11
  "devDependencies": {
23
12
  "@eslint/js": "^9.39.1",
24
13
  "@types/node": "^22.19.2",
25
14
  "eslint": "^9.39.1",
26
15
  "prettier": "^3.7.4",
27
16
  "tap": "^21.5.0",
28
- "tshy": "^3.1.0",
29
17
  "typedoc": "~0.27.9",
30
18
  "typescript": "5.7.3",
31
19
  "typescript-eslint": "^8.49.0"
@@ -38,14 +26,13 @@
38
26
  "extends": "../../tap-config.yaml"
39
27
  },
40
28
  "prettier": "../../.prettierrc.js",
41
- "module": "./dist/esm/index.js",
29
+ "module": "./dist/index.js",
42
30
  "type": "module",
43
31
  "exports": {
44
32
  "./package.json": "./package.json",
45
33
  ".": {
46
34
  "import": {
47
- "types": "./dist/esm/index.d.ts",
48
- "default": "./dist/esm/index.js"
35
+ "default": "./dist/index.js"
49
36
  }
50
37
  }
51
38
  },
@@ -60,7 +47,6 @@
60
47
  "snap": "tap",
61
48
  "test": "tap",
62
49
  "posttest": "tsc --noEmit",
63
- "tshy": "tshy",
64
50
  "typecheck": "tsc --noEmit"
65
51
  }
66
52
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA+EA,eAAO,MAAM,SAAS,QAAS,MAAM,oBAkBpC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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;QAAE,OAAO,QAAQ,CAAA;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;YACrB,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;YACrB,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA","sourcesContent":["const knownProtocols = new Set([\n 'http:',\n 'https:',\n 'git:',\n 'git+ssh:',\n 'git+https:',\n 'ssh:',\n])\n\nconst memo = new Map<string, URL>()\n\n// git+ssh:github.com:user/repo => git+ssh://github.com:user/repo\n// git@github.com:user/repo => git+ssh://user@github.com:user/repo\nconst correctProtocol = (arg: string) => {\n const firstColon = arg.indexOf(':')\n const proto = arg.slice(0, firstColon + 1)\n const doubleSlash = arg.indexOf('//')\n if (knownProtocols.has(proto)) {\n if (doubleSlash === firstColon + 1) {\n return arg\n }\n return proto + '//' + arg.slice(firstColon + 1)\n }\n\n const firstAt = arg.indexOf('@')\n if (firstAt > -1) {\n if (firstAt > firstColon) {\n return `git+ssh://${arg}`\n } else {\n return arg\n }\n // it would've parsed just fine otherwise, but just in case */\n /* c8 ignore start */\n }\n\n return proto + '//' + arg.slice(firstColon + 1)\n}\n/* c8 ignore stop */\n\n// git+ssh://github.com:user/repo => git+ssh://github.com/user/repo\nconst correctUrl = (url: string): string => {\n const firstAt = url.indexOf('@')\n const lastHash = url.lastIndexOf('#')\n let firstColon = url.indexOf(':')\n let lastColon = url.lastIndexOf(\n ':',\n lastHash > -1 ? lastHash : Infinity,\n )\n\n let corrected = url\n if (lastColon > firstAt) {\n // the last : comes after the first @ (or there is no @)\n // like it would in:\n // proto://hostname.com:user/repo\n // username@hostname.com:user/repo\n // :password@hostname.com:user/repo\n // username:password@hostname.com:user/repo\n // proto://username@hostname.com:user/repo\n // proto://:password@hostname.com:user/repo\n // proto://username:password@hostname.com:user/repo\n // then we replace the last : with a / to create a valid path\n corrected =\n url.slice(0, lastColon) + '/' + url.slice(lastColon + 1)\n // // and we find our new : positions\n firstColon = corrected.indexOf(':')\n lastColon = corrected.lastIndexOf(':')\n }\n\n if (firstColon === -1 && !url.includes('//')) {\n // we have no : at all\n // as it would be in:\n // username@hostname.com/user/repo\n // then we prepend a protocol\n corrected = `git+ssh://${corrected}`\n }\n\n return corrected\n}\n\nexport const gitScpURL = (url: string) => {\n const memoized = memo.get(url)\n if (memoized) return memoized\n try {\n const result = new URL(url)\n if (result.hostname) {\n memo.set(url, result)\n return result\n }\n } catch {}\n try {\n const result = new URL(correctUrl(correctProtocol(url)))\n if (result.hostname) {\n memo.set(url, result)\n return result\n }\n } catch {}\n return undefined\n}\n"]}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
File without changes
File without changes