refactor: Upgrade to Fusebox 2.0
This commit is contained in:
17
client/js/components/copy-path.vue
Normal file
17
client/js/components/copy-path.vue
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<p>{{ msg }}</p>
|
||||||
|
<input type="text" v-model="msg" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'app',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
msg: 'Welcome to Your Vue.js App'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,12 +1,23 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
/* eslint-disable no-new */
|
||||||
|
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
import MathJax from 'mathjax'
|
import MathJax from 'mathjax'
|
||||||
|
import * as CopyPath from '../components/copy-path.vue'
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
module.exports = (alerts) => {
|
module.exports = (alerts) => {
|
||||||
if ($('#page-type-view').length) {
|
if ($('#page-type-view').length) {
|
||||||
let currentBasePath = ($('#page-type-view').data('entrypath') !== 'home') ? $('#page-type-view').data('entrypath') : ''
|
let currentBasePath = ($('#page-type-view').data('entrypath') !== 'home') ? $('#page-type-view').data('entrypath') : ''
|
||||||
|
|
||||||
|
// Copy Path
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
el: '.modal-copypath',
|
||||||
|
render: h => h(CopyPath)
|
||||||
|
})
|
||||||
|
|
||||||
// MathJax Render
|
// MathJax Render
|
||||||
|
|
||||||
MathJax.Hub.Config({
|
MathJax.Hub.Config({
|
||||||
|
|||||||
46
fuse.js
46
fuse.js
@@ -188,11 +188,12 @@ globalTasks.then(() => {
|
|||||||
|
|
||||||
fuse = fsbx.FuseBox.init({
|
fuse = fsbx.FuseBox.init({
|
||||||
homeDir: './client',
|
homeDir: './client',
|
||||||
outFile: './assets/js/bundle.min.js',
|
output: './assets/js/$name.min.js',
|
||||||
alias: ALIASES,
|
alias: ALIASES,
|
||||||
shim: SHIMS,
|
shim: SHIMS,
|
||||||
plugins: [
|
plugins: [
|
||||||
[ fsbx.SassPlugin({ includePaths: ['../core'] }), fsbx.CSSPlugin() ],
|
fsbx.VuePlugin(),
|
||||||
|
[ '.scss', fsbx.SassPlugin(), fsbx.CSSPlugin() ],
|
||||||
fsbx.BabelPlugin({ comments: false, presets: ['es2015'] }),
|
fsbx.BabelPlugin({ comments: false, presets: ['es2015'] }),
|
||||||
fsbx.JSONPlugin()
|
fsbx.JSONPlugin()
|
||||||
],
|
],
|
||||||
@@ -200,15 +201,16 @@ globalTasks.then(() => {
|
|||||||
log: true
|
log: true
|
||||||
})
|
})
|
||||||
|
|
||||||
fuse.devServer('>index.js', {
|
fuse.dev({
|
||||||
port: 4444,
|
port: 4444,
|
||||||
httpServer: false,
|
httpServer: false
|
||||||
hmr: false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Server
|
fuse.bundle('bundle')
|
||||||
|
.instructions('> index.js')
|
||||||
|
.watch()
|
||||||
|
|
||||||
_.delay(() => {
|
fuse.run().then(() => {
|
||||||
nodemon({
|
nodemon({
|
||||||
exec: (args.i) ? 'node --inspect server' : 'node server',
|
exec: (args.i) ? 'node --inspect server' : 'node server',
|
||||||
ignore: ['assets/', 'client/', 'data/', 'repo/', 'tests/'],
|
ignore: ['assets/', 'client/', 'data/', 'repo/', 'tests/'],
|
||||||
@@ -216,7 +218,8 @@ globalTasks.then(() => {
|
|||||||
watch: ['server'],
|
watch: ['server'],
|
||||||
env: { 'NODE_ENV': 'development' }
|
env: { 'NODE_ENV': 'development' }
|
||||||
})
|
})
|
||||||
}, 1000)
|
})
|
||||||
|
|
||||||
break
|
break
|
||||||
// =============================================
|
// =============================================
|
||||||
// CONFIGURE - DEVELOPER MODE
|
// CONFIGURE - DEVELOPER MODE
|
||||||
@@ -226,11 +229,11 @@ globalTasks.then(() => {
|
|||||||
|
|
||||||
fuse = fsbx.FuseBox.init({
|
fuse = fsbx.FuseBox.init({
|
||||||
homeDir: './client',
|
homeDir: './client',
|
||||||
outFile: './assets/js/configure.min.js',
|
output: './assets/js/$name.min.js',
|
||||||
alias: ALIASES,
|
alias: ALIASES,
|
||||||
shim: SHIMS,
|
shim: SHIMS,
|
||||||
plugins: [
|
plugins: [
|
||||||
[ fsbx.SassPlugin({ includePaths: ['../core'] }), fsbx.CSSPlugin() ],
|
[ '.scss', fsbx.SassPlugin(), fsbx.CSSPlugin() ],
|
||||||
fsbx.BabelPlugin({ comments: false, presets: ['es2015'] }),
|
fsbx.BabelPlugin({ comments: false, presets: ['es2015'] }),
|
||||||
fsbx.JSONPlugin()
|
fsbx.JSONPlugin()
|
||||||
],
|
],
|
||||||
@@ -238,14 +241,16 @@ globalTasks.then(() => {
|
|||||||
log: true
|
log: true
|
||||||
})
|
})
|
||||||
|
|
||||||
fuse.devServer('>configure.js', {
|
fuse.dev({
|
||||||
port: 4444,
|
port: 4444,
|
||||||
httpServer: false
|
httpServer: false
|
||||||
})
|
})
|
||||||
|
|
||||||
// Server
|
fuse.bundle('configure')
|
||||||
|
.instructions('> configure.js')
|
||||||
|
.watch()
|
||||||
|
|
||||||
_.delay(() => {
|
fuse.run().then(() => {
|
||||||
nodemon({
|
nodemon({
|
||||||
exec: 'node wiki configure',
|
exec: 'node wiki configure',
|
||||||
ignore: ['assets/', 'client/', 'data/', 'repo/', 'tests/'],
|
ignore: ['assets/', 'client/', 'data/', 'repo/', 'tests/'],
|
||||||
@@ -253,7 +258,8 @@ globalTasks.then(() => {
|
|||||||
watch: ['server/configure.js'],
|
watch: ['server/configure.js'],
|
||||||
env: { 'NODE_ENV': 'development' }
|
env: { 'NODE_ENV': 'development' }
|
||||||
})
|
})
|
||||||
}, 1000)
|
})
|
||||||
|
|
||||||
break
|
break
|
||||||
// =============================================
|
// =============================================
|
||||||
// BUILD ONLY MODE
|
// BUILD ONLY MODE
|
||||||
@@ -261,11 +267,13 @@ globalTasks.then(() => {
|
|||||||
case 'build':
|
case 'build':
|
||||||
fuse = fsbx.FuseBox.init({
|
fuse = fsbx.FuseBox.init({
|
||||||
homeDir: './client',
|
homeDir: './client',
|
||||||
|
output: './assets/js/$name.min.js',
|
||||||
alias: ALIASES,
|
alias: ALIASES,
|
||||||
shim: SHIMS,
|
shim: SHIMS,
|
||||||
plugins: [
|
plugins: [
|
||||||
fsbx.EnvPlugin({ NODE_ENV: 'production' }),
|
fsbx.EnvPlugin({ NODE_ENV: 'production' }),
|
||||||
[ fsbx.SassPlugin({ outputStyle: 'compressed', includePaths: ['./node_modules/requarks-core'] }), fsbx.CSSPlugin() ],
|
fsbx.VuePlugin(),
|
||||||
|
[ '.scss', fsbx.SassPlugin({ outputStyle: 'compressed' }), fsbx.CSSPlugin() ],
|
||||||
fsbx.BabelPlugin({
|
fsbx.BabelPlugin({
|
||||||
config: {
|
config: {
|
||||||
comments: false,
|
comments: false,
|
||||||
@@ -282,10 +290,10 @@ globalTasks.then(() => {
|
|||||||
log: true
|
log: true
|
||||||
})
|
})
|
||||||
|
|
||||||
fuse.bundle({
|
fuse.bundle('bundle').instructions('> index.js')
|
||||||
'./assets/js/bundle.min.js': '>index.js',
|
fuse.bundle('configure').instructions('> configure.js')
|
||||||
'./assets/js/configure.min.js': '>configure.js'
|
|
||||||
}).then(() => {
|
fuse.run().then(() => {
|
||||||
console.info(colors.green.bold('\nAssets compilation + bundling completed.'))
|
console.info(colors.green.bold('\nAssets compilation + bundling completed.'))
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error(colors.red(' X Bundle compilation failed! ' + err.message))
|
console.error(colors.red(' X Bundle compilation failed! ' + err.message))
|
||||||
|
|||||||
@@ -134,7 +134,7 @@
|
|||||||
"eslint-plugin-node": "latest",
|
"eslint-plugin-node": "latest",
|
||||||
"eslint-plugin-promise": "latest",
|
"eslint-plugin-promise": "latest",
|
||||||
"eslint-plugin-standard": "latest",
|
"eslint-plugin-standard": "latest",
|
||||||
"fuse-box": "^1.3.131",
|
"fuse-box": "^2.0.0-beta.13",
|
||||||
"jest": "latest",
|
"jest": "latest",
|
||||||
"jquery": "^3.2.1",
|
"jquery": "^3.2.1",
|
||||||
"jquery-contextmenu": "^2.4.4",
|
"jquery-contextmenu": "^2.4.4",
|
||||||
@@ -148,9 +148,11 @@
|
|||||||
"snyk": "latest",
|
"snyk": "latest",
|
||||||
"standard": "latest",
|
"standard": "latest",
|
||||||
"twemoji-awesome": "^1.0.6",
|
"twemoji-awesome": "^1.0.6",
|
||||||
|
"typescript": "^2.3.2",
|
||||||
"uglify-js": "latest",
|
"uglify-js": "latest",
|
||||||
"vee-validate": "^2.0.0-rc.2",
|
"vee-validate": "^2.0.0-rc.2",
|
||||||
"vue": "^2.3.0"
|
"vue": "^2.3.2",
|
||||||
|
"vue-template-compiler": "^2.3.2"
|
||||||
},
|
},
|
||||||
"standard": {
|
"standard": {
|
||||||
"globals": [
|
"globals": [
|
||||||
|
|||||||
@@ -112,10 +112,10 @@ const parseTree = (content) => {
|
|||||||
let content = ''
|
let content = ''
|
||||||
let anchor = ''
|
let anchor = ''
|
||||||
if (heading.children && heading.children.length > 0 && heading.children[0].type === 'link_open') {
|
if (heading.children && heading.children.length > 0 && heading.children[0].type === 'link_open') {
|
||||||
content = removeMarkdown(heading.children[1].content)
|
content = mdRemove(heading.children[1].content)
|
||||||
anchor = _.kebabCase(content)
|
anchor = _.kebabCase(content)
|
||||||
} else {
|
} else {
|
||||||
content = removeMarkdown(heading.content)
|
content = mdRemove(heading.content)
|
||||||
anchor = _.kebabCase(heading.children.reduce((acc, t) => acc + t.content, ''))
|
anchor = _.kebabCase(heading.children.reduce((acc, t) => acc + t.content, ''))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
tsconfig.json
Normal file
15
tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"alwaysStrict": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"preserveConstEnums": true,
|
||||||
|
"removeComments": true,
|
||||||
|
"sourceMap": false,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
|
"target": "es5"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user