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.
Files changed (50) hide show
  1. package/README.md +2 -5
  2. package/generators/app/index.js +126 -132
  3. package/generators/app/index.js.map +1 -0
  4. package/generators/app/templates/typescript/auth/_package.json +12 -18
  5. package/generators/app/templates/typescript/auth/src/index.ts +1 -1
  6. package/generators/app/templates/typescript/auth/types/index.ts +1 -1
  7. package/generators/app/templates/typescript/common/eslintrc +10 -1
  8. package/generators/app/templates/typescript/common/index.js +13 -0
  9. package/generators/app/templates/typescript/common/index.js~Stashed changes +7 -0
  10. package/generators/app/templates/typescript/common/jest.config.js +1 -7
  11. package/generators/app/templates/typescript/common/npmignore +1 -2
  12. package/generators/app/templates/typescript/common/tsconfig.json +3 -6
  13. package/generators/app/templates/typescript/middleware/_package.json +13 -19
  14. package/generators/app/templates/typescript/middleware/src/index.ts +7 -7
  15. package/generators/app/templates/typescript/middleware/types/index.ts +1 -1
  16. package/generators/app/templates/typescript/storage/_package.json +12 -17
  17. package/generators/app/templates/typescript/storage/src/PackageStorage.ts +17 -17
  18. package/generators/app/templates/typescript/storage/src/index.ts +1 -1
  19. package/generators/app/templates/typescript/storage/src/plugin.ts +8 -8
  20. package/generators/app/templates/typescript/storage/types/index.ts +1 -1
  21. package/package.json +79 -38
  22. package/CHANGELOG.md +0 -106
  23. package/generators/app/index.d.ts +0 -11
  24. package/generators/app/index.ts +0 -215
  25. package/generators/app/templates/.eslintrc +0 -5
  26. package/generators/app/templates/javascript/.eslintrc +0 -5
  27. package/generators/app/templates/javascript/auth/_package.json +0 -33
  28. package/generators/app/templates/javascript/auth/src/index.js +0 -35
  29. package/generators/app/templates/javascript/common/README.md +0 -22
  30. package/generators/app/templates/javascript/common/babelrc +0 -3
  31. package/generators/app/templates/javascript/common/editorconfig +0 -12
  32. package/generators/app/templates/javascript/common/eslintignore +0 -2
  33. package/generators/app/templates/javascript/common/eslintrc +0 -3
  34. package/generators/app/templates/javascript/common/gitignore +0 -3
  35. package/generators/app/templates/javascript/common/index.js +0 -1
  36. package/generators/app/templates/javascript/common/jest.config.js +0 -10
  37. package/generators/app/templates/javascript/common/npmignore +0 -4
  38. package/generators/app/templates/javascript/common/travis.yml +0 -6
  39. package/generators/app/templates/javascript/middleware/_package.json +0 -34
  40. package/generators/app/templates/javascript/middleware/src/index.js +0 -8
  41. package/generators/app/templates/javascript/storage/_package.json +0 -33
  42. package/generators/app/templates/javascript/storage/src/PackageStorage.js +0 -153
  43. package/generators/app/templates/javascript/storage/src/index.js +0 -1
  44. package/generators/app/templates/javascript/storage/src/plugin.js +0 -106
  45. package/generators/app/templates/typescript/common/babelrc +0 -3
  46. package/generators/app/templates/typescript/common/index.ts +0 -3
  47. package/generators/app/templates/typescript/common/travis.yml +0 -6
  48. package/generators/app/types.d.ts +0 -10
  49. package/generators/app/types.js +0 -2
  50. 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
- [![Dependency Status][daviddm-image]][daviddm-url]
5
- [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=verdaccio/generator-verdaccio-plugin)](https://dependabot.com)
6
- [![DevDependencies](https://david-dm.org/verdaccio/generator-verdaccio-plugin/master/dev-status.svg)](https://david-dm.org/verdaccio/generator-verdaccio-plugin/master?type=dev)
4
+ generator-verdaccio-plugin/master?type=dev)
7
5
  [![License](https://img.shields.io/github/license/verdaccio/generator-verdaccio-plugin)](./LICENSE)
8
-
9
6
  [![Backers](https://opencollective.com/verdaccio/tiers/backer/badge.svg?label=Backer&color=brightgreen)](https://opencollective.com/verdaccio)
10
7
  [![Stackshare](https://img.shields.io/badge/Follow%20on-StackShare-blue.svg?logo=stackshare&style=flat)](https://stackshare.io/verdaccio)
11
8
  [![Discord](https://img.shields.io/discord/388674437219745793?logo=discord)](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
@@ -1,134 +1,128 @@
1
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 path_1 = require("path");
7
- const yeoman_generator_1 = __importDefault(require("yeoman-generator"));
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const lodash_1 = __importDefault(require("lodash"));
10
- const yosay = require("yosay");
11
- class VerdaccioPluginGenerator extends yeoman_generator_1.default {
12
- constructor(args, opts) {
13
- super(args, opts);
14
- this.projectName = "verdaccio-";
15
- this.destinationPathName = "verdaccio-";
16
- this.props = {};
17
- }
18
- prompting() {
19
- // Have Yeoman greet the user.
20
- this.log(yosay("Welcome to " +
21
- chalk_1.default.red("generator-verdaccio-plugin") +
22
- " plugin generator!"));
23
- const prompts = [
24
- {
25
- type: "input",
26
- name: "name",
27
- require: true,
28
- message: "What is the name of your plugin?",
29
- default: "customname",
30
- validate: function (input) {
31
- return input !== "";
32
- }
33
- },
34
- {
35
- type: "list",
36
- name: "lang",
37
- require: true,
38
- message: "Select Language",
39
- default: "typescript",
40
- store: true,
41
- choices: [{ value: "typescript" }, { value: "javascript" }]
42
- },
43
- {
44
- type: "list",
45
- name: "pluginType",
46
- require: true,
47
- message: "What kind of plugin you want to create?",
48
- store: true,
49
- choices: [
50
- { value: "auth" },
51
- { value: "storage" },
52
- { value: "middleware" }
53
- ]
54
- },
55
- {
56
- type: "input",
57
- name: "description",
58
- message: "Please, describe your plugin",
59
- default: "An amazing verdaccio plugin"
60
- },
61
- {
62
- name: "githubUsername",
63
- message: "GitHub username or organization",
64
- validate: function (input) {
65
- return input !== "";
66
- }
67
- },
68
- {
69
- name: "authorName",
70
- message: "Author's Name",
71
- store: true
72
- },
73
- {
74
- name: "authorEmail",
75
- message: "Author's Email",
76
- store: true
77
- },
78
- {
79
- name: "keywords",
80
- message: "Key your keywords (comma to split)",
81
- filter: function (keywords) {
82
- return lodash_1.default.uniq(lodash_1.default.words(keywords).concat(["verdaccio-"]));
83
- }
84
- }
85
- ];
86
- return this.prompt(prompts).then(function (_props) {
87
- // To access props later use this.props.someAnswer;
88
- // @ts-ignore
89
- this.props = _props;
90
- const { name, githubUsername } = _props;
91
- // @ts-ignore
92
- this.props.license = "MIT";
93
- if (githubUsername) {
94
- // @ts-ignore
95
- this.props.repository = githubUsername + "/" + name;
96
- }
97
- // @ts-ignore
98
- this.projectName = `verdaccio-${name}`;
99
- // @ts-ignore
100
- this.destinationPathName = path_1.resolve(this.projectName);
101
- // @ts-ignore
102
- this.props.name = this.projectName;
103
- }.bind(this));
104
- }
105
- packageJSON() {
106
- const { lang, pluginType } = this.props;
107
- const pkgJsonLocation = `${lang}/${pluginType}/_package.json`;
108
- this.fs.copyTpl(this.templatePath(pkgJsonLocation), this.destinationPath(path_1.resolve(this.destinationPathName, "package.json")), this.props);
109
- }
110
- writing() {
111
- const { lang } = this.props;
112
- this.fs.copy(this.templatePath(`${lang}/common/gitignore`), this.destinationPath(path_1.resolve(this.destinationPathName, ".gitignore")));
113
- this.fs.copy(this.templatePath(`${lang}/common/npmignore`), this.destinationPath(path_1.resolve(this.destinationPathName, ".npmignore")));
114
- this.fs.copy(this.templatePath(`${lang}/common/jest.config.js`), this.destinationPath(path_1.resolve(this.destinationPathName, "jest.config.js")));
115
- this.fs.copy(this.templatePath(`${lang}/common/babelrc`), this.destinationPath(path_1.resolve(this.destinationPathName, ".babelrc")));
116
- this.fs.copy(this.templatePath(`${lang}/common/travis.yml`), this.destinationPath(path_1.resolve(this.destinationPathName, ".travis.yml")));
117
- this.fs.copy(this.templatePath(`${lang}/common/travis.yml`), this.destinationPath(path_1.resolve(this.destinationPathName, ".travis.yml")));
118
- this.fs.copyTpl(this.templatePath(`${lang}/common/README.md`), this.destinationPath(path_1.resolve(this.destinationPathName, "README.md")), this.props);
119
- this.fs.copyTpl(this.templatePath(`${lang}/common/eslintrc`), this.destinationPath(path_1.resolve(this.destinationPathName, ".eslintrc")), this.props);
120
- this.fs.copyTpl(this.templatePath(`${lang}/common/eslintignore`), this.destinationPath(path_1.resolve(this.destinationPathName, ".eslintignore")), this.props);
121
- this.fs.copy(this.templatePath(`${lang}/${this.props.pluginType}/src`), this.destinationPath(path_1.resolve(this.destinationPathName, "src")), this.props);
122
- this.fs.copy(this.templatePath(`${lang}/common/index.${lang == "typescript" ? "ts" : "js"}`), this.destinationPath(path_1.resolve(this.destinationPathName, `index.${lang == "typescript" ? "ts" : "js"}`)), this.props);
123
- if (lang == "typescript") {
124
- this.fs.copy(this.templatePath(`${lang}/common/tsconfig.json`), this.destinationPath(path_1.resolve(this.destinationPathName, "tsconfig.json")), this.props);
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
- exports.default = VerdaccioPluginGenerator;
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,IAAD,EAAOC,IAAP,EAAa;IACtB,MAAMD,IAAN,EAAYC,IAAZ;IACA,KAAKC,KAAL,GAAa,EAAb;EACD;;EAEDC,SAAS,GAAG;IACV,KAAKC,GAAL,CACIX,KAAK,CACD,gBACFY,cAAA,CAAMC,GAAN,CAAU,4BAAV,CADE,GAEF,oBAHG,CADT;IAQA,MAAMC,OAAO,GAAG,CACd;MACEC,IAAI,EAAE,OADR;MAEEC,IAAI,EAAE,MAFR;MAGEf,OAAO,EAAE,IAHX;MAIEgB,OAAO,EAAE,kCAJX;MAKEC,OAAO,EAAE,YALX;MAMEC,QAAQ,EAAE,UAASC,KAAT,EAAgB;QACxB,OAAOA,KAAK,KAAK,EAAjB;MACD;IARH,CADc,EAWd;MACEL,IAAI,EAAE,MADR;MAEEC,IAAI,EAAE,YAFR;MAGEf,OAAO,EAAE,IAH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K/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": ">=10"
9
+ "node": ">=12"
10
10
  },
11
11
  "dependencies": {
12
- "@verdaccio/commons-api": "^9.6.1"
12
+ "@verdaccio/commons-api": "latest",
13
13
  },
14
14
  "devDependencies": {
15
- "@types/jest": "^24.0.21",
15
+ "@types/jest": "27.5.1",
16
16
  "@types/node": "^12.12.5",
17
- "@types/express": "^4.17.1",
18
- "@typescript-eslint/eslint-plugin": "^2.12.0",
19
- "@verdaccio/babel-preset": "^9.6.1",
20
- "@verdaccio/eslint-config": "^9.3.2",
21
- "@verdaccio/types": "^9.5.0",
22
- "eslint": "^6.6.0",
23
- "jest": "^26.0.1 ",
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
- "release": "standard-version -a -s",
34
- "build": "npm run build:types && npm run build:js",
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
  }
@@ -8,7 +8,7 @@ import {
8
8
  Logger,
9
9
  } from '@verdaccio/types';
10
10
 
11
- import { CustomConfig } from '../types/index';
11
+ import {CustomConfig} from '../types/index';
12
12
 
13
13
  /**
14
14
  * Custom Verdaccio Authenticate Plugin.
@@ -1,4 +1,4 @@
1
- import { Config } from '@verdaccio/types';
1
+ import {Config} from '@verdaccio/types';
2
2
 
3
3
  export interface CustomConfig extends Config {
4
4
  foo: string;
@@ -1,3 +1,12 @@
1
1
  {
2
- "extends": ["@verdaccio"]
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
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
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
  };
@@ -1,4 +1,3 @@
1
1
  src/
2
2
  .eslintrc
3
- .babelrc
4
- test/
3
+ test/
@@ -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": ">=10"
9
+ "node": ">=12"
10
10
  },
11
11
  "dependencies": {
12
- "@verdaccio/commons-api": "^9.6.1",
13
- "express": "^4.17.1"
12
+ "@verdaccio/commons-api": "latest",
13
+ "express": "4.18.1"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/jest": "^24.0.21",
16
+ "@types/jest": "27.5.1",
17
17
  "@types/node": "^12.12.5",
18
- "@types/express": "^4.17.1",
19
- "@typescript-eslint/eslint-plugin": "^2.12.0",
20
- "@verdaccio/babel-preset": "^9.6.1",
21
- "@verdaccio/eslint-config": "^9.3.2",
22
- "@verdaccio/types": "^9.5.0",
23
- "eslint": "^6.6.0",
24
- "jest": "^26.0.1 ",
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
- "release": "standard-version -a -s",
35
- "build": "npm run build:types && npm run build:js",
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 { Logger, IPluginMiddleware, IBasicAuth, IStorageManager, PluginOptions } from '@verdaccio/types';
2
- import { Router, Request, Response, NextFunction, Application } from 'express';
1
+ import {Logger, IPluginMiddleware, IBasicAuth, IStorageManager, PluginOptions} from '@verdaccio/types';
2
+ import {Router, Request, Response, NextFunction, Application} from 'express';
3
3
 
4
- import { CustomConfig } from '../types/index';
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
- app: Application,
16
- auth: IBasicAuth<CustomConfig>,
17
- /* eslint @typescript-eslint/no-unused-vars: off */
18
- _storage: IStorageManager<CustomConfig>
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
@@ -1,4 +1,4 @@
1
- import { Config } from '@verdaccio/types';
1
+ import {Config} from '@verdaccio/types';
2
2
 
3
3
  export interface CustomConfig extends Config {
4
4
  foo: string;
@@ -9,32 +9,27 @@
9
9
  "node": ">=10"
10
10
  },
11
11
  "dependencies": {
12
- "@verdaccio/commons-api": "^8.5.0",
13
- "@verdaccio/streams": "^9.6.1"
12
+ "@verdaccio/commons-api": "latest",
13
+ "@verdaccio/streams": "latest"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/jest": "^24.0.21",
16
+ "@types/jest": "27.5.1",
17
17
  "@types/node": "^12.12.5",
18
- "@types/express": "^4.17.1",
19
- "@typescript-eslint/eslint-plugin": "^2.12.0",
20
- "@verdaccio/babel-preset": "^9.6.1",
21
- "@verdaccio/eslint-config": "^9.3.2",
22
- "@verdaccio/types": "^9.5.0",
23
- "eslint": "^6.6.0",
24
- "jest": "^26.0.1 ",
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
- "release": "standard-version -a -s",
34
- "build": "npm run build:types && npm run build:js",
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
  }