feat(normalize-packages): remove .editorconfig and .gitignore

This commit is contained in:
Julien Fontanet 2017-10-05 17:29:22 +02:00
parent 05f3171910
commit 738e3a0fbe
2 changed files with 28 additions and 81 deletions

View File

@ -1,65 +0,0 @@
# http://EditorConfig.org
#
# Julien Fontanet's configuration
# https://gist.github.com/julien-f/8096213
# Top-most EditorConfig file.
root = true
# Common config.
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespaces = true
# CoffeeScript
#
# https://github.com/polarmobile/coffeescript-style-guide/blob/master/README.md
[*.{,lit}coffee]
indent_size = 2
indent_style = space
# Markdown
[*.{md,mdwn,mdown,markdown}]
indent_size = 4
indent_style = space
# Package.json
#
# This indentation style is the one used by npm.
[/package.json]
indent_size = 2
indent_style = space
# Jade
[*.jade]
indent_size = 2
indent_style = space
# JavaScript
#
# Two spaces seems to be the standard most common style, at least in
# Node.js (http://nodeguide.com/style.html#tabs-vs-spaces).
[*.{js,jsx,ts,tsx}]
indent_size = 2
indent_style = space
# Less
[*.less]
indent_size = 2
indent_style = space
# Sass
#
# Style used for http://libsass.com
[*.s[ac]ss]
indent_size = 2
indent_style = space
# YAML
#
# Only spaces are allowed.
[*.yaml]
indent_size = 2
indent_style = space

View File

@ -3,26 +3,38 @@
const PKGS_DIR = `${__dirname}/../packages`
const { fromCallback } = require('promise-toolbox')
const { readdir, readFile, writeFile } = require('fs')
const { readdir, readFile, unlink, writeFile } = require('fs')
const normalizePackage = name => fromCallback(cb =>
readFile(`${PKGS_DIR}/${name}/package.json`, cb)
).then(JSON.parse).then(package => {
package.name = name
package.homepage = `https://github.com/vatesfr/xen-orchestra/tree/master/packages/${name}`
package.bugs = `https://github.com/vatesfr/xo-web/issues`
package.repository = {
type: 'git',
url: 'https://github.com/vatesfr/xen-orchestra.git'
const pUnlink = path => fromCallback(cb =>
unlink(path, cb)
).catch(error => {
if (error.code !== 'ENOENT') {
throw error
}
return fromCallback(cb => writeFile(
`${PKGS_DIR}/${name}/package.json`,
JSON.stringify(package, null, 2) + '\n',
cb
))
})
const normalizePackage = name => Promise.all([
fromCallback(cb =>
readFile(`${PKGS_DIR}/${name}/package.json`, cb)
).then(JSON.parse).then(package => {
package.name = name
package.homepage = `https://github.com/vatesfr/xen-orchestra/tree/master/packages/${name}`
package.bugs = `https://github.com/vatesfr/xo-web/issues`
package.repository = {
type: 'git',
url: 'https://github.com/vatesfr/xen-orchestra.git'
}
return fromCallback(cb => writeFile(
`${PKGS_DIR}/${name}/package.json`,
JSON.stringify(package, null, 2) + '\n',
cb
))
}),
pUnlink(`${PKGS_DIR}/${name}/.editorconfig`),
pUnlink(`${PKGS_DIR}/${name}/.gitignore`)
])
const main =() => fromCallback(cb =>
readdir(PKGS_DIR, cb)
).then(pkgs => Promise.all(pkgs.map(pkg =>