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
|
@@ -7,21 +7,21 @@ import {
|
|
|
7
7
|
StorageWriteCallback,
|
|
8
8
|
CallbackAction,
|
|
9
9
|
Package,
|
|
10
|
-
ReadPackageCallback
|
|
11
|
-
} from
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
ReadPackageCallback,
|
|
11
|
+
} from '@verdaccio/types';
|
|
12
|
+
import {UploadTarball, ReadTarball} from '@verdaccio/streams';
|
|
13
|
+
import {getNotFound, getConflict, getInternalError} from '@verdaccio/commons-api';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {CustomConfig} from '../types/index';
|
|
16
16
|
export default class StoragePluginManage implements ILocalPackageManager {
|
|
17
17
|
public logger: Logger;
|
|
18
18
|
public packageName: string;
|
|
19
19
|
public config: CustomConfig;
|
|
20
20
|
|
|
21
21
|
public constructor(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
config: CustomConfig,
|
|
23
|
+
packageName: string,
|
|
24
|
+
logger: Logger,
|
|
25
25
|
) {
|
|
26
26
|
this.logger = logger;
|
|
27
27
|
this.packageName = packageName;
|
|
@@ -37,11 +37,11 @@ export default class StoragePluginManage implements ILocalPackageManager {
|
|
|
37
37
|
* @param onEnd
|
|
38
38
|
*/
|
|
39
39
|
public updatePackage(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
name: string,
|
|
41
|
+
updateHandler: StorageUpdateCallback,
|
|
42
|
+
onWrite: StorageWriteCallback,
|
|
43
|
+
transformPackage: PackageTransformer,
|
|
44
|
+
onEnd: CallbackAction,
|
|
45
45
|
): void {
|
|
46
46
|
/**
|
|
47
47
|
* Example of implementation:
|
|
@@ -100,9 +100,9 @@ export default class StoragePluginManage implements ILocalPackageManager {
|
|
|
100
100
|
* @param callback
|
|
101
101
|
*/
|
|
102
102
|
public createPackage(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
name: string,
|
|
104
|
+
data: Package,
|
|
105
|
+
callback: CallbackAction,
|
|
106
106
|
): void {
|
|
107
107
|
/**
|
|
108
108
|
* Example of implementation:
|
|
@@ -161,7 +161,7 @@ export default class StoragePluginManage implements ILocalPackageManager {
|
|
|
161
161
|
* @param name
|
|
162
162
|
*/
|
|
163
163
|
public writeTarball(name: string): UploadTarball {
|
|
164
|
-
|
|
164
|
+
/**
|
|
165
165
|
* Example of implementation:
|
|
166
166
|
* const stream = new UploadTarball({});
|
|
167
167
|
return stream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {default} from './plugin';
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
Config,
|
|
10
10
|
onEndSearchPackage,
|
|
11
11
|
onSearchPackage,
|
|
12
|
-
onValidatePackage
|
|
12
|
+
onValidatePackage,
|
|
13
13
|
} from '@verdaccio/types';
|
|
14
|
-
import {
|
|
14
|
+
import {getInternalError} from '@verdaccio/commons-api';
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {CustomConfig} from '../types/index';
|
|
17
17
|
|
|
18
18
|
import PackageStorage from './PackageStorage';
|
|
19
19
|
|
|
@@ -22,8 +22,8 @@ export default class VerdaccioStoragePlugin implements IPluginStorage<CustomConf
|
|
|
22
22
|
version?: string;
|
|
23
23
|
public logger: Logger;
|
|
24
24
|
public constructor(
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
config: CustomConfig,
|
|
26
|
+
options: PluginOptions<CustomConfig>,
|
|
27
27
|
) {
|
|
28
28
|
this.config = config;
|
|
29
29
|
this.logger = options.logger;
|
|
@@ -60,9 +60,9 @@ export default class VerdaccioStoragePlugin implements IPluginStorage<CustomConf
|
|
|
60
60
|
* @param validateName
|
|
61
61
|
*/
|
|
62
62
|
public search(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
onPackage: onSearchPackage,
|
|
64
|
+
onEnd: onEndSearchPackage,
|
|
65
|
+
validateName: onValidatePackage,
|
|
66
66
|
): void {
|
|
67
67
|
/**
|
|
68
68
|
* Example of implementation:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-verdaccio-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-next.2",
|
|
4
4
|
"description": "plugin generator for verdaccio",
|
|
5
5
|
"homepage": "https://github.com/verdaccio",
|
|
6
6
|
"author": {
|
|
@@ -11,55 +11,96 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"generators"
|
|
13
13
|
],
|
|
14
|
-
"main": "generators/app/index.js",
|
|
15
14
|
"keywords": [
|
|
16
15
|
"verdaccio-plugin",
|
|
17
16
|
"yeoman-generator"
|
|
18
17
|
],
|
|
19
18
|
"dependencies": {
|
|
20
|
-
"chalk": "
|
|
21
|
-
"lodash": "
|
|
22
|
-
"yeoman-
|
|
23
|
-
"
|
|
19
|
+
"chalk": "4.1.2",
|
|
20
|
+
"lodash": "4.17.21",
|
|
21
|
+
"yeoman-environment": "3.9.1",
|
|
22
|
+
"yeoman-generator": "5.6.1",
|
|
23
|
+
"yosay": "2.0.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"typescript": "
|
|
50
|
-
"
|
|
51
|
-
"
|
|
26
|
+
"@babel/cli": "7.16.8",
|
|
27
|
+
"@babel/core": "7.16.12",
|
|
28
|
+
"@babel/node": "7.16.8",
|
|
29
|
+
"@changesets/changelog-github": "0.4.2",
|
|
30
|
+
"@changesets/cli": "2.15.0",
|
|
31
|
+
"@changesets/get-dependents-graph": "1.2.4",
|
|
32
|
+
"@babel/plugin-proposal-class-properties": "7.16.7",
|
|
33
|
+
"@babel/plugin-proposal-decorators": "7.16.7",
|
|
34
|
+
"@babel/plugin-proposal-export-namespace-from": "7.16.7",
|
|
35
|
+
"@babel/plugin-proposal-function-sent": "7.16.7",
|
|
36
|
+
"@babel/plugin-proposal-json-strings": "7.16.7",
|
|
37
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.16.7",
|
|
38
|
+
"@babel/plugin-proposal-numeric-separator": "7.16.7",
|
|
39
|
+
"@babel/plugin-proposal-object-rest-spread": "7.16.7",
|
|
40
|
+
"@babel/plugin-proposal-optional-chaining": "7.16.7",
|
|
41
|
+
"@babel/plugin-proposal-throw-expressions": "7.16.7",
|
|
42
|
+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
43
|
+
"@babel/plugin-syntax-import-meta": "7.10.4",
|
|
44
|
+
"@babel/plugin-transform-async-to-generator": "7.16.8",
|
|
45
|
+
"@babel/plugin-transform-classes": "7.16.7",
|
|
46
|
+
"@babel/plugin-transform-runtime": "7.16.10",
|
|
47
|
+
"@babel/preset-env": "7.16.11",
|
|
48
|
+
"@babel/preset-react": "7.16.7",
|
|
49
|
+
"@babel/preset-typescript": "7.16.7",
|
|
50
|
+
"@babel/register": "7.16.9",
|
|
51
|
+
"@babel/runtime": "7.16.7",
|
|
52
|
+
"@trivago/prettier-plugin-sort-imports": "3.2.0",
|
|
53
|
+
"@types/chalk": "2.2.0",
|
|
54
|
+
"@types/express": "4.17.13",
|
|
55
|
+
"@types/lodash": "4.14.182",
|
|
56
|
+
"@types/mocha": "9.1.1",
|
|
57
|
+
"@types/node": "17.0.40",
|
|
58
|
+
"@types/yeoman-environment": "2.10.7",
|
|
59
|
+
"@types/yeoman-generator": "5.2.10",
|
|
60
|
+
"@types/yeoman-test": "4.0.3",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "5.25.0",
|
|
62
|
+
"@typescript-eslint/parser": "5.25.0",
|
|
63
|
+
"@verdaccio/types": "10.4.2",
|
|
64
|
+
"eslint": "8.17.0",
|
|
65
|
+
"eslint-config-google": "0.14.0",
|
|
66
|
+
"npm-run-all": "4.1.5",
|
|
67
|
+
"eslint-config-prettier": "8.5.0",
|
|
68
|
+
"eslint-plugin-babel": "5.3.1",
|
|
69
|
+
"eslint-plugin-import": "2.26.0",
|
|
70
|
+
"eslint-plugin-jest": "26.2.2",
|
|
71
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
72
|
+
"eslint-plugin-simple-import-sort": "7.0.0",
|
|
73
|
+
"express": "4.18.1",
|
|
74
|
+
"jest": "28.1.1",
|
|
75
|
+
"prettier": "2.6.2",
|
|
76
|
+
"ts-jest": "^28.0.4",
|
|
77
|
+
"typescript": "4.7.3",
|
|
78
|
+
"yeoman-assert": "3.1.1",
|
|
79
|
+
"yeoman-test": "6.3.0"
|
|
80
|
+
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=12"
|
|
52
83
|
},
|
|
53
84
|
"repository": {
|
|
54
85
|
"type": "git",
|
|
55
86
|
"url": "git://github.com/verdaccio/generator-verdaccio-plugin"
|
|
56
87
|
},
|
|
88
|
+
"license": "MIT",
|
|
57
89
|
"scripts": {
|
|
90
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
|
91
|
+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
|
58
92
|
"release": "standard-version -a -s",
|
|
59
|
-
"
|
|
60
|
-
"build": "
|
|
61
|
-
"
|
|
62
|
-
"
|
|
93
|
+
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
94
|
+
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
95
|
+
"build": "babel src/ --out-dir generators/ --copy-files --extensions \".ts,.tsx\" --source-maps --ignore src/app/templates",
|
|
96
|
+
"test": "jest",
|
|
97
|
+
"lint": "eslint --max-warnings 0 \"**/*.{js,ts}\"",
|
|
98
|
+
"changeset": "changeset",
|
|
99
|
+
"changeset:check": "changeset status --since-master",
|
|
100
|
+
"ci:version": "run-s ci:version:changeset ci:version:install",
|
|
101
|
+
"ci:version:install": "pnpm install --frozen-lockfile=false",
|
|
102
|
+
"ci:version:changeset": "changeset version",
|
|
103
|
+
"ci:publish": "changeset publish"
|
|
63
104
|
},
|
|
64
|
-
"
|
|
65
|
-
}
|
|
105
|
+
"readme": "# Verdaccio plugin generator\n\n[![NPM version][npm-image]][npm-url]\ngenerator-verdaccio-plugin/master?type=dev)\n[](./LICENSE)\n[](https://opencollective.com/verdaccio)\n[](https://stackshare.io/verdaccio)\n[](http://chat.verdaccio.org/)\n[](https://twitter.com/verdaccio_npm)\n\nVerdaccio plugin generator based in [Yeoman](http://yeoman.io) aims to help to scaffold plugins development\n\n### Maintainers\n\n* [Anix](https://github.com/anikethsaha)\n* [Juan Picado](https://github.com/juanpicado)\n\n## Installation\n\nFirst, install [Yeoman](http://yeoman.io) and generator-verdaccio-plugin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).\n\n```bash\nnpm install -g yo\nnpm install -g generator-verdaccio-plugin\n```\n\nThen generate your new project:\n\n```bash\nyo verdaccio-plugin\n```\n\n## Plugin Types Supported\n\n- Authentication\n- Storage\n- Middleware\n\n\n## License\n\nMIT © [Juan Picado <@jotadeveloper>]()\n\n[npm-image]: https://badge.fury.io/js/generator-verdaccio-plugin.svg\n[npm-url]: https://npmjs.org/package/generator-verdaccio-plugin\n[daviddm-image]: https://david-dm.org/verdaccio/generator-verdaccio-plugin.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/verdaccio/generator-verdaccio-plugin\n"
|
|
106
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
### [3.0.1](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v3.0.0...v3.0.1) (2020-12-23)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
* release workflow ([4fb266f](https://github.com/verdaccio/generator-verdaccio-plugin/commit/4fb266f296d4a0b7aa841ff3ef81de0a5be1e927))
|
|
11
|
-
|
|
12
|
-
## [3.0.0](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v2.0.1...v3.0.0) (2020-12-23)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Bug Fixes
|
|
16
|
-
|
|
17
|
-
* remove node 10 support ([6c0604e](https://github.com/verdaccio/generator-verdaccio-plugin/commit/6c0604ef68007e19ad4eb42f6f74072d1c7270c4))
|
|
18
|
-
|
|
19
|
-
### [2.0.1](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v2.0.0...v2.0.1) (2020-12-23)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Bug Fixes
|
|
23
|
-
|
|
24
|
-
* package.json & yarn.lock to reduce vulnerabilities ([#36](https://github.com/verdaccio/generator-verdaccio-plugin/issues/36)) ([097db60](https://github.com/verdaccio/generator-verdaccio-plugin/commit/097db607a3540b06bba261ede7e0db6982fb665f))
|
|
25
|
-
* update dependencies ([3fd5a14](https://github.com/verdaccio/generator-verdaccio-plugin/commit/3fd5a14cde0e46dce01bc582e6e77d3e67a91cad))
|
|
26
|
-
|
|
27
|
-
## [2.0.0](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.5...v2.0.0) (2020-07-17)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### ⚠ BREAKING CHANGES
|
|
31
|
-
|
|
32
|
-
* Use Nodev10 minimum
|
|
33
|
-
|
|
34
|
-
* chore: fix linting
|
|
35
|
-
|
|
36
|
-
### Features
|
|
37
|
-
|
|
38
|
-
* update dependencies and remove Node v8 ([#27](https://github.com/verdaccio/generator-verdaccio-plugin/issues/27)) ([397e58e](https://github.com/verdaccio/generator-verdaccio-plugin/commit/397e58e93f748cd0662bd2ec337c80b42f70a021))
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### Bug Fixes
|
|
42
|
-
|
|
43
|
-
* storage template ([#35](https://github.com/verdaccio/generator-verdaccio-plugin/issues/35)) ([e5ef0ef](https://github.com/verdaccio/generator-verdaccio-plugin/commit/e5ef0efdc0278ba17e4008581c014aa77a61f42c))
|
|
44
|
-
* update dependencies ([#34](https://github.com/verdaccio/generator-verdaccio-plugin/issues/34)) ([ffc6421](https://github.com/verdaccio/generator-verdaccio-plugin/commit/ffc642117aa2c071473325d6db210d18b09865b0))
|
|
45
|
-
* upgrade yeoman-generator from 4.3.0 to 4.4.0 ([#22](https://github.com/verdaccio/generator-verdaccio-plugin/issues/22)) ([e3a9a3a](https://github.com/verdaccio/generator-verdaccio-plugin/commit/e3a9a3a6be98d6eabaf740369819baa977999d7b))
|
|
46
|
-
* upgrade yeoman-generator from 4.4.0 to 4.5.0 ([#23](https://github.com/verdaccio/generator-verdaccio-plugin/issues/23)) ([6f3cffa](https://github.com/verdaccio/generator-verdaccio-plugin/commit/6f3cffab99ef5eb0e6bc2bcfdd5ab118f9c83022))
|
|
47
|
-
|
|
48
|
-
### [1.1.5](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.4...v1.1.5) (2019-12-26)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Bug Fixes
|
|
52
|
-
|
|
53
|
-
* plugin type is not part of the name ([#21](https://github.com/verdaccio/generator-verdaccio-plugin/issues/21)) ([8e69fa6](https://github.com/verdaccio/generator-verdaccio-plugin/commit/8e69fa66070d53f0bf7961931f71d07743eb6652))
|
|
54
|
-
|
|
55
|
-
### [1.1.4](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.3...v1.1.4) (2019-12-26)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### Bug Fixes
|
|
59
|
-
|
|
60
|
-
* plugin suffix ([#19](https://github.com/verdaccio/generator-verdaccio-plugin/issues/19)) ([d7d0c02](https://github.com/verdaccio/generator-verdaccio-plugin/commit/d7d0c02e689ac904109ebe7bc66114acdae14f84))
|
|
61
|
-
* remove suffix ([#20](https://github.com/verdaccio/generator-verdaccio-plugin/issues/20)) ([28df490](https://github.com/verdaccio/generator-verdaccio-plugin/commit/28df490347ad46e9593955d764c24850aeaefffc))
|
|
62
|
-
|
|
63
|
-
### [1.1.3](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2...v1.1.3) (2019-12-25)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
* refactor storage template ([#18](https://github.com/verdaccio/generator-verdaccio-plugin/issues/18)) ([19b609a](https://github.com/verdaccio/generator-verdaccio-plugin/commit/19b609aebf582bd308f0ae9324add859a873c475))
|
|
69
|
-
|
|
70
|
-
### [1.1.2](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-6...v1.1.2) (2019-12-23)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Bug Fixes
|
|
74
|
-
|
|
75
|
-
* auth minor bugs ([#17](https://github.com/verdaccio/generator-verdaccio-plugin/issues/17)) ([f948088](https://github.com/verdaccio/generator-verdaccio-plugin/commit/f9480884dcc67dcc05913989b366ec0905d1f41a))
|
|
76
|
-
|
|
77
|
-
### [1.1.2-6](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-5...v1.1.2-6) (2019-12-23)
|
|
78
|
-
|
|
79
|
-
### [1.1.2-5](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-4...v1.1.2-5) (2019-12-23)
|
|
80
|
-
|
|
81
|
-
### [1.1.2-4](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-3...v1.1.2-4) (2019-12-23)
|
|
82
|
-
|
|
83
|
-
### [1.1.2-3](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-2...v1.1.2-3) (2019-12-23)
|
|
84
|
-
|
|
85
|
-
### [1.1.2-2](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-1...v1.1.2-2) (2019-12-23)
|
|
86
|
-
|
|
87
|
-
### [1.1.2-1](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.2-0...v1.1.2-1) (2019-12-23)
|
|
88
|
-
|
|
89
|
-
### [1.1.2-0](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.1...v1.1.2-0) (2019-12-23)
|
|
90
|
-
|
|
91
|
-
### [1.1.1](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.1.0...v1.1.1) (2019-12-23)
|
|
92
|
-
|
|
93
|
-
## [1.1.0](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v1.0.7...v1.1.0) (2019-12-23)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### Features
|
|
97
|
-
|
|
98
|
-
* improve auth example ([#16](https://github.com/verdaccio/generator-verdaccio-plugin/issues/16)) ([4d7a2da](https://github.com/verdaccio/generator-verdaccio-plugin/commit/4d7a2da934121c5e2026f9d5c55d9bfa84b4bfc5))
|
|
99
|
-
|
|
100
|
-
### [1.0.7](https://github.com/verdaccio/generator-verdaccio-plugin/compare/v0.1.0...v1.0.7) (2019-12-22)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
### Bug Fixes
|
|
104
|
-
|
|
105
|
-
* issue on generate template ([#15](https://github.com/verdaccio/generator-verdaccio-plugin/issues/15)) ([61eeae8](https://github.com/verdaccio/generator-verdaccio-plugin/commit/61eeae886b7e99a115055097cefd6ccc6ad17381))
|
|
106
|
-
* major file handling fixes ([0c9e890](https://github.com/verdaccio/generator-verdaccio-plugin/commit/0c9e890f021e6598b0105cdd82e93993aea1e4e1))
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Generator from "yeoman-generator";
|
|
2
|
-
export default class VerdaccioPluginGenerator extends Generator {
|
|
3
|
-
private props;
|
|
4
|
-
private projectName;
|
|
5
|
-
private destinationPathName;
|
|
6
|
-
constructor(args: any, opts: any);
|
|
7
|
-
prompting(): Promise<void>;
|
|
8
|
-
packageJSON(): void;
|
|
9
|
-
writing(): void;
|
|
10
|
-
install(): void;
|
|
11
|
-
}
|
package/generators/app/index.ts
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
|
|
3
|
-
import Generator from "yeoman-generator";
|
|
4
|
-
import chalk from "chalk";
|
|
5
|
-
import _ from "lodash";
|
|
6
|
-
|
|
7
|
-
import { propsTypes } from "./types";
|
|
8
|
-
|
|
9
|
-
const yosay = require("yosay");
|
|
10
|
-
|
|
11
|
-
export default class VerdaccioPluginGenerator extends Generator {
|
|
12
|
-
private props: propsTypes;
|
|
13
|
-
private projectName: string = "verdaccio-";
|
|
14
|
-
private destinationPathName: string = "verdaccio-";
|
|
15
|
-
constructor(args, opts) {
|
|
16
|
-
super(args, opts);
|
|
17
|
-
this.props = {};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
prompting() {
|
|
21
|
-
// Have Yeoman greet the user.
|
|
22
|
-
this.log(
|
|
23
|
-
yosay(
|
|
24
|
-
"Welcome to " +
|
|
25
|
-
chalk.red("generator-verdaccio-plugin") +
|
|
26
|
-
" plugin generator!"
|
|
27
|
-
)
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const prompts = [
|
|
31
|
-
{
|
|
32
|
-
type: "input",
|
|
33
|
-
name: "name",
|
|
34
|
-
require: true,
|
|
35
|
-
message: "What is the name of your plugin?",
|
|
36
|
-
default: "customname",
|
|
37
|
-
validate: function(input) {
|
|
38
|
-
return input !== "";
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
type: "list",
|
|
43
|
-
name: "lang",
|
|
44
|
-
require: true,
|
|
45
|
-
message: "Select Language",
|
|
46
|
-
default: "typescript",
|
|
47
|
-
store: true,
|
|
48
|
-
choices: [{ value: "typescript" }, { value: "javascript" }]
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: "list",
|
|
52
|
-
name: "pluginType",
|
|
53
|
-
require: true,
|
|
54
|
-
message: "What kind of plugin you want to create?",
|
|
55
|
-
store: true,
|
|
56
|
-
choices: [
|
|
57
|
-
{ value: "auth" },
|
|
58
|
-
{ value: "storage" },
|
|
59
|
-
{ value: "middleware" }
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: "input",
|
|
64
|
-
name: "description",
|
|
65
|
-
message: "Please, describe your plugin",
|
|
66
|
-
default: "An amazing verdaccio plugin"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "githubUsername",
|
|
70
|
-
message: "GitHub username or organization",
|
|
71
|
-
validate: function(input) {
|
|
72
|
-
return input !== "";
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: "authorName",
|
|
77
|
-
message: "Author's Name",
|
|
78
|
-
store: true
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "authorEmail",
|
|
82
|
-
message: "Author's Email",
|
|
83
|
-
store: true
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: "keywords",
|
|
87
|
-
message: "Key your keywords (comma to split)",
|
|
88
|
-
filter: function(keywords) {
|
|
89
|
-
return _.uniq(_.words(keywords).concat(["verdaccio-"]));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
|
|
94
|
-
return this.prompt(prompts).then(
|
|
95
|
-
function(_props) {
|
|
96
|
-
// To access props later use this.props.someAnswer;
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
this.props = _props;
|
|
99
|
-
const { name, githubUsername } = _props;
|
|
100
|
-
// @ts-ignore
|
|
101
|
-
this.props.license = "MIT";
|
|
102
|
-
if (githubUsername) {
|
|
103
|
-
// @ts-ignore
|
|
104
|
-
this.props.repository = githubUsername + "/" + name;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// @ts-ignore
|
|
108
|
-
this.projectName = `verdaccio-${name}`;
|
|
109
|
-
|
|
110
|
-
// @ts-ignore
|
|
111
|
-
this.destinationPathName = resolve(this.projectName);
|
|
112
|
-
// @ts-ignore
|
|
113
|
-
this.props.name = this.projectName;
|
|
114
|
-
}.bind(this)
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
packageJSON() {
|
|
119
|
-
const { lang, pluginType } = this.props;
|
|
120
|
-
const pkgJsonLocation = `${lang}/${pluginType}/_package.json`;
|
|
121
|
-
this.fs.copyTpl(
|
|
122
|
-
this.templatePath(pkgJsonLocation),
|
|
123
|
-
this.destinationPath(resolve(this.destinationPathName, "package.json")),
|
|
124
|
-
this.props
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
writing() {
|
|
129
|
-
const { lang } = this.props;
|
|
130
|
-
this.fs.copy(
|
|
131
|
-
this.templatePath(`${lang}/common/gitignore`),
|
|
132
|
-
this.destinationPath(resolve(this.destinationPathName, ".gitignore"))
|
|
133
|
-
);
|
|
134
|
-
this.fs.copy(
|
|
135
|
-
this.templatePath(`${lang}/common/npmignore`),
|
|
136
|
-
this.destinationPath(resolve(this.destinationPathName, ".npmignore"))
|
|
137
|
-
);
|
|
138
|
-
this.fs.copy(
|
|
139
|
-
this.templatePath(`${lang}/common/jest.config.js`),
|
|
140
|
-
this.destinationPath(resolve(this.destinationPathName, "jest.config.js"))
|
|
141
|
-
);
|
|
142
|
-
this.fs.copy(
|
|
143
|
-
this.templatePath(`${lang}/common/babelrc`),
|
|
144
|
-
this.destinationPath(resolve(this.destinationPathName, ".babelrc"))
|
|
145
|
-
);
|
|
146
|
-
this.fs.copy(
|
|
147
|
-
this.templatePath(`${lang}/common/travis.yml`),
|
|
148
|
-
this.destinationPath(resolve(this.destinationPathName, ".travis.yml"))
|
|
149
|
-
);
|
|
150
|
-
this.fs.copy(
|
|
151
|
-
this.templatePath(`${lang}/common/travis.yml`),
|
|
152
|
-
this.destinationPath(resolve(this.destinationPathName, ".travis.yml"))
|
|
153
|
-
);
|
|
154
|
-
this.fs.copyTpl(
|
|
155
|
-
this.templatePath(`${lang}/common/README.md`),
|
|
156
|
-
this.destinationPath(resolve(this.destinationPathName, "README.md")),
|
|
157
|
-
this.props
|
|
158
|
-
);
|
|
159
|
-
this.fs.copyTpl(
|
|
160
|
-
this.templatePath(`${lang}/common/eslintrc`),
|
|
161
|
-
this.destinationPath(resolve(this.destinationPathName, ".eslintrc")),
|
|
162
|
-
this.props
|
|
163
|
-
);
|
|
164
|
-
this.fs.copyTpl(
|
|
165
|
-
this.templatePath(`${lang}/common/eslintignore`),
|
|
166
|
-
this.destinationPath(resolve(this.destinationPathName, ".eslintignore")),
|
|
167
|
-
this.props
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
this.fs.copy(
|
|
171
|
-
this.templatePath(`${lang}/${this.props.pluginType}/src`),
|
|
172
|
-
this.destinationPath(resolve(this.destinationPathName, "src")),
|
|
173
|
-
this.props
|
|
174
|
-
);
|
|
175
|
-
|
|
176
|
-
this.fs.copy(
|
|
177
|
-
this.templatePath(
|
|
178
|
-
`${lang}/common/index.${lang == "typescript" ? "ts" : "js"}`
|
|
179
|
-
),
|
|
180
|
-
this.destinationPath(
|
|
181
|
-
resolve(
|
|
182
|
-
this.destinationPathName,
|
|
183
|
-
`index.${lang == "typescript" ? "ts" : "js"}`
|
|
184
|
-
)
|
|
185
|
-
),
|
|
186
|
-
this.props
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
if (lang == "typescript") {
|
|
190
|
-
this.fs.copy(
|
|
191
|
-
this.templatePath(`${lang}/common/tsconfig.json`),
|
|
192
|
-
this.destinationPath(
|
|
193
|
-
resolve(this.destinationPathName, "tsconfig.json")
|
|
194
|
-
),
|
|
195
|
-
this.props
|
|
196
|
-
);
|
|
197
|
-
this.fs.copy(
|
|
198
|
-
this.templatePath(`${lang}/${this.props.pluginType}/types`),
|
|
199
|
-
this.destinationPath(resolve(this.destinationPathName, "types")),
|
|
200
|
-
this.props
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
this.fs.copy(
|
|
205
|
-
this.templatePath(`${lang}/common/editorconfig`),
|
|
206
|
-
this.destinationPath(resolve(this.destinationPathName, ".editorconfig")),
|
|
207
|
-
this.props
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
install() {
|
|
212
|
-
process.chdir(this.projectName);
|
|
213
|
-
this.installDependencies({ npm: true, bower: false });
|
|
214
|
-
}
|
|
215
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= name %>",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "<%= description %>",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"files": ["lib/"],
|
|
8
|
-
"engines": {
|
|
9
|
-
"node": ">=10"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@verdaccio/commons-api": "^9.6.1"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@verdaccio/babel-preset": "^9.6.1",
|
|
16
|
-
"@verdaccio/eslint-config": "^9.3.2",
|
|
17
|
-
"eslint": "^6.6.0",
|
|
18
|
-
"jest": "^26.0.1 ",
|
|
19
|
-
"prettier": "^1.19.1",
|
|
20
|
-
"standard-version": "^8.0.0"
|
|
21
|
-
},
|
|
22
|
-
"keywords": "[<%= keywords %>]",
|
|
23
|
-
"license": "<%= license %>",
|
|
24
|
-
"repository": "<%= repository %>",
|
|
25
|
-
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "npm run build:types && npm run build:js",
|
|
28
|
-
"build:js": "babel src/ --out-dir lib --extensions \".ts,.tsx\"",
|
|
29
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
30
|
-
"test": "jest",
|
|
31
|
-
"lint": "eslint \"**/*.{js,ts}\""
|
|
32
|
-
}
|
|
33
|
-
}
|