chore: Updated scripts and structure for new sites
This commit is contained in:
parent
79a8b4b964
commit
1ad8c9e310
5 changed files with 45 additions and 12 deletions
|
@ -504,24 +504,30 @@ function configurePkgUnitTests(type, pkg, config) {
|
|||
* New: Adds unit tests for patterns
|
||||
*/
|
||||
function reconfigure(pkgs, config) {
|
||||
for (let pkg of pkgs) {
|
||||
for (const pkg of pkgs) {
|
||||
console.log(chalk.blueBright(`Reconfiguring ${pkg}`))
|
||||
let pkgConfig = packageConfig(pkg, config)
|
||||
fs.writeFileSync(
|
||||
path.join(config.repoPath, 'packages', pkg, 'package.json'),
|
||||
JSON.stringify(pkgConfig, null, 2) + '\n'
|
||||
)
|
||||
if (config.exceptions.customPackageJson.indexOf(pkg) === -1) {
|
||||
const pkgConfig = packageConfig(pkg, config)
|
||||
fs.writeFileSync(
|
||||
path.join(config.repoPath, 'packages', pkg, 'package.json'),
|
||||
JSON.stringify(pkgConfig, null, 2) + '\n'
|
||||
)
|
||||
}
|
||||
if (config.exceptions.customRollup.indexOf(pkg) === -1) {
|
||||
fs.writeFileSync(
|
||||
path.join(config.repoPath, 'packages', pkg, 'rollup.config.js'),
|
||||
config.templates.rollup
|
||||
)
|
||||
}
|
||||
fs.writeFileSync(path.join(config.repoPath, 'packages', pkg, 'README.md'), readme(pkg, config))
|
||||
fs.writeFileSync(
|
||||
path.join(config.repoPath, 'packages', pkg, 'CHANGELOG.md'),
|
||||
changelog(pkg, config)
|
||||
)
|
||||
if (config.exceptions.customReadme.indexOf(pkg) === -1) {
|
||||
fs.writeFileSync(path.join(config.repoPath, 'packages', pkg, 'README.md'), readme(pkg, config))
|
||||
}
|
||||
if (config.exceptions.customChangelog.indexOf(pkg) === -1) {
|
||||
fs.writeFileSync(
|
||||
path.join(config.repoPath, 'packages', pkg, 'CHANGELOG.md'),
|
||||
changelog(pkg, config)
|
||||
)
|
||||
}
|
||||
const type = packageType(pkg, config)
|
||||
if (type === 'pattern') configurePatternExample(pkg, config)
|
||||
if (['pattern', 'plugin'].indexOf(type) !== -1) configurePkgUnitTests(type, pkg, config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue