gulpfile pipeline
This commit is contained in:
		
							parent
							
								
									4e757fccc3
								
							
						
					
					
						commit
						107c4ef2d6
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -360,3 +360,4 @@ MigrationBackup/ | ||||
| 
 | ||||
| # Fody - auto-generated XML schema | ||||
| FodyWeavers.xsd | ||||
| /EnotaryoPH/EnotaryoPH.Web/wwwroot/dist/ | ||||
|  | ||||
| @ -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 | ||||
|   }; | ||||
| })(); | ||||
| @ -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 | ||||
|   }; | ||||
| })(); | ||||
| @ -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 | ||||
|   }; | ||||
| })(); | ||||
							
								
								
									
										5
									
								
								EnotaryoPH/EnotaryoPH.Web/Assets/js/_Jfa.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								EnotaryoPH/EnotaryoPH.Web/Assets/js/_Jfa.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| "use strict"; | ||||
| var jfa = { | ||||
|   components: {}, | ||||
|   utilities: {} | ||||
| }; | ||||
							
								
								
									
										31
									
								
								EnotaryoPH/EnotaryoPH.Web/gulpfile.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								EnotaryoPH/EnotaryoPH.Web/gulpfile.js
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										2855
									
								
								EnotaryoPH/EnotaryoPH.Web/package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										18
									
								
								EnotaryoPH/EnotaryoPH.Web/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								EnotaryoPH/EnotaryoPH.Web/package.json
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										6
									
								
								EnotaryoPH/package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | ||||
| { | ||||
|   "name": "EnotaryoPH", | ||||
|   "lockfileVersion": 3, | ||||
|   "requires": true, | ||||
|   "packages": {} | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user