Skip to content

Commit

Permalink
refactoring: utils functions moved to core/utils
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 2, 2016
1 parent 5e9a80e commit f3b89d6
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 30 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import clc from 'cli-color'
import path from 'path'

import {
config
,fileUtils
,FileParser
} from '../'
config,
fileUtils,
FileParser
} from '../../'

let singleton = Symbol()
let singletonEnforcer = Symbol()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
,getAttr
,Hooks
,Plugins
} from '../'
} from '../../'

export default class Utils {

Expand Down Expand Up @@ -504,6 +504,7 @@ export default class Utils {
Array.prototype.forEach.call(matches, (match) => {
promises.push(Utils.nextDataList(tplPath, jsonPage, match[0]))
})

Promise.all(promises)
.then(() => {
resolve()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import moment from 'moment'
import path from 'path'

import {
save
cli
,save
,folderUtils
,fileUtils
,fileAttr
,config
,Hooks
,Plugins
,Manager
} from '../'
} from '../../'

export default class FileParser {

Expand Down Expand Up @@ -273,16 +274,6 @@ export default class FileParser {
if(file.cleanName === res.json.file) res.json.path = file.path
})
}
// config.workflow.forEach(function (flow) {
// res[flow] = {
// dir: FileParser.changePathEnv(res.publish.dir, flow),
// file: res.publish.file,
// link: res.publish.link,
// path: FileParser.changePathEnv(res.publish.path, flow),
// json: res.json.path
// }
// })
// console.log(res)
}
return res
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
fileAttr,
FileParser,
config
} from '../'
} from '../../'

export default class FileUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
fileUtils,
fileAttr,
config
} from '../'
} from '../../'

export default class FolderUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import slug from 'limax'
import {
config,
fileUtils
} from '../../cli'
} from '../../'

function cleanSlug(str) {

Expand Down
25 changes: 15 additions & 10 deletions src/cli/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import fileAttr from './helpers/file-attr'
import Util from './helpers/abe-utils'
import handlebarsHelperSlugify from 'handlebars-helper-slugify'
import moment from 'moment'
import fse from 'fs-extra'
import clc from 'cli-color'

import fileAttr from './helpers/file-attr'
import Util from './core/utils/abe-utils'
import handlebarsHelperSlugify from 'handlebars-helper-slugify'

import {
abeImport,
printInput,
Expand All @@ -31,14 +32,18 @@ import Manager from './models/Manager'
import Page from './models/Page'
import Handlebars from 'handlebars'
import {getAttr, getEnclosingTags, escapeTextToRegex} from './helpers/regex-helper'
import slugify from './helpers/slugify'
import {dateSlug, dateUnslug} from './helpers/abe-date'
import {cleanSlug} from './helpers/slugify'

import {dateSlug, dateUnslug} from './core/utils/abe-date'
import Locales from './core/utils/abe-locales'
import FileParser from './core/utils/file-parser'
import fileUtils from './core/utils/file-utils'
import folderUtils from './core/utils/folder-utils'
import slugify from './core/utils/slugify'
import {cleanSlug} from './core/utils/slugify'

import {getTemplate} from './helpers/abe-template'
import folderUtils from './helpers/folder-utils'
import FileParser from './helpers/file-parser'
import Create from './Create'
import fileUtils from './helpers/file-utils'

import config from './core/config/config'
import removeDuplicateAttr from './helpers/abe-remove-duplicate-attr'
import abeCreate from './helpers/abe-create'
Expand All @@ -48,7 +53,7 @@ import abeProcess from './helpers/abe-process'
import {save, checkRequired, saveJson} from './controllers/Save'
import Hooks from './helpers/abe-hooks'
import Plugins from './helpers/abe-plugins'
import Locales from './helpers/abe-locales'


import getSelectTemplateKeys from './helpers/abe-get-select-template-keys'

Expand Down

0 comments on commit f3b89d6

Please sign in to comment.