Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Lee committed May 11, 2018
1 parent 6821ee8 commit 1020035
Show file tree
Hide file tree
Showing 39 changed files with 14,258 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"env"
]
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[{*.json,*.yml,.babelrc,.bowerrc,.postcssrc}]
indent_style = space
indent_size = 2

[*.txt,wp-config-sample.php]
end_of_line = crlf
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"yoda": [ 2 ],
"indent": [ 2, "tab", { "SwitchCase": 2 } ],
"linebreak-style": [ 2, "unix" ],
"quotes": [ 2, "single" ],
"semi": [ 2, "always" ],
"space-in-parens": [ 2, "always" ],
"no-console": [ 1 ],
"no-alert": [ 1 ],
"camelcase": [ 2 ]
}
}
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
node_modules
bower_components
release
vendor
composer.lock
phpunit.xml
.idea

# Project Files
dist

# Editors
*.esproj
*.tmproj
*.tmproject
tmtags
.*.sw[a-z]
*.un~
Session.vim
*.swp

# Mac OSX
.DS_Store
._*
.Spotlight-V100
.Trashes

# Windows
Thumbs.db
Desktop.ini
3 changes: 3 additions & 0 deletions assets/css/admin/admin-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* TenupAutoTweet - Admin Styles
*/
1 change: 1 addition & 0 deletions assets/css/frontend/base/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file.
3 changes: 3 additions & 0 deletions assets/css/frontend/editor-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* TenupAutoTweet - Editor Styles
*/
Empty file.
Empty file.
19 changes: 19 additions & 0 deletions assets/css/frontend/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* TenupAutoTweet
*/

/* Global - global pieces like media queries, mixins and placholders */
@import url("global/index");

/* Base - base styles such as fonts, typography, and wordpress overrides */
/* as well as some global micro-elements like icons */
@import url("base/index");

/* Layout - styles specific to layout */
@import url("layout/index");

/* Templates */
@import url("templates/index");

/* Components */
@import url("components/index");
Empty file.
3 changes: 3 additions & 0 deletions assets/css/shared/shared-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* TenupAutoTweet: Shared Styles
*/
1 change: 1 addition & 0 deletions assets/fonts/font-name/weight/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Basically just want to ignore the directory contents
1 change: 1 addition & 0 deletions assets/images/src/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Basically just want to ignore the directory contents
1 change: 1 addition & 0 deletions assets/js/admin/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//import foo from './bar'
1 change: 1 addition & 0 deletions assets/js/frontend/components/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Basically just want to ignore the directory contents
1 change: 1 addition & 0 deletions assets/js/frontend/frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// import foo from './components/bar';
1 change: 1 addition & 0 deletions assets/js/shared/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//import foo from './bar'
1 change: 1 addition & 0 deletions assets/svg/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Basically just want to ignore the directory contents
22 changes: 22 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "10up/tenup-auto-tweet",
"description": "Tenup Auto Tweet",
"authors": [
{
"name": "Author",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.0",
"abraham/twitteroauth": "^0.7.4"
},
"autoload": {
"psr-4": {
"TenupAutoTweet\\": "includes/classes/"
}
},
"require-dev": {
"10up/wp_mock": "dev-dev"
}
}
6 changes: 6 additions & 0 deletions gulp-tasks/cssclean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import gulp from 'gulp';
import del from 'del';

gulp.task( 'cssclean', () => {
del( ['./dist/*.css'] );
} );
37 changes: 37 additions & 0 deletions gulp-tasks/cssnano.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import gulp from 'gulp';
import cssnano from 'gulp-cssnano';
import rename from 'gulp-rename';
import sourcemaps from 'gulp-sourcemaps';
import pump from 'pump';
import livereload from 'gulp-livereload';
import filter from 'gulp-filter';

gulp.task( 'cssnano', ( cb ) => {
const fileDest = './dist/css',
fileSrc = [
'./dist/*.css'
],
taskOpts = [cssnano( {
autoprefixer: false,
calc: {
precision: 8
},
zindex: false,
convertValues: true
} )];

pump( [
gulp.src( fileSrc ),
sourcemaps.init( {
loadMaps: true
} ),
cssnano( taskOpts ),
rename( function( path ) {
path.extname = '.min.css';
} ),
sourcemaps.write( './' ),
gulp.dest( fileDest ),
filter( '**/*.css' ),
livereload()
], cb );
} );
39 changes: 39 additions & 0 deletions gulp-tasks/cssnext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import gulp from 'gulp';
import postcss from 'gulp-postcss';
import sourcemaps from 'gulp-sourcemaps';
import pump from 'pump';

gulp.task( 'cssnext', ( cb ) => {
const fileSrc = [
'./assets/css/admin/admin-style.css',
'./assets/css/frontend/editor-style.css',
'./assets/css/frontend/style.css',
'./assets/css/shared/shared-style.css'
];
const fileDest = './dist';
const cssNextOpts = {
features: {
autoprefixer: {
browsers: ['last 2 versions']
}
}
};
const taskOpts = [
require( 'postcss-import' ),
require( 'postcss-cssnext' )( cssNextOpts )
];

pump( [
gulp.src( fileSrc ),
sourcemaps.init( {
loadMaps: true
} ),
postcss( taskOpts ),
sourcemaps.write( './css', {
mapFile: function( mapFilePath ) {
return mapFilePath.replace( '.css.map', '.min.css.map' );
}
} ),
gulp.dest( fileDest )
], cb );
} );
21 changes: 21 additions & 0 deletions gulp-tasks/webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import gulp from 'gulp';
import pump from 'pump';
import webpack from 'webpack';
import webpackStream from 'webpack-stream';
import livereload from 'gulp-livereload';

function processWebpack( src, conf, dest, cb ) {
pump( [
gulp.src( src ),
webpackStream( require( conf ), webpack ),
gulp.dest( dest ),
livereload()
], cb );
}

gulp.task( 'webpack', () => {
const src = '../assets/js/**/*.js';
const conf = '../webpack.config.babel.js';
const dest = './dist/js';
processWebpack( src, conf, dest );
} );
33 changes: 33 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import gulp from 'gulp';
import requireDir from 'require-dir';
import runSequence from 'run-sequence';
import livereload from 'gulp-livereload';

requireDir( './gulp-tasks' );

gulp.task( 'js', () => {
runSequence(
'webpack',
);
} );

gulp.task( 'css', () => {
runSequence(
'cssnext',
'cssnano',
'cssclean'
);
} );

gulp.task( 'watch', () => {
livereload.listen( { basePath: 'dist' } );
gulp.watch( ['./assets/css/**/*.css', '!./assets/css/src/**/*.css'], ['css'] );
gulp.watch( './assets/js/**/*.js', ['js'] );
} );

gulp.task( 'default', () => {
runSequence(
'css',
'webpack'
);
} );
Empty file added includes/classes/.gitkeep
Empty file.
Loading

0 comments on commit 1020035

Please sign in to comment.