generator-verdaccio-plugin 7.0.2 → 7.1.0
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/generators/app/index.js +13 -1
- package/generators/app/templates/auth/README.md +36 -0
- package/generators/app/templates/auth/_package.json +3 -1
- package/generators/app/templates/filter/README.md +36 -0
- package/generators/app/templates/filter/_package.json +3 -1
- package/generators/app/templates/middleware/README.md +36 -0
- package/generators/app/templates/middleware/_package.json +3 -1
- package/generators/app/templates/storage/README.md +36 -0
- package/generators/app/templates/storage/_package.json +3 -1
- package/package.json +2 -1
package/generators/app/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
// sort-imports-ignore
|
|
1
2
|
import chalk from 'chalk';
|
|
2
3
|
import _ from 'lodash';
|
|
3
4
|
import { resolve } from 'node:path';
|
|
4
5
|
import Generator from 'yeoman-generator';
|
|
5
6
|
import yosay from 'yosay';
|
|
6
7
|
import rootPackageJSON from '../../package.json' with { type: 'json' };
|
|
8
|
+
const pluginCategoryMap = {
|
|
9
|
+
auth: 'authentication',
|
|
10
|
+
storage: 'storage',
|
|
11
|
+
middleware: 'middleware',
|
|
12
|
+
filter: 'filter',
|
|
13
|
+
};
|
|
7
14
|
export default class PluginGenerator extends Generator {
|
|
8
15
|
props = {};
|
|
9
16
|
projectName = 'verdaccio-';
|
|
@@ -109,6 +116,11 @@ export default class PluginGenerator extends Generator {
|
|
|
109
116
|
if (pluginType === 'middleware') {
|
|
110
117
|
pkg.dependencies['express'] = rootPackageJSON.dependencies['express'];
|
|
111
118
|
}
|
|
119
|
+
// plugin-verifier
|
|
120
|
+
pkg.devDependencies['@verdaccio/plugin-verifier'] =
|
|
121
|
+
rootPackageJSON.devDependencies['@verdaccio/plugin-verifier'];
|
|
122
|
+
const category = pluginCategoryMap[pluginType];
|
|
123
|
+
pkg.scripts['verify'] = `verdaccio-plugin-verifier ${this.projectName} --category ${category}`;
|
|
112
124
|
this.fs.writeJSON(this.templatePath(`${pluginType}/_package.json`), pkg);
|
|
113
125
|
this.fs.copyTpl(this.templatePath(`${pluginType}/_package.json`), this.destinationPath(resolve(this.destinationPathName, 'package.json')), this.props);
|
|
114
126
|
}
|
|
@@ -117,7 +129,7 @@ export default class PluginGenerator extends Generator {
|
|
|
117
129
|
this.fs.copy(this.templatePath('common/gitignore'), dest('.gitignore'));
|
|
118
130
|
this.fs.copy(this.templatePath('common/npmignore'), dest('.npmignore'));
|
|
119
131
|
this.fs.copy(this.templatePath('common/nvmrc'), dest('.nvmrc'));
|
|
120
|
-
this.fs.copyTpl(this.templatePath(
|
|
132
|
+
this.fs.copyTpl(this.templatePath(`${this.props.pluginType}/README.md`), dest('README.md'), this.props);
|
|
121
133
|
this.fs.copy(this.templatePath(`${this.props.pluginType}/src`), dest('src'));
|
|
122
134
|
// this.fs.copy(this.templatePath('common/index.ts'), dest('index.ts'));
|
|
123
135
|
this.fs.copy(this.templatePath('common/tsconfig.json'), dest('tsconfig.json'));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# <%= name %>
|
|
2
|
+
|
|
3
|
+
<%- (description || '').split('\n').map(function (line) {
|
|
4
|
+
return '> ' + line
|
|
5
|
+
}).join('\n') %>
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Add the plugin to your Verdaccio configuration file (`config.yaml`):
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
auth:
|
|
15
|
+
<%= name %>:
|
|
16
|
+
enabled: true
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
See the [verdaccio contributing guide](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
|
|
22
|
+
Once you have completed that, use the following npm tasks.
|
|
23
|
+
|
|
24
|
+
- `npm run build`
|
|
25
|
+
|
|
26
|
+
Build a distributable archive
|
|
27
|
+
|
|
28
|
+
- `npm run test`
|
|
29
|
+
|
|
30
|
+
Run unit test
|
|
31
|
+
|
|
32
|
+
- `npm run verify`
|
|
33
|
+
|
|
34
|
+
Verify the plugin can be loaded by Verdaccio. This runs [`@verdaccio/plugin-verifier`](https://www.npmjs.com/package/@verdaccio/plugin-verifier) which checks that the plugin exports the correct interface and can be instantiated as an **authentication** plugin.
|
|
35
|
+
|
|
36
|
+
For more information about any of these commands run `npm run ${task} -- --help`.
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"debug": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@verdaccio/plugin-verifier": "1.0.0-next-9.1",
|
|
16
17
|
"@types/node": "25.0.9",
|
|
17
18
|
"@types/express": "4.17.25",
|
|
18
19
|
"@types/debug": "4.1.12",
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsc",
|
|
32
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
33
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
34
|
+
"verify": "verdaccio-plugin-verifier verdaccio-my-plugin --category authentication"
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# <%= name %>
|
|
2
|
+
|
|
3
|
+
<%- (description || '').split('\n').map(function (line) {
|
|
4
|
+
return '> ' + line
|
|
5
|
+
}).join('\n') %>
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Add the plugin to your Verdaccio configuration file (`config.yaml`):
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
filters:
|
|
15
|
+
<%= name %>:
|
|
16
|
+
enabled: true
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
See the [verdaccio contributing guide](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
|
|
22
|
+
Once you have completed that, use the following npm tasks.
|
|
23
|
+
|
|
24
|
+
- `npm run build`
|
|
25
|
+
|
|
26
|
+
Build a distributable archive
|
|
27
|
+
|
|
28
|
+
- `npm run test`
|
|
29
|
+
|
|
30
|
+
Run unit test
|
|
31
|
+
|
|
32
|
+
- `npm run verify`
|
|
33
|
+
|
|
34
|
+
Verify the plugin can be loaded by Verdaccio. This runs [`@verdaccio/plugin-verifier`](https://www.npmjs.com/package/@verdaccio/plugin-verifier) which checks that the plugin exports the correct interface and can be instantiated as a **filter** plugin.
|
|
35
|
+
|
|
36
|
+
For more information about any of these commands run `npm run ${task} -- --help`.
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"debug": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@verdaccio/plugin-verifier": "1.0.0-next-9.1",
|
|
16
17
|
"@types/node": "25.0.9",
|
|
17
18
|
"@types/express": "4.17.25",
|
|
18
19
|
"@types/debug": "4.1.12",
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsc",
|
|
31
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
|
+
"verify": "verdaccio-plugin-verifier verdaccio-my-plugin --category filter"
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# <%= name %>
|
|
2
|
+
|
|
3
|
+
<%- (description || '').split('\n').map(function (line) {
|
|
4
|
+
return '> ' + line
|
|
5
|
+
}).join('\n') %>
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Add the plugin to your Verdaccio configuration file (`config.yaml`):
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
middlewares:
|
|
15
|
+
<%= name %>:
|
|
16
|
+
enabled: true
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
See the [verdaccio contributing guide](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
|
|
22
|
+
Once you have completed that, use the following npm tasks.
|
|
23
|
+
|
|
24
|
+
- `npm run build`
|
|
25
|
+
|
|
26
|
+
Build a distributable archive
|
|
27
|
+
|
|
28
|
+
- `npm run test`
|
|
29
|
+
|
|
30
|
+
Run unit test
|
|
31
|
+
|
|
32
|
+
- `npm run verify`
|
|
33
|
+
|
|
34
|
+
Verify the plugin can be loaded by Verdaccio. This runs [`@verdaccio/plugin-verifier`](https://www.npmjs.com/package/@verdaccio/plugin-verifier) which checks that the plugin exports the correct interface and can be instantiated as a **middleware** plugin.
|
|
35
|
+
|
|
36
|
+
For more information about any of these commands run `npm run ${task} -- --help`.
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"debug": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@verdaccio/plugin-verifier": "1.0.0-next-9.1",
|
|
16
17
|
"@types/node": "25.0.9",
|
|
17
18
|
"@types/express": "4.17.25",
|
|
18
19
|
"@types/debug": "4.1.12",
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsc",
|
|
32
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
33
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
34
|
+
"verify": "verdaccio-plugin-verifier verdaccio-my-plugin --category middleware"
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# <%= name %>
|
|
2
|
+
|
|
3
|
+
<%- (description || '').split('\n').map(function (line) {
|
|
4
|
+
return '> ' + line
|
|
5
|
+
}).join('\n') %>
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Add the plugin to your Verdaccio configuration file (`config.yaml`):
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
store:
|
|
15
|
+
<%= name %>:
|
|
16
|
+
enabled: true
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
See the [verdaccio contributing guide](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
|
|
22
|
+
Once you have completed that, use the following npm tasks.
|
|
23
|
+
|
|
24
|
+
- `npm run build`
|
|
25
|
+
|
|
26
|
+
Build a distributable archive
|
|
27
|
+
|
|
28
|
+
- `npm run test`
|
|
29
|
+
|
|
30
|
+
Run unit test
|
|
31
|
+
|
|
32
|
+
- `npm run verify`
|
|
33
|
+
|
|
34
|
+
Verify the plugin can be loaded by Verdaccio. This runs [`@verdaccio/plugin-verifier`](https://www.npmjs.com/package/@verdaccio/plugin-verifier) which checks that the plugin exports the correct interface and can be instantiated as a **storage** plugin.
|
|
35
|
+
|
|
36
|
+
For more information about any of these commands run `npm run ${task} -- --help`.
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"debug": "4.4.3"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
+
"@verdaccio/plugin-verifier": "1.0.0-next-9.1",
|
|
17
18
|
"@types/node": "25.0.9",
|
|
18
19
|
"@types/express": "4.17.25",
|
|
19
20
|
"@types/debug": "4.1.12",
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"author": "<%= authorName %> <<%= authorEmail %>>",
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsc",
|
|
32
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
33
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
34
|
+
"verify": "verdaccio-plugin-verifier verdaccio-my-plugin --category storage"
|
|
33
35
|
}
|
|
34
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-verdaccio-plugin",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "plugin generator for verdaccio",
|
|
5
5
|
"homepage": "https://github.com/verdaccio",
|
|
6
6
|
"author": {
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"typescript": "5.9.3",
|
|
51
51
|
"vitepress": "1.6.4",
|
|
52
52
|
"vitest": "4.0.18",
|
|
53
|
+
"@verdaccio/plugin-verifier": "1.0.0-next-9.1",
|
|
53
54
|
"yeoman-test": "11.2.0"
|
|
54
55
|
},
|
|
55
56
|
"engines": {
|