diff --git a/gulpfile.js b/gulpfile.js index 7de5d3086..fca9a6ab1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ /* eslint-disable camelcase */ /* eslint-disable no-undef */ /* eslint-disable unicorn/prefer-module */ @@ -15,12 +16,24 @@ const postcss = require('gulp-postcss') const sourcemaps = require('gulp-sourcemaps') const fileinclude = require('gulp-file-include') +const esbuild = require('esbuild') +// const { getTarget } = require('./get.browserslist.target') + +const pkg = require('./package') +const year = new Date().getFullYear() +const banner = `/*! + * AdminLTE v${pkg.version} (${pkg.homepage}) + * Copyright 2014-${year} ${pkg.author} + * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE) + */` + // Define paths const paths = { dist: { base: './dist/', css: './dist/css', + js: './dist/js', html: './dist/pages', assets: './dist/assets', img: './dist/assets/img', @@ -37,12 +50,14 @@ const paths = { assets: './src/assets/**/*.*', partials: './src/partials/**/*.html', scss: './src/scss', + ts: './src/ts', node_modules: './node_modules/', vendor: './vendor' }, temp: { base: './.temp/', css: './.temp/css', + js: './.temp/js', html: './.temp/pages', assets: './.temp/assets', vendor: './.temp/vendor' @@ -79,6 +94,23 @@ gulp.task('scss', () => { .pipe(browserSync.stream()) }) +gulp.task('ts', () => { + return esbuild.build({ + entryPoints: [paths.src.ts + '/adminlte.ts'], + banner: { + js: banner + }, + bundle: true, + color: true, + format: 'iife', + sourcemap: true, + target: ['chrome60'], + outfile: paths.temp.js + '/adminlte.js' + }).catch( + error => console.error(error) + ) +}) + gulp.task('index', () => { return gulp.src([paths.src.base + '*.html']) .pipe(fileinclude({ @@ -116,12 +148,13 @@ gulp.task('vendor', () => { .pipe(gulp.dest(paths.temp.vendor)) }) -gulp.task('serve', gulp.series('scss', 'html', 'index', 'assets', 'vendor', () => { +gulp.task('serve', gulp.series('scss', 'ts', 'html', 'index', 'assets', 'vendor', () => { browserSync.init({ server: paths.temp.base }) - gulp.watch([paths.src.scss + '/**/*.scss', paths.src.scss + '/adminlte.scss'], gulp.series('scss')) + gulp.watch([paths.src.scss], gulp.series('scss')) + gulp.watch([paths.src.ts], gulp.series('ts')) gulp.watch([paths.src.html, paths.src.base + '*.html', paths.src.partials], gulp.series('html', 'index')) gulp.watch([paths.src.assets], gulp.series('assets')) gulp.watch([paths.src.vendor], gulp.series('vendor')) diff --git a/src/index.html b/src/index.html index 821569075..19c1ef2f3 100644 --- a/src/index.html +++ b/src/index.html @@ -2,293 +2,135 @@ - - - - - - - AdminLTE v4 - - - - - - - - @@include('./_head.html', { - "path": ".", - "title": "Volt - Free Bootstrap 5 Admin Dashboard" - }) - + + @@include('./_head.html', { + "path": ".", + "title": "AdminLTE - Free Bootstrap 5 Admin Dashboard" + }) + + - -
- - - + +
+ @@include('./dashboard/_topbar.html', { + "path": "." + }) - - - - -
-
-
-
-
-
Dashboard
-
-
- + @@include('./dashboard/_sidenav.html', { + "path": "." + }) + +
+
+
+
+
+
Dashboard
+
+
+ +
+
+
+ +
+
+ +
+
+

150

+ +

New Orders

+
+
+ +
+ More info +
+
+ +
+ +
+
+

53%

+ +

Bounce Rate

+
+
+ +
+ More info +
+
+ +
+ +
+
+

44

+ +

User Registrations

+
+
+ +
+ More info +
+
+ +
+ +
+
+

65

+ +

Unique Visitors

+
+
+ +
+ More info +
+
+ +
+ + +
+ +
+ + + + + + + + + +
+
+ +
+
-
-
- -
-
- -
-
-

150

+ -

New Orders

-
-
- -
- More info -
-
- -
- -
-
-

53%

- -

Bounce Rate

-
-
- -
- More info -
-
- -
- -
-
-

44

- -

User Registrations

-
-
- -
- More info -
-
- -
- -
-
-

65

- -

Unique Visitors

-
-
- -
- More info -
-
- -
- - -
- -
- - - - - - - - - -
-
- -
-
+ @@include('./dashboard/_footer.html', { + "path": "." + })
- + - -
- -
- Anything you want -
- - Copyright © 2014-2021 AdminLTE.io. All rights reserved. -
-
- - - - - - - - - + @@include('./_scripts.html', { + "path": "." + }) + diff --git a/src/pages/demo.html b/src/pages/demo.html new file mode 100644 index 000000000..4c0386559 --- /dev/null +++ b/src/pages/demo.html @@ -0,0 +1,12 @@ + + + + + + + Demo + + + + + diff --git a/src/partials/_head.html b/src/partials/_head.html index dd2517cfe..735f417c2 100644 --- a/src/partials/_head.html +++ b/src/partials/_head.html @@ -1 +1,12 @@ -hiiii + + + + + +@@title + + + + + + diff --git a/src/partials/_scripts.html b/src/partials/_scripts.html new file mode 100644 index 000000000..d04805178 --- /dev/null +++ b/src/partials/_scripts.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/partials/dashboard/_footer.html b/src/partials/dashboard/_footer.html new file mode 100644 index 000000000..351398c23 --- /dev/null +++ b/src/partials/dashboard/_footer.html @@ -0,0 +1,9 @@ + +
+ +
+ Anything you want +
+ + Copyright © 2014-2021 AdminLTE.io. All rights reserved. +
diff --git a/src/partials/dashboard/_sidenav.html b/src/partials/dashboard/_sidenav.html new file mode 100644 index 000000000..298647461 --- /dev/null +++ b/src/partials/dashboard/_sidenav.html @@ -0,0 +1,114 @@ + + diff --git a/src/partials/dashboard/_topbar.html b/src/partials/dashboard/_topbar.html new file mode 100644 index 000000000..b72f7089a --- /dev/null +++ b/src/partials/dashboard/_topbar.html @@ -0,0 +1,28 @@ + + +