generator-verdaccio-plugin 3.0.1 → 4.0.0-next.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.
- package/README.md +2 -5
- package/generators/app/index.js +126 -132
- package/generators/app/index.js.map +1 -0
- package/generators/app/templates/typescript/auth/_package.json +12 -18
- package/generators/app/templates/typescript/auth/src/index.ts +1 -1
- package/generators/app/templates/typescript/auth/types/index.ts +1 -1
- package/generators/app/templates/typescript/common/eslintrc +10 -1
- package/generators/app/templates/typescript/common/index.js +13 -0
- package/generators/app/templates/typescript/common/index.js~Stashed changes +7 -0
- package/generators/app/templates/typescript/common/jest.config.js +1 -7
- package/generators/app/templates/typescript/common/npmignore +1 -2
- package/generators/app/templates/typescript/common/tsconfig.json +3 -6
- package/generators/app/templates/typescript/middleware/_package.json +13 -19
- package/generators/app/templates/typescript/middleware/src/index.ts +7 -7
- package/generators/app/templates/typescript/middleware/types/index.ts +1 -1
- package/generators/app/templates/typescript/storage/_package.json +12 -17
- package/generators/app/templates/typescript/storage/src/PackageStorage.ts +17 -17
- package/generators/app/templates/typescript/storage/src/index.ts +1 -1
- package/generators/app/templates/typescript/storage/src/plugin.ts +8 -8
- package/generators/app/templates/typescript/storage/types/index.ts +1 -1
- package/package.json +79 -38
- package/CHANGELOG.md +0 -106
- package/generators/app/index.d.ts +0 -11
- package/generators/app/index.ts +0 -215
- package/generators/app/templates/.eslintrc +0 -5
- package/generators/app/templates/javascript/.eslintrc +0 -5
- package/generators/app/templates/javascript/auth/_package.json +0 -33
- package/generators/app/templates/javascript/auth/src/index.js +0 -35
- package/generators/app/templates/javascript/common/README.md +0 -22
- package/generators/app/templates/javascript/common/babelrc +0 -3
- package/generators/app/templates/javascript/common/editorconfig +0 -12
- package/generators/app/templates/javascript/common/eslintignore +0 -2
- package/generators/app/templates/javascript/common/eslintrc +0 -3
- package/generators/app/templates/javascript/common/gitignore +0 -3
- package/generators/app/templates/javascript/common/index.js +0 -1
- package/generators/app/templates/javascript/common/jest.config.js +0 -10
- package/generators/app/templates/javascript/common/npmignore +0 -4
- package/generators/app/templates/javascript/common/travis.yml +0 -6
- package/generators/app/templates/javascript/middleware/_package.json +0 -34
- package/generators/app/templates/javascript/middleware/src/index.js +0 -8
- package/generators/app/templates/javascript/storage/_package.json +0 -33
- package/generators/app/templates/javascript/storage/src/PackageStorage.js +0 -153
- package/generators/app/templates/javascript/storage/src/index.js +0 -1
- package/generators/app/templates/javascript/storage/src/plugin.js +0 -106
- package/generators/app/templates/typescript/common/babelrc +0 -3
- package/generators/app/templates/typescript/common/index.ts +0 -3
- package/generators/app/templates/typescript/common/travis.yml +0 -6
- package/generators/app/types.d.ts +0 -10
- package/generators/app/types.js +0 -2
- package/generators/app/types.ts +0 -10
package/README.md
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
# Verdaccio plugin generator
|
|
2
2
|
|
|
3
3
|
[![NPM version][npm-image]][npm-url]
|
|
4
|
-
|
|
5
|
-
[](https://dependabot.com)
|
|
6
|
-
[](https://david-dm.org/verdaccio/generator-verdaccio-plugin/master?type=dev)
|
|
4
|
+
generator-verdaccio-plugin/master?type=dev)
|
|
7
5
|
[](./LICENSE)
|
|
8
|
-
|
|
9
6
|
[](https://opencollective.com/verdaccio)
|
|
10
7
|
[](https://stackshare.io/verdaccio)
|
|
11
8
|
[](http://chat.verdaccio.org/)
|
|
@@ -47,4 +44,4 @@ MIT © [Juan Picado <@jotadeveloper>]()
|
|
|
47
44
|
[npm-image]: https://badge.fury.io/js/generator-verdaccio-plugin.svg
|
|
48
45
|
[npm-url]: https://npmjs.org/package/generator-verdaccio-plugin
|
|
49
46
|
[daviddm-image]: https://david-dm.org/verdaccio/generator-verdaccio-plugin.svg?theme=shields.io
|
|
50
|
-
[daviddm-url]: https://david-dm.org/verdaccio/generator-verdaccio-plugin
|
|
47
|
+
[daviddm-url]: https://david-dm.org/verdaccio/generator-verdaccio-plugin
|
package/generators/app/index.js
CHANGED
|
@@ -1,134 +1,128 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.fs.copy(this.templatePath(`${lang}/${this.props.pluginType}/types`), this.destinationPath(path_1.resolve(this.destinationPathName, "types")), this.props);
|
|
126
|
-
}
|
|
127
|
-
this.fs.copy(this.templatePath(`${lang}/common/editorconfig`), this.destinationPath(path_1.resolve(this.destinationPathName, ".editorconfig")), this.props);
|
|
128
|
-
}
|
|
129
|
-
install() {
|
|
130
|
-
process.chdir(this.projectName);
|
|
131
|
-
this.installDependencies({ npm: true, bower: false });
|
|
132
|
-
}
|
|
2
|
+
|
|
3
|
+
var _path = require("path");
|
|
4
|
+
|
|
5
|
+
var _yeomanGenerator = _interopRequireDefault(require("yeoman-generator"));
|
|
6
|
+
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
|
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
const yosay = require('yosay');
|
|
14
|
+
|
|
15
|
+
class VerdaccioPluginGenerator extends _yeomanGenerator.default {
|
|
16
|
+
projectName = 'verdaccio-';
|
|
17
|
+
destinationPathName = 'verdaccio-';
|
|
18
|
+
|
|
19
|
+
constructor(args, opts) {
|
|
20
|
+
super(args, opts);
|
|
21
|
+
this.props = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
prompting() {
|
|
25
|
+
this.log(yosay('Welcome to ' + _chalk.default.red('generator-verdaccio-plugin') + ' plugin generator!'));
|
|
26
|
+
const prompts = [{
|
|
27
|
+
type: 'input',
|
|
28
|
+
name: 'name',
|
|
29
|
+
require: true,
|
|
30
|
+
message: 'What is the name of your plugin?',
|
|
31
|
+
default: 'customname',
|
|
32
|
+
validate: function (input) {
|
|
33
|
+
return input !== '';
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
type: 'list',
|
|
37
|
+
name: 'pluginType',
|
|
38
|
+
require: true,
|
|
39
|
+
message: 'What kind of plugin you want to create?',
|
|
40
|
+
store: true,
|
|
41
|
+
choices: [{
|
|
42
|
+
value: 'auth'
|
|
43
|
+
}, {
|
|
44
|
+
value: 'storage'
|
|
45
|
+
}, {
|
|
46
|
+
value: 'middleware'
|
|
47
|
+
}]
|
|
48
|
+
}, {
|
|
49
|
+
type: 'input',
|
|
50
|
+
name: 'description',
|
|
51
|
+
message: 'Please, describe your plugin',
|
|
52
|
+
default: 'An amazing verdaccio plugin'
|
|
53
|
+
}, {
|
|
54
|
+
name: 'githubUsername',
|
|
55
|
+
message: 'GitHub username or Organization',
|
|
56
|
+
validate: function (input) {
|
|
57
|
+
return input !== '';
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
name: 'authorName',
|
|
61
|
+
message: 'Author\'s Name',
|
|
62
|
+
store: true
|
|
63
|
+
}, {
|
|
64
|
+
name: 'authorEmail',
|
|
65
|
+
message: 'Author\'s Email',
|
|
66
|
+
store: true
|
|
67
|
+
}, {
|
|
68
|
+
name: 'keywords',
|
|
69
|
+
message: 'Key your keywords (comma to split)',
|
|
70
|
+
filter: function (keywords) {
|
|
71
|
+
return _lodash.default.uniq(_lodash.default.words(keywords).concat(['verdaccio-']));
|
|
72
|
+
}
|
|
73
|
+
}];
|
|
74
|
+
return this.prompt(prompts).then(function (_props) {
|
|
75
|
+
// To access props later use this.props.someAnswer;
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
this.props = _props;
|
|
78
|
+
const {
|
|
79
|
+
name,
|
|
80
|
+
githubUsername
|
|
81
|
+
} = _props; // @ts-ignore
|
|
82
|
+
|
|
83
|
+
this.props.license = 'MIT';
|
|
84
|
+
|
|
85
|
+
if (githubUsername) {
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
this.props.repository = githubUsername + '/' + name;
|
|
88
|
+
} // @ts-ignore
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
this.projectName = `verdaccio-${name}`; // @ts-ignore
|
|
92
|
+
|
|
93
|
+
this.destinationPathName = (0, _path.resolve)(this.projectName); // @ts-ignore
|
|
94
|
+
|
|
95
|
+
this.props.name = this.projectName;
|
|
96
|
+
}.bind(this));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
packageJSON() {
|
|
100
|
+
const {
|
|
101
|
+
pluginType
|
|
102
|
+
} = this.props;
|
|
103
|
+
const pkgJsonLocation = `typescript/${pluginType}/_package.json`;
|
|
104
|
+
this.fs.copyTpl(this.templatePath(pkgJsonLocation), this.destinationPath((0, _path.resolve)(this.destinationPathName, 'package.json')), this.props);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
writing() {
|
|
108
|
+
this.fs.copy(this.templatePath(`typescript/common/gitignore`), this.destinationPath((0, _path.resolve)(this.destinationPathName, '.gitignore')));
|
|
109
|
+
this.fs.copy(this.templatePath(`typescript/common/npmignore`), this.destinationPath((0, _path.resolve)(this.destinationPathName, '.npmignore')));
|
|
110
|
+
this.fs.copy(this.templatePath(`typescript/common/jest.config.js`), this.destinationPath((0, _path.resolve)(this.destinationPathName, 'jest.config.js')));
|
|
111
|
+
this.fs.copyTpl(this.templatePath(`typescript/common/README.md`), this.destinationPath((0, _path.resolve)(this.destinationPathName, 'README.md')), this.props);
|
|
112
|
+
this.fs.copyTpl(this.templatePath(`typescript/common/eslintrc`), this.destinationPath((0, _path.resolve)(this.destinationPathName, '.eslintrc')), this.props);
|
|
113
|
+
this.fs.copyTpl(this.templatePath(`typescript/common/eslintignore`), this.destinationPath((0, _path.resolve)(this.destinationPathName, '.eslintignore')), this.props);
|
|
114
|
+
this.fs.copy(this.templatePath(`typescript/${this.props.pluginType}/src`), this.destinationPath((0, _path.resolve)(this.destinationPathName, 'src')));
|
|
115
|
+
this.fs.copy(this.templatePath(`typescript/common/index.js`), this.destinationPath((0, _path.resolve)(this.destinationPathName, `index.js`)));
|
|
116
|
+
this.fs.copy(this.templatePath(`typescript/common/tsconfig.json`), this.destinationPath((0, _path.resolve)(this.destinationPathName, 'tsconfig.json')));
|
|
117
|
+
this.fs.copy(this.templatePath(`typescript/${this.props.pluginType}/types`), this.destinationPath((0, _path.resolve)(this.destinationPathName, 'types')));
|
|
118
|
+
this.fs.copy(this.templatePath(`typescript/common/editorconfig`), this.destinationPath((0, _path.resolve)(this.destinationPathName, '.editorconfig')));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
install() {
|
|
122
|
+
process.chdir(this.projectName); // this.installDependencies({ npm: true, bower: false });
|
|
123
|
+
}
|
|
124
|
+
|
|
133
125
|
}
|
|
134
|
-
|
|
126
|
+
|
|
127
|
+
module.exports = VerdaccioPluginGenerator;
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["yosay","require","VerdaccioPluginGenerator","Generator","projectName","destinationPathName","constructor","args","opts","props","prompting","log","chalk","red","prompts","type","name","message","default","validate","input","store","choices","value","filter","keywords","_","uniq","words","concat","prompt","then","_props","githubUsername","license","repository","resolve","bind","packageJSON","pluginType","pkgJsonLocation","fs","copyTpl","templatePath","destinationPath","writing","copy","install","process","chdir","module","exports"],"sources":["../../src/app/index.ts"],"sourcesContent":["import {resolve} from 'path';\n\nimport Generator from 'yeoman-generator';\nimport chalk from 'chalk';\nimport _ from 'lodash';\n\ntype propsTypes = {\n name?: string;\n pluginType?: string;\n description?: string;\n githubUsername?: string;\n authorName?: string;\n authorEmail?: string;\n keywords?: string[];\n};\n\nconst yosay = require('yosay');\n\nclass VerdaccioPluginGenerator extends Generator {\n private props: propsTypes;\n private projectName = 'verdaccio-';\n private destinationPathName = 'verdaccio-';\n constructor(args, opts) {\n super(args, opts);\n this.props = {};\n }\n\n prompting() {\n this.log(\n yosay(\n 'Welcome to ' +\n chalk.red('generator-verdaccio-plugin') +\n ' plugin generator!',\n ),\n );\n\n const prompts = [\n {\n type: 'input',\n name: 'name',\n require: true,\n message: 'What is the name of your plugin?',\n default: 'customname',\n validate: function(input) {\n return input !== '';\n },\n },\n {\n type: 'list',\n name: 'pluginType',\n require: true,\n message: 'What kind of plugin you want to create?',\n store: true,\n choices: [\n {value: 'auth'},\n {value: 'storage'},\n {value: 'middleware'},\n ],\n },\n {\n type: 'input',\n name: 'description',\n message: 'Please, describe your plugin',\n default: 'An amazing verdaccio plugin',\n },\n {\n name: 'githubUsername',\n message: 'GitHub username or Organization',\n validate: function(input) {\n return input !== '';\n },\n },\n {\n name: 'authorName',\n message: 'Author\\'s Name',\n store: true,\n },\n {\n name: 'authorEmail',\n message: 'Author\\'s Email',\n store: true,\n },\n {\n name: 'keywords',\n message: 'Key your keywords (comma to split)',\n filter: function(keywords) {\n return _.uniq(_.words(keywords).concat(['verdaccio-']));\n },\n },\n ];\n\n return this.prompt(prompts).then(\n function(_props) {\n // To access props later use this.props.someAnswer;\n // @ts-ignore\n this.props = _props;\n const {name, githubUsername} = _props;\n // @ts-ignore\n this.props.license = 'MIT';\n if (githubUsername) {\n // @ts-ignore\n this.props.repository = githubUsername + '/' + name;\n }\n\n // @ts-ignore\n this.projectName = `verdaccio-${name}`;\n\n // @ts-ignore\n this.destinationPathName = resolve(this.projectName);\n // @ts-ignore\n this.props.name = this.projectName;\n }.bind(this),\n );\n }\n\n packageJSON() {\n const {pluginType} = this.props;\n const pkgJsonLocation = `typescript/${pluginType}/_package.json`;\n this.fs.copyTpl(\n this.templatePath(pkgJsonLocation),\n this.destinationPath(resolve(this.destinationPathName, 'package.json')),\n this.props,\n );\n }\n\n writing() {\n this.fs.copy(\n this.templatePath(`typescript/common/gitignore`),\n this.destinationPath(resolve(this.destinationPathName, '.gitignore')),\n );\n this.fs.copy(\n this.templatePath(`typescript/common/npmignore`),\n this.destinationPath(resolve(this.destinationPathName, '.npmignore')),\n );\n this.fs.copy(\n this.templatePath(`typescript/common/jest.config.js`),\n this.destinationPath(resolve(this.destinationPathName, 'jest.config.js')),\n );\n this.fs.copyTpl(\n this.templatePath(`typescript/common/README.md`),\n this.destinationPath(resolve(this.destinationPathName, 'README.md')),\n this.props,\n );\n this.fs.copyTpl(\n this.templatePath(`typescript/common/eslintrc`),\n this.destinationPath(resolve(this.destinationPathName, '.eslintrc')),\n this.props,\n );\n this.fs.copyTpl(\n this.templatePath(`typescript/common/eslintignore`),\n this.destinationPath(resolve(this.destinationPathName, '.eslintignore')),\n this.props,\n );\n\n this.fs.copy(\n this.templatePath(`typescript/${this.props.pluginType}/src`),\n this.destinationPath(resolve(this.destinationPathName, 'src')),\n );\n\n this.fs.copy(\n this.templatePath(\n `typescript/common/index.js`,\n ),\n this.destinationPath(\n resolve(\n this.destinationPathName,\n `index.js`,\n ),\n ),\n );\n\n this.fs.copy(\n this.templatePath(`typescript/common/tsconfig.json`),\n this.destinationPath(\n resolve(this.destinationPathName, 'tsconfig.json'),\n ),\n );\n this.fs.copy(\n this.templatePath(`typescript/${this.props.pluginType}/types`),\n this.destinationPath(resolve(this.destinationPathName, 'types')),\n );\n\n this.fs.copy(\n this.templatePath(`typescript/common/editorconfig`),\n this.destinationPath(resolve(this.destinationPathName, '.editorconfig')),\n );\n }\n\n install() {\n process.chdir(this.projectName);\n // this.installDependencies({ npm: true, bower: false });\n }\n}\n\nmodule.exports = VerdaccioPluginGenerator;\n"],"mappings":";;AAAA;;AAEA;;AACA;;AACA;;;;AAYA,MAAMA,KAAK,GAAGC,OAAO,CAAC,OAAD,CAArB;;AAEA,MAAMC,wBAAN,SAAuCC,wBAAvC,CAAiD;EAEvCC,WAAW,GAAG,YAAH;EACXC,mBAAmB,GAAG,YAAH;;EAC3BC,WAAW,CAACC,IA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,EACI,KAAK/B,mBADT,EAEK,UAFL,CADJ,CAJJ;IAYA,KAAKoC,EAAL,CAAQK,IAAR,CACI,KAAKH,YAAL,CAAmB,iCAAnB,CADJ,EAEI,KAAKC,eAAL,CACI,IAAAR,aAAA,EAAQ,KAAK/B,mBAAb,EAAkC,eAAlC,CADJ,CAFJ;IAMA,KAAKoC,EAAL,CAAQK,IAAR,CACI,KAAKH,YAAL,CAAmB,cAAa,KAAKlC,KAAL,CAAW8B,UAAW,QAAtD,CADJ,EAEI,KAAKK,eAAL,CAAqB,IAAAR,aAAA,EAAQ,KAAK/B,mBAAb,EAAkC,OAAlC,CAArB,CAFJ;IAKA,KAAKoC,EAAL,CAAQK,IAAR,CACI,KAAKH,YAAL,CAAmB,gCAAnB,CADJ,EAEI,KAAKC,eAAL,CAAqB,IAAAR,aAAA,EAAQ,KAAK/B,mBAAb,EAAkC,eAAlC,CAArB,CAFJ;EAID;;EAED0C,OAAO,GAAG;IACRC,OAAO,CAACC,KAAR,CAAc,KAAK7C,WAAnB,EADQ,CAER;EACD;;AA7K8C;;AAgLjD8C,MAAM,CAACC,OAAP,GAAiBjD,wBAAjB"}
|
|
@@ -6,35 +6,29 @@
|
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": ["lib/"],
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=12"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@verdaccio/commons-api": "
|
|
12
|
+
"@verdaccio/commons-api": "latest",
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/jest": "
|
|
15
|
+
"@types/jest": "27.5.1",
|
|
16
16
|
"@types/node": "^12.12.5",
|
|
17
|
-
"@types/express": "
|
|
18
|
-
"@typescript-eslint/eslint-plugin": "
|
|
19
|
-
"@
|
|
20
|
-
"@verdaccio/
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"prettier": "^1.19.1",
|
|
25
|
-
"standard-version": "^8.0.0",
|
|
26
|
-
"typescript": "^3.9.5"
|
|
17
|
+
"@types/express": "4.17.13",
|
|
18
|
+
"@typescript-eslint/eslint-plugin": "5.26.0",
|
|
19
|
+
"@typescript-eslint/parser": "5.26.0",
|
|
20
|
+
"@verdaccio/types": "latest",
|
|
21
|
+
"eslint": "8.16.0",
|
|
22
|
+
"jest": "28.1.1",
|
|
23
|
+
"typescript": "4.7.3"
|
|
27
24
|
},
|
|
28
25
|
"keywords": ["<%= keywords %>]"],
|
|
29
26
|
"license": "<%= license %>",
|
|
30
27
|
"repository": "<%= repository %>",
|
|
31
28
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
32
29
|
"scripts": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"build:js": "babel src/ --out-dir lib --extensions \".ts,.tsx\"",
|
|
36
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
37
|
-
"test": "jest",
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"test": "jest .",
|
|
38
32
|
"lint": "eslint \"**/*.{js,ts}\""
|
|
39
33
|
}
|
|
40
34
|
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"plugins": [
|
|
5
|
+
"@typescript-eslint"
|
|
6
|
+
],
|
|
7
|
+
"extends": [
|
|
8
|
+
"eslint:recommended",
|
|
9
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
10
|
+
"plugin:@typescript-eslint/recommended"
|
|
11
|
+
]
|
|
3
12
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _index = _interopRequireDefault(require("./lib/index"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _index.default;
|
|
13
|
+
exports.default = _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const index_1 = __importDefault(require("./generators/index"));
|
|
7
|
+
exports.default = index_1.default;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
name: 'verdaccio-<%= name %>',
|
|
3
|
-
|
|
4
|
-
transform: {
|
|
5
|
-
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
|
|
6
|
-
},
|
|
7
|
-
verbose: true,
|
|
8
|
-
collectCoverage: true,
|
|
9
|
-
coveragePathIgnorePatterns: ['node_modules'],
|
|
3
|
+
preset: 'ts-jest',
|
|
10
4
|
};
|
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
"target": "esnext",
|
|
4
4
|
"module": "commonjs",
|
|
5
5
|
"declaration": true,
|
|
6
|
+
"allowJs": false,
|
|
6
7
|
"noImplicitAny": false,
|
|
7
8
|
"strict": true,
|
|
8
|
-
"outDir": "lib",
|
|
9
|
+
"outDir": "./lib",
|
|
9
10
|
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"esModuleInterop": true
|
|
11
|
-
"typeRoots": [
|
|
12
|
-
"../../node_modules/@verdaccio/types/lib/verdaccio",
|
|
13
|
-
"../../node_modules/@types"
|
|
14
|
-
]
|
|
11
|
+
"esModuleInterop": true
|
|
15
12
|
},
|
|
16
13
|
"include": [
|
|
17
14
|
"src/*.ts",
|
|
@@ -6,36 +6,30 @@
|
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": ["lib/"],
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=12"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@verdaccio/commons-api": "
|
|
13
|
-
"express": "
|
|
12
|
+
"@verdaccio/commons-api": "latest",
|
|
13
|
+
"express": "4.18.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@types/jest": "
|
|
16
|
+
"@types/jest": "27.5.1",
|
|
17
17
|
"@types/node": "^12.12.5",
|
|
18
|
-
"@types/express": "
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "
|
|
20
|
-
"@
|
|
21
|
-
"@verdaccio/
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"prettier": "^1.19.1",
|
|
26
|
-
"standard-version": "^8.0.0",
|
|
27
|
-
"typescript": "^3.9.5"
|
|
18
|
+
"@types/express": "4.17.13",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "5.26.0",
|
|
20
|
+
"@typescript-eslint/parser": "5.26.0",
|
|
21
|
+
"@verdaccio/types": "latest",
|
|
22
|
+
"eslint": "8.16.0",
|
|
23
|
+
"jest": "28.1.1",
|
|
24
|
+
"typescript": "4.7.3"
|
|
28
25
|
},
|
|
29
26
|
"keywords": ["<%= keywords %>"],
|
|
30
27
|
"license": "<%= license %>",
|
|
31
28
|
"repository": "<%= repository %>",
|
|
32
29
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
33
30
|
"scripts": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"build:js": "babel src/ --out-dir lib --extensions \".ts,.tsx\"",
|
|
37
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
38
|
-
"test": "jest",
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"test": "jest .",
|
|
39
33
|
"lint": "eslint \"**/*.{js,ts}\""
|
|
40
34
|
}
|
|
41
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {Logger, IPluginMiddleware, IBasicAuth, IStorageManager, PluginOptions} from '@verdaccio/types';
|
|
2
|
+
import {Router, Request, Response, NextFunction, Application} from 'express';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {CustomConfig} from '../types/index';
|
|
5
5
|
|
|
6
6
|
export default class VerdaccioMiddlewarePlugin implements IPluginMiddleware<CustomConfig> {
|
|
7
7
|
public logger: Logger;
|
|
@@ -12,10 +12,10 @@ export default class VerdaccioMiddlewarePlugin implements IPluginMiddleware<Cust
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
public register_middlewares(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
app: Application,
|
|
16
|
+
auth: IBasicAuth<CustomConfig>,
|
|
17
|
+
/* eslint @typescript-eslint/no-unused-vars: off */
|
|
18
|
+
_storage: IStorageManager<CustomConfig>,
|
|
19
19
|
): void {
|
|
20
20
|
/**
|
|
21
21
|
* This is just an example of implementation
|
|
@@ -9,32 +9,27 @@
|
|
|
9
9
|
"node": ">=10"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@verdaccio/commons-api": "
|
|
13
|
-
"@verdaccio/streams": "
|
|
12
|
+
"@verdaccio/commons-api": "latest",
|
|
13
|
+
"@verdaccio/streams": "latest"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@types/jest": "
|
|
16
|
+
"@types/jest": "27.5.1",
|
|
17
17
|
"@types/node": "^12.12.5",
|
|
18
|
-
"@types/express": "
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "
|
|
20
|
-
"@
|
|
21
|
-
"@verdaccio/
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"prettier": "^1.19.1",
|
|
26
|
-
"standard-version": "^8.0.0"
|
|
18
|
+
"@types/express": "4.17.13",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "5.26.0",
|
|
20
|
+
"@typescript-eslint/parser": "5.26.0",
|
|
21
|
+
"@verdaccio/types": "latest",
|
|
22
|
+
"eslint": "8.16.0",
|
|
23
|
+
"jest": "28.1.1",
|
|
24
|
+
"typescript": "4.7.3"
|
|
27
25
|
},
|
|
28
26
|
"keywords": ["<%= keywords %>"],
|
|
29
27
|
"license": "<%= license %>",
|
|
30
28
|
"repository": "<%= repository %>",
|
|
31
29
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
32
30
|
"scripts": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"build:js": "babel src/ --out-dir lib --extensions \".ts,.tsx\"",
|
|
36
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
37
|
-
"test": "jest",
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"test": "jest .",
|
|
38
33
|
"lint": "eslint \"**/*.{js,ts}\""
|
|
39
34
|
}
|
|
40
35
|
}
|