From ca97a4a48d0216878f1d94ef0c78919bb2c136dd Mon Sep 17 00:00:00 2001 From: Daniel <50356015+danny007in@users.noreply.github.com> Date: Sun, 7 Nov 2021 22:26:23 +0530 Subject: [PATCH] :boom: vendor folder to cdn --- gulpfile.js | 50 ++++++++++++++++++------------ package-lock.json | 63 +++++--------------------------------- package.json | 11 ++----- src/index.html | 4 ++- src/index2.html | 4 ++- src/index3.html | 4 ++- src/partials/_head.html | 16 +++++++--- src/partials/_scripts.html | 10 ++++-- 8 files changed, 68 insertions(+), 94 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 98dc947fb..c9716111a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,6 @@ const eslint = require('gulp-eslint-new') const fileinclude = require('gulp-file-include') const validator = require('gulp-html') const gulpIf = require('gulp-if') -const npmDist = require('gulp-npm-dist') const postcss = require('gulp-postcss') const rename = require('gulp-rename') const sass = require('gulp-sass')(require('sass')) @@ -35,8 +34,7 @@ const paths = { css: './dist/css', js: './dist/js', html: './dist/pages', - assets: './dist/assets', - vendor: './dist/vendor' + assets: './dist/assets' }, src: { base: './src/', @@ -44,16 +42,14 @@ const paths = { assets: './src/assets/**/*.*', partials: './src/partials/**/*.html', scss: './src/scss', - ts: './src/ts', - nodeModules: './node_modules/' + ts: './src/ts' }, temp: { base: './.temp/', css: './.temp/css', js: './.temp/js', html: './.temp/pages', - assets: './.temp/assets', - vendor: './.temp/vendor' + assets: './.temp/assets' } } @@ -151,12 +147,9 @@ const html = () => src([paths.src.html]) .pipe(dest(paths.temp.html)) .pipe(browserSync.stream()) -const lintHtml = () => src([paths.temp.html + '/**/*.html', paths.src.base + '*.html']) +const lintHtml = () => src([paths.temp.html + '/**/*.html', paths.temp.base + '*.html']) .pipe(validator()) -const vendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.nodeModules }) - .pipe(dest(paths.temp.vendor)) - const serve = () => { browserSync.init({ server: paths.temp.base @@ -266,17 +259,37 @@ const copyDistHtml = () => src([paths.src.html]) })) .pipe(dest(paths.dist.html)) -const lintDistHtml = () => src([paths.dist.html + '/**/*.html', paths.dist.base + '*.html']) +// HTML Lint +// Copy index for Lint +const copyDistHtmlIndexForLint = () => src([paths.src.base + '*.html']) + .pipe(fileinclude({ + prefix: '@@', + basepath: './src/partials/', + context: { + environment: 'production' + } + })) + .pipe(dest(paths.temp.base)) +// Copy Html for Lint +const copyDistHtmlForLint = () => src([paths.src.html]) + .pipe(fileinclude({ + prefix: '@@', + basepath: './src/partials/', + context: { + environment: 'production' + } + })) + .pipe(dest(paths.temp.html)) +// Now Lint +const lintDistHtmlCopied = () => src([paths.temp.html + '/**/*.html', paths.temp.base + '*.html']) .pipe(validator()) -// Copy node_modules to vendor -const copyDistVendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.nodeModules }) - .pipe(dest(paths.dist.vendor)) +const lintDistHtml = series(copyDistHtmlIndexForLint, copyDistHtmlForLint, lintDistHtmlCopied) const lint = parallel( lintDistScss, lintDistTs, - series(copyDistHtmlIndex, copyDistHtml, lintDistHtml) + lintDistHtml ) exports.lint = lint @@ -290,8 +303,7 @@ const compile = series( series(copyDistJs, minifyDistJs), copyDistAssets, copyDistHtmlIndex, - copyDistHtml, - copyDistVendor + copyDistHtml ) ) exports.compile = compile @@ -300,4 +312,4 @@ exports.compile = compile exports.production = series(lint, compile) // Default - Only for light mode AdminLTE -exports.default = series(scss, scssDark, tsCompile, html, index, assets, vendor, serve) +exports.default = series(scss, scssDark, tsCompile, html, index, assets, serve) diff --git a/package-lock.json b/package-lock.json index c62420c47..0ff92f151 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,18 +8,12 @@ "name": "admin-lte", "version": "4.0.0-alpha1", "license": "MIT", - "dependencies": { - "@fortawesome/fontawesome-free": "^5.15.4", - "@popperjs/core": "^2.10.2", - "bootstrap": "^5.1.3", - "chart.js": "^3.5.1", - "overlayscrollbars": "^1.13.1" - }, "devDependencies": { "@rollup/plugin-typescript": "^8.3.0", "@typescript-eslint/eslint-plugin": "^5.3.0", "@typescript-eslint/parser": "^5.3.0", "autoprefixer": "^10.4.0", + "bootstrap": "^5.1.3", "browser-sync": "^2.27.7", "bundlewatch": "^0.3.2", "del": "^6.0.0", @@ -34,7 +28,6 @@ "gulp-file-include": "^2.3.0", "gulp-html": "^3.5.0", "gulp-if": "^3.0.0", - "gulp-npm-dist": "^1.0.3", "gulp-postcss": "^9.0.1", "gulp-rename": "^2.0.0", "gulp-sass": "^5.0.0", @@ -566,15 +559,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@fortawesome/fontawesome-free": { - "version": "5.15.4", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz", - "integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg==", - "hasInstallScript": true, - "engines": { - "node": ">=6" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", @@ -634,6 +618,8 @@ "version": "2.10.2", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==", + "dev": true, + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -1488,6 +1474,7 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", + "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/bootstrap" @@ -1816,11 +1803,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/chart.js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.0.tgz", - "integrity": "sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ==" - }, "node_modules/chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", @@ -5105,12 +5087,6 @@ "minimatch": "^3.0.3" } }, - "node_modules/gulp-npm-dist": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/gulp-npm-dist/-/gulp-npm-dist-1.0.3.tgz", - "integrity": "sha512-7nank8dgqYXOR6K7VM5VdzvAmCGCaudUEbVKOkCVyu+/EK3QuD8PUJ+UlV/f2QWswN0jDXnHlM7FuT2BUt8P3w==", - "dev": true - }, "node_modules/gulp-postcss": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/gulp-postcss/-/gulp-postcss-9.0.1.tgz", @@ -7737,11 +7713,6 @@ "node": ">=0.10.0" } }, - "node_modules/overlayscrollbars": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/overlayscrollbars/-/overlayscrollbars-1.13.1.tgz", - "integrity": "sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ==" - }, "node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -12307,11 +12278,6 @@ } } }, - "@fortawesome/fontawesome-free": { - "version": "5.15.4", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz", - "integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg==" - }, "@humanwhocodes/config-array": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", @@ -12358,7 +12324,9 @@ "@popperjs/core": { "version": "2.10.2", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", - "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==" + "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==", + "dev": true, + "peer": true }, "@rollup/plugin-typescript": { "version": "8.3.0", @@ -12974,6 +12942,7 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", + "dev": true, "requires": {} }, "brace-expansion": { @@ -13218,11 +13187,6 @@ "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", "dev": true }, - "chart.js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.0.tgz", - "integrity": "sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ==" - }, "chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", @@ -15928,12 +15892,6 @@ "minimatch": "^3.0.3" } }, - "gulp-npm-dist": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/gulp-npm-dist/-/gulp-npm-dist-1.0.3.tgz", - "integrity": "sha512-7nank8dgqYXOR6K7VM5VdzvAmCGCaudUEbVKOkCVyu+/EK3QuD8PUJ+UlV/f2QWswN0jDXnHlM7FuT2BUt8P3w==", - "dev": true - }, "gulp-postcss": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/gulp-postcss/-/gulp-postcss-9.0.1.tgz", @@ -17964,11 +17922,6 @@ "lcid": "^1.0.0" } }, - "overlayscrollbars": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/overlayscrollbars/-/overlayscrollbars-1.13.1.tgz", - "integrity": "sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ==" - }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", diff --git a/package.json b/package.json index ad352f602..986fc379f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json", "docs-compile": "node -v", "docs-lint": "node -v", - "lint": "npx gulp lint && lockfile-lint", + "lint": "npx gulp lint && npm run lockfile-lint", "compile": "npx gulp compile", "production": "npx gulp production" }, @@ -35,18 +35,12 @@ "bugs": { "url": "https://github.com/ColorlibHQ/AdminLTE/issues" }, - "dependencies": { - "@fortawesome/fontawesome-free": "^5.15.4", - "@popperjs/core": "^2.10.2", - "bootstrap": "^5.1.3", - "chart.js": "^3.5.1", - "overlayscrollbars": "^1.13.1" - }, "devDependencies": { "@rollup/plugin-typescript": "^8.3.0", "@typescript-eslint/eslint-plugin": "^5.3.0", "@typescript-eslint/parser": "^5.3.0", "autoprefixer": "^10.4.0", + "bootstrap": "^5.1.3", "browser-sync": "^2.27.7", "bundlewatch": "^0.3.2", "del": "^6.0.0", @@ -61,7 +55,6 @@ "gulp-file-include": "^2.3.0", "gulp-html": "^3.5.0", "gulp-if": "^3.0.0", - "gulp-npm-dist": "^1.0.3", "gulp-postcss": "^9.0.1", "gulp-rename": "^2.0.0", "gulp-sass": "^5.0.0", diff --git a/src/index.html b/src/index.html index 175b0a655..0fcfb01e5 100644 --- a/src/index.html +++ b/src/index.html @@ -360,8 +360,10 @@ "path": "." }) + + - + diff --git a/src/index2.html b/src/index2.html index 0561123d0..eb791ad15 100644 --- a/src/index2.html +++ b/src/index2.html @@ -834,8 +834,10 @@ "path": "." }) + + - + diff --git a/src/index3.html b/src/index3.html index 1391927f1..1b2e73f2c 100644 --- a/src/index3.html +++ b/src/index3.html @@ -297,8 +297,10 @@ "path": "." }) + + - + diff --git a/src/partials/_head.html b/src/partials/_head.html index 45a47d5cb..b9f35fe0f 100644 --- a/src/partials/_head.html +++ b/src/partials/_head.html @@ -10,10 +10,20 @@ + + + + + + + - + + + + @@ -23,7 +33,3 @@ - - - - diff --git a/src/partials/_scripts.html b/src/partials/_scripts.html index 9768453c5..4a44316cc 100644 --- a/src/partials/_scripts.html +++ b/src/partials/_scripts.html @@ -1,7 +1,11 @@ - + + - + - + + + +