@bridgebrew/project-github 0.0.1 → 0.0.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.
Files changed (2) hide show
  1. package/names.ts +4 -3
  2. package/package.json +4 -1
package/names.ts CHANGED
@@ -21,12 +21,13 @@ const OWNER = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/;
21
21
  const NAME = /^[A-Za-z0-9._-]{1,100}$/;
22
22
 
23
23
  /** `owner/repo` from what one types or pastes: `owner/repo`, a github.com page (https or not, `.git`, a deeper page),
24
- * or an ssh remote (`git@github.com:owner/repo.git`); `undefined` for anything else. */
24
+ * or a git remote (`git@github.com:owner/repo.git`, `ssh://git@github.com/owner/repo.git`), every remote GitHub's
25
+ * `repositoryOf` (@bridgebrew/github, ./pull-requests.ts) reads; `undefined` for anything else. */
25
26
  export function repoOf(text: string): string | undefined {
26
27
  const typed = text.trim();
27
28
  const found =
28
- /^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/\s]+)\/([^/\s?#]+)/i.exec(typed) ??
29
- /^git@github\.com:([^/\s]+)\/([^/\s]+)$/i.exec(typed) ??
29
+ /^(?:(?:https?|ssh|git):\/\/)?(?:[^@/?#\\\s]+@)?(?:www\.|ssh\.)?github\.com(?::\d+)?\/([^/\s]+)\/([^/\s?#]+)/i.exec(typed) ??
30
+ /^(?:[^@/?#\\\s]+@)?(?:ssh\.)?github\.com:([^/\s]+)\/([^/\s]+?)\/?$/i.exec(typed) ??
30
31
  /^([^/\s:]+)\/([^/\s]+)$/.exec(typed);
31
32
  if (!found) return undefined;
32
33
  const owner = found[1]!;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bridgebrew/project-github",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -35,5 +35,8 @@
35
35
  "cordis": "^4.0.0-rc.11",
36
36
  "react": "^19.3.0",
37
37
  "@bridge/ui": ">=0.0.1"
38
+ },
39
+ "engines": {
40
+ "bridge": ">=0.0.1-nightly.20261117.1"
38
41
  }
39
42
  }