@svrx/create-plugin
Advanced tools
Comparing version 0.0.6 to 0.0.7
#!/usr/bin/env node | ||
const { argv } = require('yargs'); | ||
require('../lib/index')(argv._[0]); | ||
require('../lib/index')(argv); |
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.0.7](https://github.com/svrxjs/svrx-create-plugin/compare/v0.0.6...v0.0.7) (2019-09-24) | ||
### Features | ||
* move scope to cli params ([f338c4e](https://github.com/svrxjs/svrx-create-plugin/commit/f338c4e)) | ||
### [0.0.6](https://github.com/svrxjs/svrx-create-plugin/compare/v0.0.5...v0.0.6) (2019-09-23) | ||
@@ -7,0 +14,0 @@ |
@@ -7,3 +7,2 @@ const { resolve } = require('path'); | ||
isSvrxPlugin, | ||
correctName, | ||
correctFullName, | ||
@@ -13,4 +12,4 @@ getAuthor, | ||
module.exports = (name) => { | ||
const fullname = correctName(name); | ||
module.exports = (argv) => { | ||
const { scope } = argv; | ||
@@ -22,3 +21,3 @@ const questions = [ | ||
message: 'The project name:', | ||
default: fullname || 'svrx-plugin-<name>', | ||
default: 'svrx-plugin-<name>', | ||
filter: (input) => correctFullName(input), | ||
@@ -43,14 +42,8 @@ validate(input) { | ||
{ | ||
type: 'confirm', | ||
name: 'withScope', | ||
message: 'Publish npm package with scope?', | ||
default: false, | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'scopeName', | ||
message: 'The npm scope:', | ||
default: '@svrx', | ||
when({ withScope }) { | ||
return withScope; | ||
default: scope.startsWith('@') ? scope : `@${scope}`, | ||
when() { | ||
return !!scope; | ||
}, | ||
@@ -57,0 +50,0 @@ validate(input) { |
@@ -15,7 +15,2 @@ const cp = require('child_process'); | ||
exports.correctName = (name) => { | ||
if (name && !isSvrxPlugin(name)) return `svrx-plugin-${paramCase(name)}`; | ||
return name; | ||
}; | ||
exports.correctFullName = (name) => { | ||
@@ -22,0 +17,0 @@ if (isSvrxPlugin(name)) return paramCase(name); |
{ | ||
"name": "@svrx/create-plugin", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Initialize a svrx plugin by running one command.", | ||
@@ -5,0 +5,0 @@ "bin": "./bin/index.js", |
@@ -19,2 +19,8 @@ # @svrx/create-plugin | ||
Publish as scoped npm package: | ||
```bash | ||
npm init @svrx/plugin --scope=<scope-name> | ||
``` | ||
- yarn | ||
@@ -26,2 +32,8 @@ | ||
Publish as scoped npm package: | ||
```bash | ||
yarn create @svrx/plugin --scope=<scope-name> | ||
``` | ||
#### Test with plugin | ||
@@ -28,0 +40,0 @@ |
Sorry, the diff of this file is not supported yet
17567
52
358