chore: Fixing linter warnings
This commit is contained in:
parent
d3a87ad7d1
commit
f9e3236253
37 changed files with 46 additions and 694 deletions
|
@ -7,9 +7,6 @@ import mustache from 'mustache'
|
|||
import { execSync } from 'child_process'
|
||||
// Software
|
||||
import designs from '../config/software/designs.json'
|
||||
import packages from '../config/software//packages.json'
|
||||
import plugins from '../config/software//plugins.json'
|
||||
import sites from '../config/software//sites.json'
|
||||
|
||||
const type = process.argv[2]
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import glob from 'glob'
|
|||
import yaml from 'js-yaml'
|
||||
import chalk from 'chalk'
|
||||
import mustache from 'mustache'
|
||||
import { capitalize } from '../sites/shared/utils.mjs'
|
||||
import conf from '../lerna.json'
|
||||
const { version } = conf
|
||||
import {
|
||||
|
@ -81,18 +80,18 @@ for (const pkg of Object.values(software)) {
|
|||
}
|
||||
fs.writeFileSync(
|
||||
path.join(cwd, pkg.folder, pkg.name, 'CHANGELOG.md'),
|
||||
changelog(pkg, repo)
|
||||
changelog(pkg)
|
||||
)
|
||||
}
|
||||
log.write(chalk.green(" Done\n"))
|
||||
|
||||
// Step 3: Generate overall CHANGELOG.md
|
||||
// Step 4: Generate overall CHANGELOG.md
|
||||
fs.writeFileSync(
|
||||
path.join(repo.path, 'CHANGELOG.md'),
|
||||
changelog('global', repo)
|
||||
changelog('global')
|
||||
)
|
||||
|
||||
// Step 6: Generate build script for published software
|
||||
// Step 5: Generate build script for published software
|
||||
log.write(chalk.blueBright('Generating buildall node script...'))
|
||||
const buildSteps = buildOrder.map((step, i) => `lerna run cibuild_step${i}`);
|
||||
const buildAllCommand = buildSteps.join(' && ');
|
||||
|
@ -104,7 +103,7 @@ fs.writeFileSync(
|
|||
)
|
||||
log.write(chalk.green(" Done\n"))
|
||||
|
||||
// Step 7: Generate tests for designs and plugins
|
||||
// Step 6: Generate tests for designs and plugins
|
||||
|
||||
|
||||
|
||||
|
@ -435,38 +434,3 @@ function validate() {
|
|||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts a package.json, build.js, README.md, and CHANGELOG.md
|
||||
* into every subdirectory under the packages directory.
|
||||
* Also adds unit tests for patterns, and writes the global CHANGELOG.md.
|
||||
*/
|
||||
function reconfigure(pkgs, repo) {
|
||||
for (const pkg of pkgs) {
|
||||
console.log(chalk.blueBright(`Reconfiguring ${pkg}`))
|
||||
//if (repo.exceptions.customPackageJson.indexOf(pkg) === -1) {
|
||||
// const pkgConfig = packageConfig(pkg, repo)
|
||||
// fs.writeFileSync(
|
||||
// path.join(repo.path, 'packages', pkg, 'package.json'),
|
||||
// JSON.stringify(pkgConfig, null, 2) + '\n'
|
||||
// )
|
||||
//}
|
||||
//if (repo.exceptions.customBuild.indexOf(pkg) === -1) {
|
||||
// fs.writeFileSync(
|
||||
// path.join(repo.path, 'packages', pkg, 'build.js'),
|
||||
// repo.templates.build
|
||||
// )
|
||||
//}
|
||||
//if (repo.exceptions.customReadme.indexOf(pkg) === -1) {
|
||||
// fs.writeFileSync(path.join(repo.path, 'packages', pkg, 'README.md'), readme(pkg, repo))
|
||||
//}
|
||||
if (repo.exceptions.customChangelog.indexOf(pkg) === -1) {
|
||||
fs.writeFileSync(
|
||||
path.join(repo.path, 'packages', pkg, 'CHANGELOG.md'),
|
||||
changelog(pkg, repo)
|
||||
)
|
||||
}
|
||||
const type = packageType(pkg, repo)
|
||||
}
|
||||
fs.writeFileSync(path.join(repo.path, 'CHANGELOG.md'), changelog('global', repo))
|
||||
console.log(chalk.yellowBright.bold('All done.'))
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ const bearer = token => ({
|
|||
* Exported because it's re-used by the Algolia indexing script
|
||||
*/
|
||||
const getContent = async (lang, type) => {
|
||||
const items = {}
|
||||
let res
|
||||
try {
|
||||
res = await axios.get(`${uris[type]}&_locale=${lang}`)
|
||||
|
@ -82,7 +81,7 @@ const getContent = async (lang, type) => {
|
|||
/*
|
||||
* Adds maker to showcase post
|
||||
*/
|
||||
const addMaker = (content, lang, token, makers) => {
|
||||
const addMaker = (content, token, makers) => {
|
||||
const promises = []
|
||||
for (const item of content) {
|
||||
promises.push(axios.put(
|
||||
|
@ -112,7 +111,7 @@ const addAuthors = async (type, token) => {
|
|||
|
||||
for (const lang of languages) {
|
||||
const content = await getContent(lang, type)
|
||||
if (type === 'showcaseposts') await addMaker(content, lang, token, makers)
|
||||
if (type === 'showcaseposts') await addMaker(content, token, makers)
|
||||
}
|
||||
|
||||
return false
|
||||
|
@ -133,7 +132,6 @@ const getToWork = async () => {
|
|||
console.log('Failed to login to strapi')
|
||||
process.exit()
|
||||
}
|
||||
const translations = languages.length - 1
|
||||
for (const type of Object.keys(uris)) {
|
||||
console.log(`Loading ${type} from Strapi`)
|
||||
await addAuthors(type, token)
|
||||
|
|
|
@ -246,7 +246,6 @@ const getToWork = async () => {
|
|||
process.exit()
|
||||
}
|
||||
const content = {}
|
||||
const translations = languages.length - 1
|
||||
for (const type of Object.keys(uris)) {
|
||||
console.log(`Loading ${type} from Strapi`)
|
||||
content[type] = await getContent(type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue