gulpfile pipeline

This commit is contained in:
jojo aquino 2024-12-18 20:25:10 +00:00
parent 4e757fccc3
commit 107c4ef2d6
9 changed files with 2981 additions and 0 deletions

1
.gitignore vendored
View File

@ -360,3 +360,4 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/EnotaryoPH/EnotaryoPH.Web/wwwroot/dist/

View File

@ -0,0 +1,21 @@
jfa.utilities.element = (function () {
function hide(element) {
if (!element) {
return;
}
element.hidden = true;
}
function show(element, suppressEvent) {
if (!element) {
return;
}
element.hidden = false;
}
return {
hide: hide,
show: show
};
})();

View File

@ -0,0 +1,28 @@
jfa.utilities.request = (function () {
async function del(url, data) {
return await _fetch(url, data, "DELETE");
}
async function _fetch(url, data, method) {
const response = await fetch(url, {
method: method,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-XSRF-TOKEN': jfa.page.getAntiForgeryToken()
},
body: data ? JSON.stringify(data) : data
});
return response;
}
async function post(url, data) {
return await _fetch(url, data, "POST");
}
return {
delete: del,
post: post
};
})();

View File

@ -0,0 +1,16 @@
jfa.utilities.routing = (function () {
function getCurrentURL() {
return new URL(window.location.origin + window.location.pathname);
}
function getCurrentURLWithHandler(handler) {
let url = getCurrentURL();
url.searchParams.append("handler", handler);
return url;
}
return {
getCurrentURL: getCurrentURL,
getCurrentURLWithHandler: getCurrentURLWithHandler
};
})();

View File

@ -0,0 +1,5 @@
"use strict";
var jfa = {
components: {},
utilities: {}
};

View File

@ -0,0 +1,31 @@
const gulp = require("gulp"),
concat = require('gulp-concat'),
del = require('del'),
sass = require('gulp-sass')(require('sass')),
rename = require("gulp-rename"),
uglify = require('gulp-uglify');
const bundles = {
jfa: {
outputFileName: "wwwroot/dist/js/jfa.js",
inputFiles: [
"Assets/js/_Jfa.js",
"Assets/js/Utilities/Routing/_Routing.js",
"Assets/js/Utilities/Element/_Element.js",
"Assets/js/Utilities/Request/_Request.js",
]
},
};
gulp.task('bundle:jfa', function () {
return gulp.src(bundles.jfa.inputFiles, { base: "." })
.pipe(concat(bundles.jfa.outputFileName))
.pipe(gulp.dest("."))
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest("."));
});
gulp.task('default', gulp.series(
gulp.parallel(['bundle:jfa'])
));

2855
EnotaryoPH/EnotaryoPH.Web/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
{
"name": "jfa home",
"version": "1.0.0",
"description": "JFA Websites",
"main": "index.js",
"author": "Jose Aquino Jr",
"license": "MIT",
"devDependencies": {
"del": "6.1.1",
"gulp": "^5.0.0",
"gulp-concat": "^2.6.1",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.1.0",
"gulp-uglify": "^3.0.2",
"merge-stream": "^2.0.0",
"sass": "^1.54.9"
}
}

6
EnotaryoPH/package-lock.json generated Normal file
View File

@ -0,0 +1,6 @@
{
"name": "EnotaryoPH",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}