mirror of https://github.com/ColorlibHQ/AdminLTE
plugins prepare enhanced
- split Plugins in Plugins & DocsPlugins - created docs-prepare & install npm script - renamed prepare npm script to prepare-release - updated .npmignorepull/2256/head
parent
3607ed15ed
commit
4454f712ff
|
@ -1,2 +1,3 @@
|
||||||
/docs/
|
/docs/
|
||||||
/plugins/
|
/plugins/
|
||||||
|
!/plugins/flot-old/
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
const Plugins = [
|
||||||
|
// AdminLTE Dist
|
||||||
|
{
|
||||||
|
from: 'dist/css/',
|
||||||
|
to : 'docs/assets/css/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: 'dist/js/',
|
||||||
|
to : 'docs/assets/js/'
|
||||||
|
},
|
||||||
|
// jQuery
|
||||||
|
{
|
||||||
|
from: 'node_modules/jquery/dist/',
|
||||||
|
to : 'docs/assets/plugins/jquery/'
|
||||||
|
},
|
||||||
|
// Popper
|
||||||
|
{
|
||||||
|
from: 'node_modules/popper.js/dist/',
|
||||||
|
to : 'docs/assets/plugins/popper/'
|
||||||
|
},
|
||||||
|
// Bootstrap
|
||||||
|
{
|
||||||
|
from: 'node_modules/bootstrap/dist/js/',
|
||||||
|
to : 'docs/assets/plugins/bootstrap/js/'
|
||||||
|
},
|
||||||
|
// Font Awesome
|
||||||
|
{
|
||||||
|
from: 'node_modules/@fortawesome/fontawesome-free/css/',
|
||||||
|
to : 'docs/assets/plugins/fontawesome-free/css/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: 'node_modules/@fortawesome/fontawesome-free/webfonts/',
|
||||||
|
to : 'docs/assets/plugins/fontawesome-free/webfonts/'
|
||||||
|
},
|
||||||
|
// overlayScrollbars
|
||||||
|
{
|
||||||
|
from: 'node_modules/overlayscrollbars/js/',
|
||||||
|
to : 'docs/assets/plugins/overlayScrollbars/js/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: 'node_modules/overlayscrollbars/css/',
|
||||||
|
to : 'docs/assets/plugins/overlayScrollbars/css/'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
module.exports = Plugins
|
|
@ -0,0 +1,43 @@
|
||||||
|
const Plugins = require('./DocsPlugins')
|
||||||
|
const fse = require('fs-extra')
|
||||||
|
|
||||||
|
class Publish {
|
||||||
|
constructor() {
|
||||||
|
this.options = {
|
||||||
|
verbose: false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getArguments()
|
||||||
|
}
|
||||||
|
|
||||||
|
getArguments() {
|
||||||
|
if (process.argv.length > 2) {
|
||||||
|
let arg = process.argv[2]
|
||||||
|
switch (arg) {
|
||||||
|
case '-v':
|
||||||
|
case '--verbose':
|
||||||
|
this.options.verbose = true
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
throw new Error(`Unknown option ${arg}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
run() {
|
||||||
|
// Publish files
|
||||||
|
Plugins.forEach((module) => {
|
||||||
|
try {
|
||||||
|
fse.copySync(module.from, module.to)
|
||||||
|
|
||||||
|
if (this.options.verbose) {
|
||||||
|
console.log(`Copied ${module.from} to ${module.to}`)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Error: ${err}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(new Publish()).run()
|
|
@ -384,49 +384,6 @@ const Plugins = [
|
||||||
from: 'node_modules/bootstrap-switch/dist',
|
from: 'node_modules/bootstrap-switch/dist',
|
||||||
to: 'plugins/bootstrap-switch/'
|
to: 'plugins/bootstrap-switch/'
|
||||||
},
|
},
|
||||||
|
|
||||||
// AdminLTE Dist
|
|
||||||
{
|
|
||||||
from: 'dist/css',
|
|
||||||
to : 'docs/assets/css'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
from: 'dist/js',
|
|
||||||
to : 'docs/assets/js'
|
|
||||||
},
|
|
||||||
// jQuery
|
|
||||||
{
|
|
||||||
from: 'node_modules/jquery/dist',
|
|
||||||
to : 'docs/assets/plugins/jquery'
|
|
||||||
},
|
|
||||||
// Popper
|
|
||||||
{
|
|
||||||
from: 'node_modules/popper.js/dist',
|
|
||||||
to : 'docs/assets/plugins/popper'
|
|
||||||
},
|
|
||||||
// Bootstrap
|
|
||||||
{
|
|
||||||
from: 'node_modules/bootstrap/dist/js',
|
|
||||||
to : 'docs/assets/plugins/bootstrap/js'
|
|
||||||
},
|
|
||||||
// Font Awesome
|
|
||||||
{
|
|
||||||
from: 'node_modules/@fortawesome/fontawesome-free/css',
|
|
||||||
to : 'docs/assets/plugins/fontawesome-free/css'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
from: 'node_modules/@fortawesome/fontawesome-free/webfonts',
|
|
||||||
to : 'docs/assets/plugins/fontawesome-free/webfonts'
|
|
||||||
},
|
|
||||||
// overlayScrollbars
|
|
||||||
{
|
|
||||||
from: 'node_modules/overlayscrollbars/js',
|
|
||||||
to : 'docs/assets/plugins/overlayScrollbars/js'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
from: 'node_modules/overlayscrollbars/css',
|
|
||||||
to : 'docs/assets/plugins/overlayScrollbars/css'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports = Plugins
|
module.exports = Plugins
|
||||||
|
|
|
@ -27,13 +27,15 @@ class Publish {
|
||||||
run() {
|
run() {
|
||||||
// Publish files
|
// Publish files
|
||||||
Plugins.forEach((module) => {
|
Plugins.forEach((module) => {
|
||||||
fse.copy(module.from, module.to, error => {
|
try {
|
||||||
if (error) {
|
fse.copySync(module.from, module.to)
|
||||||
console.error(`Error: ${error}`)
|
|
||||||
} else if (this.options.verbose) {
|
if (this.options.verbose) {
|
||||||
console.log(`Copied ${module.from} to ${module.to}`)
|
console.log(`Copied ${module.from} to ${module.to}`)
|
||||||
}
|
}
|
||||||
})
|
} catch (err) {
|
||||||
|
console.error(`Error: ${err}`)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10663,6 +10663,17 @@
|
||||||
"locate-path": "^2.0.0"
|
"locate-path": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fs-extra": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.2",
|
||||||
|
"jsonfile": "^4.0.0",
|
||||||
|
"universalify": "^0.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fsevents": {
|
"fsevents": {
|
||||||
"version": "1.2.9",
|
"version": "1.2.9",
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
|
||||||
|
|
|
@ -12,14 +12,16 @@
|
||||||
"css-minify": "cleancss --level 1 --source-map --source-map-inline-sources --output dist/css/adminlte.min.css dist/css/adminlte.css",
|
"css-minify": "cleancss --level 1 --source-map --source-map-inline-sources --output dist/css/adminlte.min.css dist/css/adminlte.css",
|
||||||
"compile": "npm-run-all --parallel js css",
|
"compile": "npm-run-all --parallel js css",
|
||||||
"dev": "npm-run-all --parallel watch sync",
|
"dev": "npm-run-all --parallel watch sync",
|
||||||
"docs-serve": "cd docs/ && bundle exec jekyll serve",
|
|
||||||
"docs-compile": "cd docs/ && bundle exec jekyll build -d ../docs_html",
|
|
||||||
"docs-clean": "cd docs/ && bundle exec jekyll clean -d ../docs_html",
|
"docs-clean": "cd docs/ && bundle exec jekyll clean -d ../docs_html",
|
||||||
|
"docs-compile": "cd docs/ && bundle exec jekyll build -d ../docs_html",
|
||||||
|
"docs-serve": "cd docs/ && bundle exec jekyll serve",
|
||||||
|
"docs-prepare": "node build/npm/DocsPublish.js -v",
|
||||||
|
"install": "npm run plugins",
|
||||||
"js": "npm-run-all --sequential js-compile js-minify",
|
"js": "npm-run-all --sequential js-compile js-minify",
|
||||||
"js-compile": "rollup --config build/config/rollup.config.js --sourcemap",
|
"js-compile": "rollup --config build/config/rollup.config.js --sourcemap",
|
||||||
"js-minify": "terser --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/js/adminlte.js.map,includeSources,url=adminlte.min.js.map\" --output dist/js/adminlte.min.js dist/js/adminlte.js",
|
"js-minify": "terser --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/js/adminlte.js.map,includeSources,url=adminlte.min.js.map\" --output dist/js/adminlte.min.js dist/js/adminlte.js",
|
||||||
"production": "npm-run-all --sequential compile plugins",
|
"production": "npm-run-all --sequential compile plugins",
|
||||||
"prepare": "npm-run-all --sequential compile plugins docs-clean docs-compile",
|
"prepare-release": "npm-run-all --sequential compile plugins docs-clean docs-compile",
|
||||||
"plugins": "node build/npm/Publish.js -v",
|
"plugins": "node build/npm/Publish.js -v",
|
||||||
"sync": "browser-sync start --server --files *.html pages/ dist/",
|
"sync": "browser-sync start --server --files *.html pages/ dist/",
|
||||||
"watch": "npm-run-all --parallel watch-css watch-js",
|
"watch": "npm-run-all --parallel watch-css watch-js",
|
||||||
|
|
Loading…
Reference in New Issue