Save after loading freesewing and pattern
This commit is contained in:
parent
a91ecd1b3a
commit
d73cd3512c
61 changed files with 6493 additions and 334 deletions
|
@ -14,7 +14,7 @@ module.exports = async () => {
|
|||
const defaults = await getDefaultLibraryParams()
|
||||
|
||||
program
|
||||
.name('create-react-library')
|
||||
.name('create-freesewing-pattern')
|
||||
.version(version)
|
||||
.usage('[options] [package-name]')
|
||||
.option('-d, --desc <string>', 'package description')
|
||||
|
@ -23,7 +23,7 @@ module.exports = async () => {
|
|||
.option('-r, --repo <string>', 'package repo path')
|
||||
.option('-g, --no-git', 'generate without git init')
|
||||
.option('-m, --manager <npm|yarn>', 'package manager to use', /^(npm|yarn)$/, defaults.manager)
|
||||
.option('-t, --template <default|typescript>', 'package template to use', /^(default|typescript|custom)$/, defaults.template)
|
||||
.option('-t, --template <light|dark>', 'package template to use', /^(light|dark|custom)$/, defaults.template)
|
||||
.option('-p, --template-path <string>', 'custom package template path')
|
||||
.option('-s, --skip-prompts', 'skip all prompts (must provide package-name via cli)')
|
||||
.parse(process.argv)
|
||||
|
@ -59,12 +59,14 @@ module.exports = async () => {
|
|||
|
||||
console.log(`
|
||||
|
||||
Your module has been created at ${dest}.
|
||||
Your pattern skeleton has been created at ${dest}.
|
||||
|
||||
To get started, in one tab, run:
|
||||
Before you start hacking, run these two commands, each in their own terminal:
|
||||
|
||||
In one terminal, start the rollup bundler in watch mode:
|
||||
$ ${chalk.cyan(`cd ${params.shortName} && ${params.manager} start`)}
|
||||
|
||||
And in another tab, run the create-react-app dev server:
|
||||
And in another terminal, run the dev server:
|
||||
$ ${chalk.cyan(`cd ${path.join(params.shortName, 'example')} && ${params.manager} start`)}
|
||||
`)
|
||||
|
||||
|
|
|
@ -155,6 +155,6 @@ yarn-debug.log*
|
|||
yarn-error.log*
|
||||
`, 'utf8')
|
||||
|
||||
const cmd = `git init && git add . && git commit -m "init ${pkg.name}@${pkg.version}"`
|
||||
const cmd = `git init && git add . && git commit -m ":tada: Initialized ${pkg.name}@${pkg.version} with create-freesewing-pattern"`
|
||||
return execa.shell(cmd, { cwd: dest })
|
||||
}
|
||||
|
|
|
@ -15,17 +15,17 @@ const tests = [
|
|||
repo: 'nala/my-test-library',
|
||||
license: 'MIT',
|
||||
manager: 'yarn',
|
||||
template: 'default',
|
||||
template: 'light',
|
||||
git: true
|
||||
},
|
||||
{
|
||||
name: 'my-test-typescript-library',
|
||||
name: 'my-test-dark-library',
|
||||
author: 'nala',
|
||||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'nala/my-test-library',
|
||||
license: 'MIT',
|
||||
manager: 'yarn',
|
||||
template: 'typescript',
|
||||
template: 'dark',
|
||||
git: true
|
||||
},
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ const tests = [
|
|||
repo: 'nala/my-test-library',
|
||||
license: 'MIT',
|
||||
manager: 'npm',
|
||||
template: 'default',
|
||||
template: 'light',
|
||||
git: true
|
||||
},
|
||||
{
|
||||
|
@ -45,12 +45,12 @@ const tests = [
|
|||
repo: 'nala/my-test-typescript-library',
|
||||
license: 'MIT',
|
||||
manager: 'npm',
|
||||
template: 'typescript',
|
||||
template: 'dark',
|
||||
git: true
|
||||
},
|
||||
{
|
||||
name: '@automagical/nala',
|
||||
author: 'superstar-cats',
|
||||
name: '@freesewing/test',
|
||||
author: 'joostdecock',
|
||||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'superstar-cats/nala',
|
||||
license: 'GPL',
|
||||
|
|
|
@ -15,7 +15,7 @@ module.exports = async () => {
|
|||
repo: (info) => `${info.author}/${info.name}`,
|
||||
license: config.get('license', 'MIT'),
|
||||
manager: config.get('manager', 'npm'),
|
||||
template: config.get('template', 'default')
|
||||
template: config.get('template', 'light')
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -30,7 +30,7 @@ module.exports = async (opts) => {
|
|||
{
|
||||
type: 'input',
|
||||
name: 'name',
|
||||
message: 'Package Name',
|
||||
message: 'Pattern Name',
|
||||
validate: (name) => {
|
||||
return name && validateNpmName(name).validForNewPackages
|
||||
},
|
||||
|
@ -39,7 +39,7 @@ module.exports = async (opts) => {
|
|||
{
|
||||
type: 'input',
|
||||
name: 'description',
|
||||
message: 'Package Description',
|
||||
message: 'Pattern Description',
|
||||
default: opts.description
|
||||
},
|
||||
{
|
||||
|
@ -70,8 +70,8 @@ module.exports = async (opts) => {
|
|||
{
|
||||
type: 'list',
|
||||
name: 'template',
|
||||
message: 'Template',
|
||||
choices: [ 'default', 'typescript', 'custom' ],
|
||||
message: 'Development Mode',
|
||||
choices: [ 'light', 'dark', 'custom' ],
|
||||
default: opts.template
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue