@plotdb/registry 0.0.6 → 0.0.8

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 ADDED
@@ -0,0 +1,42 @@
1
+ # Change Logs
2
+
3
+ ## v0.0.8
4
+
5
+ - prevent long package name (>128 chars) and long version (>40 chars)
6
+ - use lderror 998 for directly skip reg.404 preparation
7
+ - upgrade dependencies
8
+
9
+
10
+ ## v0.0.7
11
+
12
+ - fix bug: incorrect id parsing in route which recognize path as part of version
13
+
14
+
15
+ ## v0.0.6
16
+
17
+ - upgrade dependencies and remove unused `request` to suppress npm vulnerability report
18
+
19
+
20
+ ## v0.0.5
21
+
22
+ - reject with 404 if id is empty.
23
+
24
+
25
+ ## v0.0.4
26
+
27
+ - skip 400 error, treat it as 404 and suppress error log for it.
28
+
29
+
30
+ ## v0.0.3
31
+
32
+ - add additional message when `version-type` can't be analyzed correctly
33
+
34
+
35
+ ## v0.0.2
36
+
37
+ - support function-based customized option (currently for `cachetime` and `force` option)
38
+
39
+
40
+ ## v0.0.1
41
+
42
+ - init release
package/README.md CHANGED
@@ -33,7 +33,7 @@ prepare a provider:
33
33
  myprovider = new registry do
34
34
  check: ({name, version, path}) ->
35
35
  if /@plotdb/.exec(name) => return Promise.resolve!
36
- return lderror.reject 403
36
+ return lderror.reject 403 # or 998 (skipped) to prevent creating reg.404 file
37
37
  # chain a default jsdelivr provider
38
38
  myprovider.chain(registry.provider.jsdelivr);
39
39
 
@@ -120,7 +120,7 @@ A registry provider object should contain following fields:
120
120
  A provider provides following APIs:
121
121
 
122
122
  - `opt(opt)`: provide additional options for this provider.
123
- - once provided, this can be accessed via `this._opt` internally.
123
+ - once provided, this can be accessed via `this.\_opt` internally.
124
124
  - `fetch(opt)`: download the indicated released packages and create a local copy at specified location.
125
125
  - `opt` is an object with following fields:
126
126
  - `root`: root directory for keeping cached files.
package/package.json CHANGED
@@ -1,74 +1 @@
1
- {
2
- "author": "zbryikt",
3
- "name": "@plotdb/registry",
4
- "license": "MIT",
5
- "description": "registry",
6
- "version": "0.0.6",
7
- "main": "./dist/index.js",
8
- "files": [
9
- "dist/**/*"
10
- ],
11
- "homepage": "https://github.com/plotdb/registry",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/plotdb/registry"
15
- },
16
- "engines": {
17
- "node": ">=10.14.1",
18
- "npm": ">=6.4.1"
19
- },
20
- "scripts": {
21
- "start": "npx server -r web -o true",
22
- "server": "cd web; ../node_modules/.bin/lsc server.ls"
23
- },
24
- "bin": {
25
- "registry-ngx": "./bin/ngxgen"
26
- },
27
- "dependencies": {
28
- "@zbryikt/template": "^2.4.1",
29
- "fs-extra": "^8.1.0",
30
- "js-yaml": "^4.1.0",
31
- "lderror": "^2.4.5",
32
- "livescript": "^1.6.0",
33
- "node-fetch": "^2.6.7",
34
- "pthk": "^0.0.1",
35
- "tar": "^6.1.11",
36
- "template-text": "^0.1.3",
37
- "yargs": "^17.6.0",
38
- "yauzl": "^2.10.0"
39
- },
40
- "devDependencies": {
41
- "@loadingio/bootstrap.ext": "^0.0.12",
42
- "@loadingio/debounce.js": "^1.0.1",
43
- "@loadingio/ldquery": "^3.0.6",
44
- "@plotdb/block": "^5.5.4",
45
- "@plotdb/csscope": "^5.0.3",
46
- "@plotdb/rescope": "^5.0.15",
47
- "@plotdb/semver": "^0.0.3",
48
- "bootstrap": "^4.6.1",
49
- "bootstrap.native": "^3.0.14",
50
- "fedep": "^1.4.3",
51
- "ldcover": "^3.5.6",
52
- "ldloader": "^3.0.3",
53
- "ldview": "^1.5.1",
54
- "proxise": "^1.0.1"
55
- },
56
- "frontendDependencies": {
57
- "root": "web/static/assets/lib",
58
- "modules": [
59
- "@loadingio/bootstrap.ext",
60
- "@loadingio/debounce.js",
61
- "@loadingio/ldquery",
62
- "bootstrap",
63
- "bootstrap.native",
64
- "@plotdb/block",
65
- "@plotdb/csscope",
66
- "@plotdb/rescope",
67
- "@plotdb/semver",
68
- "ldcover",
69
- "ldloader",
70
- "ldview",
71
- "proxise"
72
- ]
73
- }
74
- }
1
+ {"author":"zbryikt","name":"@plotdb/registry","license":"MIT","description":"registry","version":"0.0.8","main":"index.js","homepage":"https://github.com/plotdb/registry","repository":{"type":"git","url":"https://github.com/plotdb/registry"},"engines":{"node":">=10.14.1","npm":">=6.4.1"},"scripts":{"start":"npx server -r web -o true","server":"cd web; ../node_modules/.bin/lsc server.ls"},"bin":{"registry-ngx":"./../bin/ngxgen"},"dependencies":{"@zbryikt/template":"^2.4.1","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":"^6.1.11","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","@plotdb/semver":"^0.0.3","bootstrap":"^4.6.1","bootstrap.native":"^3.0.14","fedep":"^1.6.0","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"]}}
@@ -50,6 +50,9 @@
50
50
  if (!versionType) {
51
51
  return lderror.reject(400, "incorrect version-type when accessing " + name + "@" + version);
52
52
  }
53
+ if ((name + "").length > 128 || (version + "").length > 40) {
54
+ return lderror.reject(998);
55
+ }
53
56
  params = {
54
57
  path: path,
55
58
  versionType: versionType,
@@ -100,9 +103,12 @@
100
103
  };
101
104
  return _()['catch'](function(e){
102
105
  var id;
103
- if (!((id = lderror.id(e)) === 403 || id === 404)) {
106
+ if (!((id = lderror.id(e)) === 403 || id === 404 || id === 998)) {
104
107
  return Promise.reject(e);
105
108
  }
109
+ if (id === 998) {
110
+ return lderror.reject(404);
111
+ }
106
112
  return fs.ensureDir(path.base.version).then(function(){
107
113
  return fs.writeFile(path[404], '');
108
114
  }).then(function(){
@@ -16,7 +16,7 @@
16
16
  return lderror.reject(404);
17
17
  }
18
18
  ids = id.split('/');
19
- import$(obj, ids.length > 3
19
+ import$(obj, (ids[0] || '')[0] === '@'
20
20
  ? {
21
21
  name: ids[0] + "/" + ids[1],
22
22
  version: ids[2],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes