graphonomous 0.1.0 → 0.1.1
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/README.md +15 -4
- package/package.json +4 -4
- package/scripts/postinstall.js +33 -2
package/README.md
CHANGED
|
@@ -114,21 +114,32 @@ If you prefer not to install globally:
|
|
|
114
114
|
|
|
115
115
|
## Release asset override instructions
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
By default, the installer resolves the GitHub release source from this package metadata (`repository.url`, then `homepage`, then `bugs.url`).
|
|
118
|
+
|
|
119
|
+
Current default source in this package points to:
|
|
120
|
+
|
|
121
|
+
- Owner: `c-u-l8er`
|
|
122
|
+
- Repo: `graphonomous`
|
|
123
|
+
|
|
124
|
+
So for version `X.Y.Z`, the default asset URL pattern is:
|
|
125
|
+
|
|
126
|
+
- `https://github.com/c-u-l8er/graphonomous/releases/download/vX.Y.Z/graphonomous-vX.Y.Z-<platform>-<arch>.tar.gz`
|
|
127
|
+
|
|
128
|
+
You can override this behavior with environment variables for custom repos/tags/asset hosting.
|
|
118
129
|
|
|
119
130
|
### Override GitHub owner/repo/tag
|
|
120
131
|
|
|
121
132
|
```sh
|
|
122
133
|
GRAPHONOMOUS_GITHUB_OWNER=my-org \
|
|
123
134
|
GRAPHONOMOUS_GITHUB_REPO=graphonomous \
|
|
124
|
-
GRAPHONOMOUS_RELEASE_TAG=v0.1.
|
|
135
|
+
GRAPHONOMOUS_RELEASE_TAG=v0.1.1 \
|
|
125
136
|
npm i graphonomous
|
|
126
137
|
```
|
|
127
138
|
|
|
128
139
|
### Override version used for asset naming
|
|
129
140
|
|
|
130
141
|
```sh
|
|
131
|
-
GRAPHONOMOUS_VERSION=0.1.
|
|
142
|
+
GRAPHONOMOUS_VERSION=0.1.1 npm i graphonomous
|
|
132
143
|
```
|
|
133
144
|
|
|
134
145
|
### Use custom release base URL (bypass GitHub release URL construction)
|
|
@@ -141,7 +152,7 @@ Example:
|
|
|
141
152
|
|
|
142
153
|
```sh
|
|
143
154
|
GRAPHONOMOUS_RELEASE_BASE_URL=https://downloads.example.com/graphonomous \
|
|
144
|
-
GRAPHONOMOUS_VERSION=0.1.
|
|
155
|
+
GRAPHONOMOUS_VERSION=0.1.1 \
|
|
145
156
|
npm i graphonomous
|
|
146
157
|
```
|
|
147
158
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphonomous",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "npm wrapper for the Graphonomous MCP server CLI",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"author": "Ampersandbox",
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/c-u-l8er/graphonomous#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/c-u-l8er/graphonomous.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/c-u-l8er/graphonomous/issues"
|
|
15
15
|
},
|
|
16
16
|
"type": "commonjs",
|
|
17
17
|
"bin": {
|
package/scripts/postinstall.js
CHANGED
|
@@ -18,6 +18,32 @@ function readPackageJson() {
|
|
|
18
18
|
return JSON.parse(raw);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function parseGitHubRepoFromPackage(pkg) {
|
|
22
|
+
const candidates = [
|
|
23
|
+
pkg && pkg.repository && pkg.repository.url,
|
|
24
|
+
pkg && pkg.homepage,
|
|
25
|
+
pkg && pkg.bugs && pkg.bugs.url,
|
|
26
|
+
].filter(Boolean);
|
|
27
|
+
|
|
28
|
+
for (const value of candidates) {
|
|
29
|
+
const normalized = String(value);
|
|
30
|
+
const match = normalized.match(
|
|
31
|
+
/github\.com[:/](?<owner>[^/]+)\/(?<repo>[^/#?]+)/i,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (!match || !match.groups) continue;
|
|
35
|
+
|
|
36
|
+
const owner = match.groups.owner.trim();
|
|
37
|
+
const repo = match.groups.repo.replace(/\.git$/i, "").trim();
|
|
38
|
+
|
|
39
|
+
if (owner && repo) {
|
|
40
|
+
return { owner, repo };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
21
47
|
function envFlag(name, defaultValue = false) {
|
|
22
48
|
const raw = process.env[name];
|
|
23
49
|
if (raw == null) return defaultValue;
|
|
@@ -26,8 +52,13 @@ function envFlag(name, defaultValue = false) {
|
|
|
26
52
|
}
|
|
27
53
|
|
|
28
54
|
function getConfig(pkg) {
|
|
29
|
-
const
|
|
30
|
-
|
|
55
|
+
const inferredRepo = parseGitHubRepoFromPackage(pkg) || {
|
|
56
|
+
owner: "c-u-l8er",
|
|
57
|
+
repo: "graphonomous",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const owner = process.env.GRAPHONOMOUS_GITHUB_OWNER || inferredRepo.owner;
|
|
61
|
+
const repo = process.env.GRAPHONOMOUS_GITHUB_REPO || inferredRepo.repo;
|
|
31
62
|
const version = process.env.GRAPHONOMOUS_VERSION || pkg.version;
|
|
32
63
|
const tag =
|
|
33
64
|
process.env.GRAPHONOMOUS_RELEASE_TAG || `v${version.replace(/^v/, "")}`;
|