1
0
Fork 0

chore: Updated scripts and structure for new sites

This commit is contained in:
Joost De Cock 2021-12-10 08:41:58 +01:00
parent 79a8b4b964
commit 1ad8c9e310
5 changed files with 45 additions and 12 deletions

View file

@ -9,7 +9,7 @@ customChangelog:
- freesewing.dev
- freesewing.shared
- freesewing.org
customPacakgeJson:
customPackageJson:
- freesewing.dev
- freesewing.shared
- freesewing.org

View file

@ -0,0 +1,9 @@
# Change log for: freesewing.dev
This is the **initial release**, and the start of this change log.
> Prior to version 2, FreeSewing was not a JavaScript project.
> As such, that history is out of scope for this change log.

View file

@ -0,0 +1,9 @@
# Change log for: freesewing.org
This is the **initial release**, and the start of this change log.
> Prior to version 2, FreeSewing was not a JavaScript project.
> As such, that history is out of scope for this change log.

View file

@ -0,0 +1,9 @@
# Change log for: freesewing.shared
This is the **initial release**, and the start of this change log.
> Prior to version 2, FreeSewing was not a JavaScript project.
> As such, that history is out of scope for this change log.

View file

@ -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)