@plotdb/registry 0.0.12 → 0.0.13
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/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/providers/github.js +44 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Change Logs
|
|
2
2
|
|
|
3
|
+
## v0.0.13
|
|
4
|
+
|
|
5
|
+
- bug fix:
|
|
6
|
+
- github provider: read versions from `dist/vX.Y.Z` release tags as well. fedep >= 1.8
|
|
7
|
+
( `publish -g` ) cuts the release on `dist/vX.Y.Z` - the bare `vX.Y.Z` it also pushes is a
|
|
8
|
+
tag without a release, invisible to the releases api - so `latest` resolved to the invalid
|
|
9
|
+
version `dist/v0.0.3` ( 400 ), an exact version 404'd and range lists dropped those releases.
|
|
10
|
+
`src/vX.Y.Z` ( the source commit ) is never taken as a version. an exact version tries
|
|
11
|
+
`vX.Y.Z` first, then `dist/vX.Y.Z`.
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## v0.0.12
|
|
4
15
|
|
|
5
16
|
- tweaks:
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"zbryikt","name":"@plotdb/registry","license":"MIT","description":"registry","version":"0.0.
|
|
1
|
+
{"author":"zbryikt","name":"@plotdb/registry","license":"MIT","description":"registry","version":"0.0.13","main":"index.js","homepage":"https://github.com/plotdb/registry","repository":{"type":"git","url":"https://github.com/plotdb/registry"},"engines":{"node":">=18","npm":">=6.4.1"},"scripts":{"start":"npx server -r web -o true","server":"cd web; ../node_modules/.bin/lsc server.ls","build":"lsc -c -o dist src/index.ls src/route.ls src/provider.ls src/designate.ls src/unbox.ls src/ngxgen.ls && lsc -c -o dist/providers src/providers/index.ls src/providers/github.ls src/providers/npm.ls && cp src/config.ngx dist/config.ngx","test":"lsc test/index.ls"},"bin":{"registry-ngx":"./bin/ngxgen"},"dependencies":{"@plotdb/guides":"github:plotdb/guides#master","@plotdb/semver":"^0.0.4","@zbryikt/template":"^2.4.2","fs-extra":"^8.1.0","js-yaml":"^4.1.1","lderror":"^2.4.6","livescript":"^1.6.0","node-fetch":"^2.6.7","pthk":"^0.0.1","tar":"^7.5.21","template-text":"^0.2.0","yargs":"^17.6.0","yauzl":"^2.10.0"},"devDependencies":{"@loadingio/bootstrap.ext":"^0.0.12","@loadingio/debounce.js":"^1.0.1","@loadingio/ldquery":"^3.0.6","@plotdb/block":"^5.6.3","@plotdb/csscope":"^5.0.4","@plotdb/rescope":"^5.0.17","bootstrap":"^4.6.1","bootstrap.native":"^3.0.14","fedep":"^1.7.6","ldcover":"^3.5.6","ldloader":"^3.0.3","ldview":"^1.7.0","proxise":"^1.0.1"},"frontendDependencies":{"root":"web/static/assets/lib","modules":["@loadingio/bootstrap.ext","@loadingio/debounce.js","@loadingio/ldquery","bootstrap","bootstrap.native","@plotdb/block","@plotdb/csscope","@plotdb/rescope","@plotdb/semver","ldcover","ldloader","ldview","proxise"]}}
|
package/providers/github.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by LiveScript 1.6.0
|
|
2
2
|
(function(){
|
|
3
|
-
var nodeFetch, lderror, provider, unbox, semver, getToken, pvd;
|
|
3
|
+
var nodeFetch, lderror, provider, unbox, semver, getToken, tagVersion, get, pvd;
|
|
4
4
|
nodeFetch = require('node-fetch');
|
|
5
5
|
lderror = require('lderror');
|
|
6
6
|
provider = require('../provider');
|
|
@@ -15,6 +15,31 @@
|
|
|
15
15
|
? null
|
|
16
16
|
: (opt.scope || (opt.scope = {}))[scope] || (opt.repo || (opt.repo = {}))[name] || opt.token || null;
|
|
17
17
|
};
|
|
18
|
+
tagVersion = function(tag){
|
|
19
|
+
var v;
|
|
20
|
+
tag = (tag || '') + "";
|
|
21
|
+
if (/^src\//.exec(tag)) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
v = tag.replace(/^dist\//, '').replace(/^v/, '');
|
|
25
|
+
if (semver.valid(v)) {
|
|
26
|
+
return v;
|
|
27
|
+
} else {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
get = function(url, headers){
|
|
32
|
+
return nodeFetch(url, {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
headers: headers
|
|
35
|
+
}).then(function(r){
|
|
36
|
+
if (r.status !== 200) {
|
|
37
|
+
return lderror.reject(404);
|
|
38
|
+
} else {
|
|
39
|
+
return r.json();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
18
43
|
pvd = new provider({
|
|
19
44
|
name: 'github',
|
|
20
45
|
fetchVersionList: function(arg$){
|
|
@@ -29,25 +54,16 @@
|
|
|
29
54
|
}
|
|
30
55
|
: {};
|
|
31
56
|
jsonurl = "https://api.github.com/repos/" + name.replace('@', '') + "/releases?per_page=100";
|
|
32
|
-
return
|
|
33
|
-
method: 'GET',
|
|
34
|
-
headers: headers
|
|
35
|
-
}).then(function(r){
|
|
36
|
-
if (r.status !== 200) {
|
|
37
|
-
return lderror.reject(404);
|
|
38
|
-
} else {
|
|
39
|
-
return r.json();
|
|
40
|
-
}
|
|
41
|
-
}).then(function(rs){
|
|
57
|
+
return get(jsonurl, headers).then(function(rs){
|
|
42
58
|
return rs.map(function(it){
|
|
43
|
-
return (it.tag_name
|
|
59
|
+
return tagVersion(it.tag_name);
|
|
44
60
|
}).filter(function(it){
|
|
45
|
-
return
|
|
61
|
+
return it;
|
|
46
62
|
});
|
|
47
63
|
});
|
|
48
64
|
},
|
|
49
65
|
fetchRealVersion: function(arg$){
|
|
50
|
-
var root, path, name, cachetime, version, versionType, force, headers, token,
|
|
66
|
+
var root, path, name, cachetime, version, versionType, force, headers, token, base, p;
|
|
51
67
|
root = arg$.root, path = arg$.path, name = arg$.name, cachetime = arg$.cachetime, version = arg$.version, versionType = arg$.versionType, force = arg$.force;
|
|
52
68
|
headers = (token = getToken({
|
|
53
69
|
name: name,
|
|
@@ -57,22 +73,22 @@
|
|
|
57
73
|
"Authorization": "token " + token
|
|
58
74
|
}
|
|
59
75
|
: {};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
base = "https://api.github.com/repos/" + name.replace('@', '');
|
|
77
|
+
p = versionType === 'latest'
|
|
78
|
+
? get(base + "/releases/latest", headers)
|
|
79
|
+
: get(base + "/releases/tags/v" + version, headers)['catch'](function(e){
|
|
80
|
+
if (lderror.id(e) !== 404) {
|
|
81
|
+
return Promise.reject(e);
|
|
82
|
+
}
|
|
83
|
+
return get(base + "/releases/tags/dist/v" + version, headers);
|
|
84
|
+
});
|
|
85
|
+
return p.then(function(r){
|
|
86
|
+
var v;
|
|
87
|
+
if (!(v = tagVersion(r.tag_name))) {
|
|
69
88
|
return lderror.reject(404);
|
|
70
|
-
} else {
|
|
71
|
-
return r.json();
|
|
72
89
|
}
|
|
73
|
-
}).then(function(r){
|
|
74
90
|
return {
|
|
75
|
-
version:
|
|
91
|
+
version: v,
|
|
76
92
|
url: r.tarball_url
|
|
77
93
|
};
|
|
78
94
|
});
|
|
@@ -101,6 +117,7 @@
|
|
|
101
117
|
});
|
|
102
118
|
}
|
|
103
119
|
});
|
|
120
|
+
pvd.tagVersion = tagVersion;
|
|
104
121
|
module.exports = pvd;
|
|
105
122
|
/*
|
|
106
123
|
params =
|