Browse Source

refactor source code layout

master
f0x 2 months ago
parent
commit
0e3460ab49

+ 6
- 6
gulpfile.js View File

@@ -15,7 +15,7 @@ const sourcemaps = require('gulp-sourcemaps')
15 15
 const budo = require('budo')
16 16
 const babelify = require('babelify')
17 17
 
18
-const cssFiles = 'public/scss/**/*.?(s)css'
18
+const cssFiles = 'src/scss/**/*.?(s)css'
19 19
 
20 20
 let css = gulp.src(cssFiles)
21 21
     .pipe(sass())
@@ -23,7 +23,7 @@ let css = gulp.src(cssFiles)
23 23
     .pipe(gulp.dest('build'))
24 24
 
25 25
 gulp.task('watch', function(cb) {
26
-  budo("app.js", {
26
+  budo("src/app.js", {
27 27
     live: true,
28 28
     dir: "build",
29 29
     port: 3000,
@@ -47,7 +47,7 @@ gulp.task("sass", function() {
47 47
 })
48 48
 
49 49
 gulp.task("assets", function() {
50
-  return gulp.src(["public/**/*", "!public/scss", "!public/scss/**/*"])
50
+  return gulp.src(["src/assets/**/*"])
51 51
     .pipe(gulpIf('*.+(png|jpg|jpeg|gif|svg)',
52 52
       cache(imagemin({
53 53
         interlaced: true
@@ -57,7 +57,7 @@ gulp.task("assets", function() {
57 57
 })
58 58
 
59 59
 gulp.task('js', function() {
60
-  return gulp.src(['app.js', "components/**/*"])
60
+  return gulp.src(['src/app.js', "src/components/**/*"])
61 61
     .pipe(babel({
62 62
       presets: [
63 63
         ['@babel/env', {
@@ -70,14 +70,14 @@ gulp.task('js', function() {
70 70
 
71 71
 gulp.task('js', function() {
72 72
   let b = browserify({
73
-    entries: 'app.js',
73
+    entries: 'src/app.js',
74 74
     debug: false,
75 75
     transform: [babelify.configure({
76 76
       presets: ['@babel/preset-env', '@babel/preset-react']
77 77
     })]
78 78
   })
79 79
   return b.bundle()
80
-    .pipe(source('app.js'))
80
+    .pipe(source('src/app.js'))
81 81
     .pipe(buffer())
82 82
     .pipe(sourcemaps.init({ loadMaps: true }))
83 83
     .pipe(gulp.dest('build'))

app.js → src/app.js View File

@@ -15,8 +15,6 @@ const Chat = require('./components/chat.js')
15 15
 // avatar tilt
16 16
 // incoming/outgoing message alignment (split)
17 17
 
18
-
19
-
20 18
 let App = create({
21 19
   displayName: "App",
22 20
 

public/OpenSans-Bold.ttf → src/assets/OpenSans-Bold.ttf View File


public/OpenSans-Regular.ttf → src/assets/OpenSans-Regular.ttf View File


public/font-license.txt → src/assets/font-license.txt View File


public/icons/file.svg → src/assets/icons/file.svg View File


public/index.html → src/assets/index.html View File


public/neo.png → src/assets/neo.png View File


components/Login.js → src/components/Login.js View File


components/chat.js → src/components/chat.js View File


components/events/Event.js → src/components/events/Event.js View File


components/events/image.js → src/components/events/image.js View File


components/events/state.js → src/components/events/state.js View File


components/events/text.js → src/components/events/text.js View File


components/events/user.js → src/components/events/user.js View File


components/events/video.js → src/components/events/video.js View File


components/fileUpload.js → src/components/fileUpload.js View File


components/filterList.js → src/components/filterList.js View File


components/info.js → src/components/info.js View File


components/input.js → src/components/input.js View File


components/loading.js → src/components/loading.js View File


components/sidebar.js → src/components/sidebar.js View File


lib/media.js → src/lib/media.js View File


lib/riot-utils.js → src/lib/riot-utils.js View File


public/scss/style.scss → src/scss/style.scss View File


Loading…
Cancel
Save