Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Sep 26, 2016
1 parent 66ec06c commit 5243a8a
Show file tree
Hide file tree
Showing 114 changed files with 2,543 additions and 2,543 deletions.
22 changes: 11 additions & 11 deletions src/cli/Builder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fse from "fs-extra"
import {saveHtml} from "./controllers/Save"
import path from "path"
import fse from 'fs-extra'
import {saveHtml} from './controllers/Save'
import path from 'path'

import {
Util,
Expand All @@ -10,23 +10,23 @@ import {
fileAttr,
getTemplate,
Page
} from "./"
} from './'

class Builder {

constructor(root, folder, dest, flow){
this.pathToJson = path.join(root, config.data.url)
var files = fileAttr.filterLatestVersion(FileParser.getFiles(this.pathToJson, config.data.url), flow)

if(flow === "publish") {
files = FileParser.getFiles(path.join(root, config.publish.url), new RegExp("." + config.files.templates.extension))
if(flow === 'publish') {
files = FileParser.getFiles(path.join(root, config.publish.url), new RegExp('.' + config.files.templates.extension))
}

var build = function (index) {
var file = files[index]
if(file.path.indexOf("." + config.files.templates.extension) > -1){
if(file.path.indexOf('.' + config.files.templates.extension) > -1){
file.path = file.path.replace(config.publish.url, config.data.url)
.replace("." + config.files.templates.extension, ".json")
.replace('.' + config.files.templates.extension, '.json')

var json = fse.readJsonSync(file.path)
var text = getTemplate(json.abe_meta.template)
Expand All @@ -41,7 +41,7 @@ class Builder {
if(files[index + 1]) build(index + 1)
})
}
else if(file.path.indexOf(".json") > -1){
else if(file.path.indexOf('.json') > -1){
var json = fse.readJsonSync(file.path)
var text = getTemplate(json.abe_meta.template)

Expand All @@ -66,7 +66,7 @@ class Builder {

if(process.env.ROOT && process.env.FOLDER && process.env.DEST){
config.set({root: process.env.ROOT})
var dest = process.env.DEST || "tmp"
var flow = process.env.FLOW || "draft"
var dest = process.env.DEST || 'tmp'
var flow = process.env.FLOW || 'draft'
new Builder(process.env.ROOT, process.env.FOLDER, dest, flow)
}
14 changes: 7 additions & 7 deletions src/cli/Create.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fse from "fs-extra"
import mkdirp from "mkdirp"
import {Promise} from "es6-promise"
import slugify from "./helpers/slugify"
import fse from 'fs-extra'
import mkdirp from 'mkdirp'
import {Promise} from 'es6-promise'
import slugify from './helpers/slugify'

import {
config,
Expand All @@ -12,16 +12,16 @@ import {
FileParser,
fileAttr,
getAttr
} from "./"
} from './'

export default class Create {

constructor() {}

init(path) {
path = path.split("/")
path = path.split('/')
path[path.length - 1] = slugify(path[path.length - 1])
path = path.join("/")
path = path.join('/')
this.addFolder(path)
.then(() => {
process.chdir(path)
Expand Down
92 changes: 46 additions & 46 deletions src/cli/config/abe-config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
var config = {
root: "",
localeFolder: "locale",
root: '',
localeFolder: 'locale',
intlData: {
locales: "en-US"
locales: 'en-US'
},
plugins: {
url:"plugins"
url:'plugins'
},
templates: {
url: "templates"
url: 'templates'
},
structure: {
url: "structure"
url: 'structure'
},
upload: {
image: "image",
image: 'image',
fileSizelimit: 10485760
},
data: {
url: "data"
url: 'data'
},
draft: {
url: "draft"
url: 'draft'
},
publish: {
url: "site"
url: 'site'
},
reference: {
url: "reference"
url: 'reference'
},
csp: {
scriptSrc: [],
Expand All @@ -41,66 +41,66 @@ var config = {
},
security: true,
htmlWhiteList: {
"blockquote": ["style"],
"span": ["style"],
"font": ["style", "color"],
"div": ["style"],
"sup": ["style"],
"sub": ["style"],
"ul": ["style"],
"li": ["style"],
"p": ["style"],
"b": ["style"],
"strong": ["style"],
"i": ["style"],
"u": ["style"],
"a": ["style", "href"],
"br": [],
"h1": ["style"],
"h2": ["style"],
"h3": ["style"],
"h4": ["style"],
"pre": ["style"],
"code": ["style"]
'blockquote': ['style'],
'span': ['style'],
'font': ['style', 'color'],
'div': ['style'],
'sup': ['style'],
'sub': ['style'],
'ul': ['style'],
'li': ['style'],
'p': ['style'],
'b': ['style'],
'strong': ['style'],
'i': ['style'],
'u': ['style'],
'a': ['style', 'href'],
'br': [],
'h1': ['style'],
'h2': ['style'],
'h3': ['style'],
'h4': ['style'],
'pre': ['style'],
'code': ['style']
},
files: {
exclude: /^[.]/,
templates: {
extension: "html",
assets: "_files",
extension: 'html',
assets: '_files',
check: /\.hbs|\.shtml|\.html|\.htm/,
precompile: false
}
},
log: {
active: false,
path: "abe-logs",
path: 'abe-logs',
allowed: /(.*?)/
},
meta: {
name: "abe_meta"
name: 'abe_meta'
},
source: {
name: "abe_source"
name: 'abe_source'
},
hooks: {
url: "hooks"
url: 'hooks'
},
cookie: {
secure: false
},
sessionSecret: "ThIsIsAbE",
abeEngine: "../views/template-engine",
defaultPartials: "../../../server/views/partials",
pluginsPartials: "partials",
partials: "templates/partials",
custom: "custom",
sessionSecret: 'ThIsIsAbE',
abeEngine: '../views/template-engine',
defaultPartials: '../../../server/views/partials',
pluginsPartials: 'partials',
partials: 'templates/partials',
custom: 'custom',
siteUrl: false,
sitePort: false,
redis: {
enable: false,
port: "6379",
host:"127.0.0.1"
port: '6379',
host:'127.0.0.1'
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import config from "./abe-config"
import configLocal from "./abe-config-local"
import config from './abe-config'
import configLocal from './abe-config-local'

var abeConfig = config
var abeConfigLocal = configLocal
Expand Down
Loading

0 comments on commit 5243a8a

Please sign in to comment.