feat(cfp): Updated for React 17 / CRA 4 / Webpack 5
This commit is contained in:
parent
e3358a03ef
commit
380fa33c6a
7 changed files with 34 additions and 19 deletions
|
@ -40,9 +40,9 @@ module.exports = async () => {
|
|||
.option('-m, --manager <npm|yarn>', 'package manager to use', /^(npm|yarn)$/, defaults.manager)
|
||||
.option('-v, --skip-version-check', 'proceed even with Node < v10')
|
||||
.option(
|
||||
'-t, --template <default|custom>',
|
||||
'-t, --template <freesewing|custom>',
|
||||
'package template to use',
|
||||
/^(default|custom)$/,
|
||||
/^(freesewing|custom)$/,
|
||||
defaults.template
|
||||
)
|
||||
.option('-p, --template-path <string>', 'custom package template path')
|
||||
|
@ -84,22 +84,18 @@ module.exports = async () => {
|
|||
|
||||
${strings[params.language]['cfp.runTheseCommands']}:
|
||||
|
||||
- ${strings[params.language]['cfp.startRollup']}
|
||||
|
||||
👉 ${chalk.cyan(`cd ${params.shortName} && ${params.manager} start`)}
|
||||
|
||||
- ${strings[params.language]['cfp.startWebpack']}
|
||||
|
||||
👉 ${chalk.cyan(`cd ${path.join(params.shortName, 'example')} && ${params.manager} start`)}
|
||||
|
||||
${strings[params.language]['cfp.startWebpack']}
|
||||
|
||||
${strings[params.language]['cfp.devDocsAvailableAt']}
|
||||
${chalk.bold('https://freesewing.dev/')}
|
||||
|
||||
${strings[params.language]['cfp.talkToUs']}
|
||||
${chalk.bold('https://chat.freesewing.org/')}
|
||||
${chalk.bold('https://discord.freesewing.org/')}
|
||||
|
||||
`)
|
||||
`
|
||||
)
|
||||
|
||||
return dest
|
||||
}
|
||||
|
|
|
@ -59,6 +59,16 @@ module.exports = async (info) => {
|
|||
await promise
|
||||
}
|
||||
|
||||
// Symlink is required since webback 5 / CRA 4
|
||||
fs.symlinkSync(
|
||||
path.join(dest),
|
||||
path.join(dest, 'example', 'src', 'pattern'),
|
||||
'junction',
|
||||
(err) => {
|
||||
if (err) console.log('Unable to create symlink to pattern folder:', err)
|
||||
}
|
||||
)
|
||||
|
||||
return dest
|
||||
}
|
||||
|
||||
|
|
|
@ -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", "freesewing")
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
|
@ -134,9 +134,9 @@ module.exports = async opts => {
|
|||
|
||||
config.set('author', info.author)
|
||||
config.set('manager', info.manager)
|
||||
config.set('template', 'default')
|
||||
config.set('template', 'freesewing')
|
||||
config.set('license', 'MIT')
|
||||
info.template = 'default'
|
||||
info.template = 'freesewing'
|
||||
|
||||
return {
|
||||
...info,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue