init
This commit is contained in:
parent
e80c3b2298
commit
907845feb1
27 changed files with 11082 additions and 0 deletions
50
packages/create-freesewing-pattern/index.js
Normal file
50
packages/create-freesewing-pattern/index.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict'
|
||||
|
||||
const meow = require('meow')
|
||||
|
||||
const getLibraryDefaults = require('./lib/get-library-defaults')
|
||||
const createLibrary = require('./lib/create-library')
|
||||
const promptLibraryInfo = require('./lib/prompt-library-info')
|
||||
|
||||
module.exports = async () => {
|
||||
const defaults = await getLibraryDefaults()
|
||||
const info = await promptLibraryInfo(defaults)
|
||||
await createLibrary(info)
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
if (!module.parent) {
|
||||
meow(`
|
||||
Usage
|
||||
$ react-modern-library-cli
|
||||
`)
|
||||
|
||||
module.exports()
|
||||
.then((info) => {
|
||||
console.log(`
|
||||
|
||||
Your module has been created at ${info.dest}.
|
||||
|
||||
To get started, in one tab, run:
|
||||
$ cd ${info.name} && ${info.manager} start
|
||||
|
||||
And in another tab, run the create-react-app devserver:
|
||||
$ cd ${info.name}/example && ${info.manager} start
|
||||
`)
|
||||
|
||||
if (info.manager === 'npm') {
|
||||
console.log(`
|
||||
|
||||
Because you're using npm, you'll need to publish a dummy version of ${info.name} first before you can "npm link" your package into the example app.
|
||||
`)
|
||||
}
|
||||
|
||||
process.exit(0)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue