Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
8f974a3a
Commit
8f974a3a
authored
May 13, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Updated fusebox scripts
parent
9e801548
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
156 deletions
+90
-156
fuse.js
fuse.js
+74
-144
package.json
package.json
+1
-0
agent.js
server/agent.js
+5
-7
login.pug
server/views/auth/login.pug
+2
-1
error-forbidden.pug
server/views/error-forbidden.pug
+2
-1
error-notexist.pug
server/views/error-notexist.pug
+2
-1
error.pug
server/views/error.pug
+2
-1
layout.pug
server/views/layout.pug
+2
-1
No files found.
fuse.js
View file @
8f974a3a
...
...
@@ -30,17 +30,12 @@ const args = require('yargs')
describe
:
'Start in Configure Developer mode'
,
type
:
'boolean'
})
.
option
(
'i'
,
{
alias
:
'inspect'
,
describe
:
'Enable Inspector for debugging'
,
type
:
'boolean'
,
implies
:
'd'
})
.
help
(
'h'
)
.
alias
(
'h'
,
'help'
)
.
argv
let
mode
=
'build'
const
dev
=
args
.
d
||
args
.
c
if
(
args
.
d
)
{
console
.
info
(
colors
.
bgWhite
.
black
(
' Starting Fuse in DEVELOPER mode... '
))
mode
=
'dev'
...
...
@@ -52,31 +47,6 @@ if (args.d) {
}
// ======================================================
// Define aliases / shims
// ======================================================
const
ALIASES
=
{
'brace-ext-modelist'
:
'brace/ext/modelist.js'
,
'simplemde'
:
'simplemde/dist/simplemde.min.js'
,
'socket.io-client'
:
'socket.io-client/dist/socket.io.min.js'
,
'vue'
:
'vue/dist/vue.min.js'
}
const
SHIMS
=
{
_preinit
:
{
source
:
'.build/_preinit.js'
,
exports
:
'_preinit'
},
jquery
:
{
source
:
'node_modules/jquery/dist/jquery.js'
,
exports
:
'$'
},
mathjax
:
{
source
:
'node_modules/mathjax/MathJax.js'
,
exports
:
'MathJax'
}
}
// ======================================================
// Global Tasks
// ======================================================
...
...
@@ -169,6 +139,12 @@ let globalTasks = Promise.mapSeries([
}).
then
(()
=>
{
return
fs
.
outputFileAsync
(
'./.build/_preinit.js'
,
preInitContent
,
'utf8'
)
})
},
/**
* Delete Fusebox cache
*/
()
=>
{
return
fs
.
emptyDirAsync
(
'./.fusebox'
)
}
],
f
=>
{
return
f
()
})
...
...
@@ -176,129 +152,83 @@ let globalTasks = Promise.mapSeries([
// Fuse Tasks
// ======================================================
let
fuse
const
ALIASES
=
{
'brace-ext-modelist'
:
'brace/ext/modelist.js'
,
'simplemde'
:
'simplemde/dist/simplemde.min.js'
,
'socket.io-client'
:
'socket.io-client/dist/socket.io.js'
,
'vue'
:
'vue/dist/vue.min.js'
}
const
SHIMS
=
{
_preinit
:
{
source
:
'.build/_preinit.js'
,
exports
:
'_preinit'
},
jquery
:
{
source
:
'node_modules/jquery/dist/jquery.js'
,
exports
:
'$'
},
mathjax
:
{
source
:
'node_modules/mathjax/MathJax.js'
,
exports
:
'MathJax'
}
}
globalTasks
.
then
(()
=>
{
switch
(
mode
)
{
// =============================================
// DEVELOPER MODE
// =============================================
case
'dev'
:
// Client
fuse
=
fsbx
.
FuseBox
.
init
({
homeDir
:
'./client'
,
output
:
'./assets/js/$name.min.js'
,
alias
:
ALIASES
,
shim
:
SHIMS
,
plugins
:
[
fsbx
.
VuePlugin
(),
[
'.scss'
,
fsbx
.
SassPlugin
(),
fsbx
.
CSSPlugin
()
],
fsbx
.
BabelPlugin
({
comments
:
false
,
presets
:
[
'es2015'
]
}),
fsbx
.
JSONPlugin
()
],
debug
:
false
,
log
:
true
})
fuse
.
dev
({
port
:
4444
,
httpServer
:
false
let
fuse
=
fsbx
.
FuseBox
.
init
({
homeDir
:
'./client'
,
output
:
'./assets/js/$name.min.js'
,
alias
:
ALIASES
,
shim
:
SHIMS
,
plugins
:
[
fsbx
.
EnvPlugin
({
NODE_ENV
:
(
dev
)
?
'development'
:
'production'
}),
fsbx
.
VuePlugin
(),
[
'.scss'
,
fsbx
.
SassPlugin
({
outputStyle
:
(
dev
)
?
'nested'
:
'compressed'
}),
fsbx
.
CSSPlugin
()
],
fsbx
.
BabelPlugin
({
comments
:
false
,
presets
:
[
'es2015'
]
}),
fsbx
.
JSONPlugin
(),
!
dev
&&
fsbx
.
UglifyJSPlugin
({
compress
:
{
unused
:
false
},
output
:
{
'max_line_len'
:
1000000
}
})
],
debug
:
false
,
log
:
true
})
fuse
.
bundle
(
'bundle'
)
.
instructions
(
'> index.js'
)
.
watch
()
if
(
dev
)
{
fuse
.
dev
({
port
:
4444
,
httpServer
:
false
})
}
fuse
.
run
().
then
(()
=>
{
nodemon
({
exec
:
(
args
.
i
)
?
'node --inspect server'
:
'node server'
,
ignore
:
[
'assets/'
,
'client/'
,
'data/'
,
'repo/'
,
'tests/'
],
ext
:
'js json'
,
watch
:
[
'server'
],
env
:
{
'NODE_ENV'
:
'development'
}
})
})
const
bundleLibs
=
fuse
.
bundle
(
'libs'
).
instructions
(
'~ index.js'
)
const
bundleApp
=
fuse
.
bundle
(
'app'
).
instructions
(
'!> index.js'
)
const
bundleSetup
=
fuse
.
bundle
(
'configure'
).
instructions
(
'> configure.js'
)
switch
(
mode
)
{
case
'dev'
:
bundleLibs
.
watch
()
bundleApp
.
watch
()
break
// =============================================
// CONFIGURE - DEVELOPER MODE
// =============================================
case
'dev-configure'
:
// Client
fuse
=
fsbx
.
FuseBox
.
init
({
homeDir
:
'./client'
,
output
:
'./assets/js/$name.min.js'
,
alias
:
ALIASES
,
shim
:
SHIMS
,
plugins
:
[
[
'.scss'
,
fsbx
.
SassPlugin
(),
fsbx
.
CSSPlugin
()
],
fsbx
.
BabelPlugin
({
comments
:
false
,
presets
:
[
'es2015'
]
}),
fsbx
.
JSONPlugin
()
],
debug
:
false
,
log
:
true
})
fuse
.
dev
({
port
:
4444
,
httpServer
:
false
})
fuse
.
bundle
(
'configure'
)
.
instructions
(
'> configure.js'
)
.
watch
()
fuse
.
run
().
then
(()
=>
{
nodemon
({
exec
:
'node wiki configure'
,
ignore
:
[
'assets/'
,
'client/'
,
'data/'
,
'repo/'
,
'tests/'
],
ext
:
'js json'
,
watch
:
[
'server/configure.js'
],
env
:
{
'NODE_ENV'
:
'development'
}
})
})
bundleSetup
.
watch
()
break
// =============================================
// BUILD ONLY MODE
// =============================================
case
'build'
:
fuse
=
fsbx
.
FuseBox
.
init
({
homeDir
:
'./client'
,
output
:
'./assets/js/$name.min.js'
,
alias
:
ALIASES
,
shim
:
SHIMS
,
plugins
:
[
fsbx
.
EnvPlugin
({
NODE_ENV
:
'production'
}),
fsbx
.
VuePlugin
(),
[
'.scss'
,
fsbx
.
SassPlugin
({
outputStyle
:
'compressed'
}),
fsbx
.
CSSPlugin
()
],
fsbx
.
BabelPlugin
({
config
:
{
comments
:
false
,
presets
:
[
'es2015'
]
}
}),
fsbx
.
JSONPlugin
(),
fsbx
.
UglifyJSPlugin
({
compress
:
{
unused
:
false
},
output
:
{
'max_line_len'
:
1000000
}
})
],
debug
:
false
,
log
:
true
})
}
fuse
.
bundle
(
'bundle'
).
instructions
(
'> index.js'
)
fuse
.
bundle
(
'configure'
).
instructions
(
'> configure.js'
)
fuse
.
run
().
then
(()
=>
{
console
.
info
(
colors
.
green
.
bold
(
'
\
nAssets compilation + bundling completed.'
)
)
fuse
.
run
().
then
(()
=>
{
console
.
info
(
colors
.
green
.
bold
(
'
\
nAssets compilation + bundling completed.'
))
}).
catch
(
err
=>
{
console
.
error
(
colors
.
red
(
' X Bundle compilation failed! '
+
err
.
message
))
process
.
exit
(
1
)
if
(
dev
)
{
nodemon
({
exec
:
(
args
.
d
)
?
'node server'
:
'node wiki configure'
,
ignore
:
[
'assets/'
,
'client/'
,
'data/'
,
'repo/'
,
'tests/'
],
ext
:
'js json'
,
watch
:
(
args
.
d
)
?
[
'server'
]
:
[
'server/configure.js'
],
env
:
{
'NODE_ENV'
:
'development'
}
})
break
}
}
}).
catch
(
err
=>
{
console
.
error
(
colors
.
red
(
' X Bundle compilation failed! '
+
err
.
message
))
process
.
exit
(
1
)
})
})
package.json
View file @
8f974a3a
...
...
@@ -6,6 +6,7 @@
"scripts"
:
{
"start"
:
"node wiki start"
,
"stop"
:
"node wiki stop"
,
"restart"
:
"node wiki restart"
,
"build"
:
"node fuse"
,
"dev"
:
"node fuse -d"
,
"dev-configure"
:
"node fuse -c"
,
...
...
server/agent.js
View file @
8f974a3a
...
...
@@ -44,8 +44,7 @@ const Promise = require('bluebird')
const
fs
=
Promise
.
promisifyAll
(
require
(
'fs-extra'
))
const
klaw
=
require
(
'klaw'
)
const
Cron
=
require
(
'cron'
).
CronJob
const
i18nextBackend
=
require
(
'i18next-node-fs-backend'
)
const
i18nextMw
=
require
(
'i18next-express-middleware'
)
const
i18nBackend
=
require
(
'i18next-node-fs-backend'
)
const
entryHelper
=
require
(
'./helpers/entry'
)
...
...
@@ -54,15 +53,14 @@ const entryHelper = require('./helpers/entry')
// ----------------------------------------
global
.
lang
.
use
(
i18nextBackend
)
.
use
(
i18nextMw
.
LanguageDetector
)
.
use
(
i18nBackend
)
.
init
({
load
:
'languageOnly'
,
ns
:
[
'common'
,
'errors'
,
'git'
],
ns
:
[
'common'
,
'
admin'
,
'auth'
,
'
errors'
,
'git'
],
defaultNS
:
'common'
,
saveMissing
:
false
,
supportedLngs
:
[
'en'
,
'fr'
],
preload
:
[
'en'
,
'fr'
]
,
preload
:
[
appconfig
.
lang
],
lng
:
appconfig
.
lang
,
fallbackLng
:
'en'
,
backend
:
{
loadPath
:
path
.
join
(
SERVERPATH
,
'locales/{{lng}}/{{ns}}.json'
)
...
...
server/views/auth/login.pug
View file @
8f974a3a
...
...
@@ -18,7 +18,8 @@ html(data-logic='login')
link(rel='manifest', href='/manifest.json')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
script(type='text/javascript', src='/js/libs.min.js')
script(type='text/javascript', src='/js/app.min.js')
body
#bg
...
...
server/views/error-forbidden.pug
View file @
8f974a3a
...
...
@@ -18,7 +18,8 @@ html(data-logic='error')
link(rel='manifest', href='/manifest.json')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
script(type='text/javascript', src='/js/libs.min.js')
script(type='text/javascript', src='/js/app.min.js')
body(class='is-forbidden')
.container
...
...
server/views/error-notexist.pug
View file @
8f974a3a
...
...
@@ -18,7 +18,8 @@ html(data-logic='error')
link(rel='manifest', href='/manifest.json')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
script(type='text/javascript', src='/js/libs.min.js')
script(type='text/javascript', src='/js/app.min.js')
body(class='is-notexist')
.container
...
...
server/views/error.pug
View file @
8f974a3a
...
...
@@ -18,7 +18,8 @@ html(data-logic='error')
link(rel='manifest', href='/manifest.json')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
script(type='text/javascript', src='/js/libs.min.js')
script(type='text/javascript', src='/js/app.min.js')
body(class='is-error')
.container
...
...
server/views/layout.pug
View file @
8f974a3a
...
...
@@ -18,7 +18,8 @@ html
link(rel='manifest', href='/manifest.json')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
script(type='text/javascript', src='/js/libs.min.js')
script(type='text/javascript', src='/js/app.min.js')
block head
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment