├── .gitignore ├── LICENSE ├── README.md ├── gulpfile.js ├── package.json └── src ├── css └── app.css ├── index.html └── js ├── app.js └── components └── github-file-explorer ├── index.js └── template.html /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | dist -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alex Sears 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vuejs-github-explorer-blog 2 | This is the repository for the code from the blog post "Create a Github Explorer Using Vue.js." 3 | 4 | 5 | [Read the Tutorial Here](https://scotch.io/tutorials/create-a-github-file-explorer-using-vue-js) by [Alex Sears](https://twitter.com/searsaw) 6 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var copy = require('gulp-copy'); 3 | var concat = require('gulp-concat'); 4 | var uglify = require('gulp-uglify'); 5 | var sourcemaps = require('gulp-sourcemaps'); 6 | var connect = require('gulp-connect'); 7 | var browserify = require('browserify'); 8 | var partialify = require('partialify'); 9 | var source = require('vinyl-source-stream'); 10 | var buffer = require('vinyl-buffer'); 11 | 12 | gulp.task('html', function() { 13 | gulp.src('src/*.html') 14 | .pipe(gulp.dest('dist')) 15 | .pipe(connect.reload());; 16 | }); 17 | 18 | gulp.task('css', function() { 19 | var stylesheets = [ 20 | 'node_modules/bootstrap/dist/css/bootstrap.min.css', 21 | 'node_modules/bootstrap/dist/css/bootstrap-theme.min.css', 22 | 'node_modules/font-awesome/css/font-awesome.min.css', 23 | 'src/css/app.css' 24 | ]; 25 | 26 | gulp.src(stylesheets) 27 | .pipe(concat('app.min.css')) 28 | .pipe(gulp.dest('dist/css')) 29 | }); 30 | 31 | gulp.task('fonts', function() { 32 | var fonts = [ 33 | 'node_modules/bootstrap/dist/fonts/*', 34 | 'node_modules/font-awesome/fonts/*' 35 | ]; 36 | 37 | gulp.src(fonts) 38 | .pipe(gulp.dest('dist/fonts')); 39 | }); 40 | 41 | gulp.task('js', function() { 42 | browserify({ 43 | entries: 'src/js/app.js', 44 | debug: true 45 | }) 46 | .transform(partialify) 47 | .bundle() 48 | .on('error', function (err) { 49 | console.log(err.toString()); 50 | this.emit("end"); 51 | }) 52 | .pipe(source('app.min.js')) 53 | .pipe(buffer()) 54 | .pipe(sourcemaps.init({ loadMaps: true })) 55 | .pipe(uglify()) 56 | .on('error', function (err) { 57 | console.log(err.toString()); 58 | this.emit("end"); 59 | }) 60 | .pipe(sourcemaps.write()) 61 | .pipe(gulp.dest('dist/js')) 62 | .pipe(connect.reload()); 63 | }); 64 | 65 | gulp.task('start-server', function() { 66 | connect.server({ root: 'dist', livereload: true }); 67 | }); 68 | 69 | gulp.task('watch:html', function() { 70 | gulp.watch('src/*.html', ['html']); 71 | }); 72 | 73 | gulp.task('watch:js', function() { 74 | gulp.watch('src/js/**/*.*', ['js']); 75 | }); 76 | 77 | gulp.task('compile', ['html', 'css', 'fonts', 'js']); 78 | gulp.task('watch', ['compile', 'watch:html', 'watch:js']); 79 | gulp.task('serve', ['watch', 'start-server']); 80 | gulp.task('default', ['compile']); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuejs-github-explorer-blog", 3 | "version": "1.0.0", 4 | "description": "This is the repository for the code from the blog post \"Create a Github Explorer Using Vue.js.\"", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/searsaw/vuejs-github-explorer-blog.git" 8 | }, 9 | "author": "Alex Sears", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/searsaw/vuejs-github-explorer-blog/issues" 13 | }, 14 | "homepage": "https://github.com/searsaw/vuejs-github-explorer-blog#readme", 15 | "dependencies": { 16 | "bootstrap": "^3.3.5", 17 | "vue": "^1.0.0", 18 | "vue-resource": "^0.1.16" 19 | }, 20 | "devDependencies": { 21 | "browserify": "^11.2.0", 22 | "eslint": "^1.7.3", 23 | "font-awesome": "^4.4.0", 24 | "gulp": "^3.9.0", 25 | "gulp-concat": "^2.6.0", 26 | "gulp-connect": "^2.2.0", 27 | "gulp-copy": "0.0.2", 28 | "gulp-sourcemaps": "^1.6.0", 29 | "gulp-uglify": "^1.4.2", 30 | "partialify": "^3.1.5", 31 | "vinyl-buffer": "^1.0.0", 32 | "vinyl-source-stream": "^1.1.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/css/app.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 30px; 3 | } 4 | 5 | #changeRepoForm { 6 | margin-bottom: 30px; 7 | } -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |Name | 8 |9 | |
---|---|
14 |
15 |
16 | {{ file.name }}
17 |
18 |
19 |
20 | {{ file.name }}
21 |
22 | |
23 | 24 | 25 | 26 | 27 | | 28 |