Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
bower_components
.tmp/
**.mo
.idea/**
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
sudo: false
language: python
python:
- 2.7
- 2.7
node_js:
- "6.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should bump this to 6.9.5

cache: pip
before_install:
- nvm install 6.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.9.5

install:
- npm install -g gulp
- npm install -g bower
- pip install grow
- nvm use 6.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.9.5

- npm install -g gulp
- npm install -g bower
- pip install grow
script:
- grow install
- grow build
- grow install
- grow build
9 changes: 3 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"name": "scaffold",
"private": true,
"dependencies": {
"angular": "1.5.7"
},
"devDependencies": {
"closure-compiler": "http://dl.google.com/closure-compiler/compiler-latest.zip",
"closure-library": "git://github.com/google/closure-library.git",
"closure-compiler-src": "git://github.com/google/closure-compiler.git"
"closure-compiler": "http://dl.google.com/closure-compiler/compiler-20170124.zip",
"closure-library": "git://github.com/google/closure-library.git#68284ff",
"closure-compiler-src": "git://github.com/google/closure-compiler.git#7eb7513"
}
}
3 changes: 3 additions & 0 deletions content/pages/_blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ view: /views/base.html

localization:
path: /intl/{locale}/{base}/

title@: Grow Scaffold
description@: Grow Scaffold theme with Google modules
38 changes: 30 additions & 8 deletions content/pages/another.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
---
$title@: Another Page
---
# {{_('Another page.')}}
----
$title@: Home
path: /another/

Unlike the first page, this page is Markdown-formatted.
$localization:
path: /intl/{locale}/{base}
hero:
title@: Hello World!
subtitle@: Lorem ipsum dolor sit amet.
ctas:
- title@: Callout 1
subtitle@: Description 1.
- title@: Callout 2
subtitle@: Description 2.
- title@: Callout 3
subtitle@: Description 3.
----
<h1>{{_(doc.hero.title)}}</h1>
<p>{{_(doc.hero.subtitle)}}</p>

1. Which means
1. you can
1. use Markdown-formatted lists.
<div ng-controller="MainController as ctrl">
<form ng-submit="ctrl.sayHello(ctrl.text)">
<input type="text" ng-model="ctrl.text">
<button type="submit">{{_('Say Hello')}}</button>
</form>
</div>

<ul>
{% for cta in doc.ctas %}
<li><b>{{_(cta.title)}}:</b> {{_(cta.subtitle)}}
{% endfor %}
</ul>
33 changes: 0 additions & 33 deletions content/pages/home.html

This file was deleted.

6 changes: 6 additions & 0 deletions content/pages/home.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$title@: Home
$path: /
$view: /views/pages/home.html

$localization:
path: /intl/{locale}/
3 changes: 0 additions & 3 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ module.exports = {
JS_TEMP_DIR: './.tmp/',
JS_SOURCES: './source/js/**/*.js',
BOWER_FOLDER: './bower_components/',
CLOSURE_EXTERNS: [
'./bower_components/closure-compiler-src/externs/browser/**/*.js'
]
}
}
90 changes: 41 additions & 49 deletions gulp/tasks/scripts.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,53 @@
'use strict'
var gulp = require('gulp');
var runSequence = require('run-sequence');
var filenames = require('gulp-filenames');
var concat = require('gulp-concat');
var closureCompiler = require('gulp-closure-compiler');
var uglify = require('gulp-uglify');
var config = require('../config');
'use strict';

const gulp = require('gulp');
const runSequence = require('run-sequence');
const concat = require('gulp-concat');
const closureCompiler = require('gulp-closure-compiler');
const argv = require('yargs').argv;
const rimraf = require('rimraf');
const uglify = require('gulp-uglify');
const config = require('../config');

const ENV_PRODUCTION = argv.env == 'PROD';

gulp.task('compile_js', function() {
var closureOpts = {
compilerPath: './bower_components/closure-compiler/compiler.jar',

const OPT_LEVEL = ENV_PRODUCTION ?
'ADVANCED_OPTIMIZATIONS' :
'SIMPLE_OPTIMIZATIONS';

const closureOpts = {
compilerPath: './bower_components/closure-compiler/closure-compiler-v20170124.jar',
compilerFlags: {
angular_pass: true,
closure_entry_point: 'scaffold',
compilation_level: 'SIMPLE_OPTIMIZATIONS',
generate_exports: true,
manage_closure_dependencies: true,
only_closure_dependencies: true,
output_wrapper: '(function(){%output%})();',
js: [
'./bower_components/closure-library/closure/**.js',
'./bower_components/closure-library/third_party/**.js',
'!**_test.js'
]
angular_pass: true,
closure_entry_point: 'goog:app.bootstrap',
compilation_level: OPT_LEVEL,
output_wrapper: '(function(){%output%})();',
generate_exports: true,
export_local_property_definitions: true,
js: [
'./bower_components/closure-library/closure/goog/base.js',
'!**_test.js',
'!**_spec.js'
],
externs: [
'./bower_components/closure-compiler-src/contrib/externs/angular-1.6*.js'
]
},
maxBuffer: 800000, // Set maxBuffer to .8GB
fileName: 'build.min.js'
maxBuffer: 800000, // .8GB
fileName: 'main.min.js'
};

var externs = [];
externs.concat(filenames.get('closure_externs'));

closureOpts.compilerFlags.externs = externs

return gulp.src(config.Path.JS_SOURCES)
return gulp
.src(config.Path.JS_SOURCES)
.pipe(closureCompiler(closureOpts))
.pipe(gulp.dest(config.Path.JS_TEMP_DIR))
});

gulp.task('minify_js', function() {
return gulp.src([
config.Path.JS_TEMP_DIR + 'build.min.js'
])
.pipe(concat('main.min.js'))
.pipe(uglify())
.pipe(gulp.dest(config.Path.JS_OUT_DIR));
});

gulp.task('build_js', function(callback) {
return runSequence(
'get_closure_externs_paths',
'compile_js',
'minify_js',
callback);
});

gulp.task('get_closure_externs_paths', function() {
return gulp.src(config.Path.CLOSURE_EXTERNS)
.pipe(filenames('closure_externs'))
gulp.task('clean', function(callback) {
rimraf('./build', callback);
})

gulp.task('build_js', ['compile_js']);
19 changes: 10 additions & 9 deletions gulp/tasks/styles.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
'use strict'
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var plumber = require('gulp-plumber');
var sass = require('gulp-sass');
var config = require('../config');
'use strict';

const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const plumber = require('gulp-plumber');
const sass = require('gulp-sass');
const csso = require('gulp-csso');
const config = require('../config');

gulp.task('sass', function() {
return gulp.src(config.Path.CSS_SOURCES)
.pipe(plumber())
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(sass())
.pipe(autoprefixer())
.pipe(csso())
.pipe(gulp.dest(config.Path.CSS_OUT_DIR));
});
5 changes: 3 additions & 2 deletions gulp/tasks/watch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
var gulp = require('gulp');
var config = require('../config');

const gulp = require('gulp');
const config = require('../config');

gulp.task('watch', function() {
gulp.watch([config.Path.CSS_SOURCES], ['sass']);
Expand Down
15 changes: 10 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
var fs = require('fs');
var gulp = require('gulp');
const fs = require('fs');
const gulp = require('gulp');
const runSequence = require('run-sequence');
const argv = require('yargs').argv;


/**
* This will load all js or coffee files in the gulp directory
* This will load all js files in the gulp directory
* in order to load all gulp tasks
*/
fs.readdirSync('./gulp/tasks').filter(function(file) {
return (/\.(js|coffee)$/i).test(file);
return (/\.js$/i).test(file);
}).map(function(file) {
require('./gulp/tasks/' + file);
});

gulp.task('build', ['build_js', 'sass']);
gulp.task('build', function(callback){
runSequence('clean', ['build_js', 'sass'], callback)
});
gulp.task('default', ['build', 'watch']);
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"name": "scaffold",
"private": true,
"engines": {
"node": "^6.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.9.5

},
"devDependencies": {
"bower": "^1.3.12",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a personal preference, but I'd pin versions

"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.1.0",
"gulp-closure-compiler": "^0.2.17",
"gulp-concat": "^2.5.2",
"gulp-filenames": "^2.0.0",
"gulp-csso": "^2.0.0",
"gulp-plumber": "^1.0.0",
"gulp-sass": "^2.1.1",
"gulp-uglify": "^1.2.0",
"run-sequence": "^1.0.2"
"gulp-uglify": "^2.0.1",
"rimraf": "^2.6.0",
"run-sequence": "^1.0.2",
"yargs": "^6.6.0"
}
}
9 changes: 5 additions & 4 deletions podspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
grow_version: ">=0.0.60"
grow_version: ">=0.0.67"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.2.0?


localization:
default_locale: en_US
locales:
- de_DE
- en_US
- ja_JP
- en_US
- ja_JP

static_dirs:
- static_dir: /source/images/
Expand All @@ -15,3 +14,5 @@ static_dirs:

preprocessors:
- kind: gulp
build_task: "build --env=PROD"
run_task: "default --env=DEV"
18 changes: 0 additions & 18 deletions source/js/demo_controller.js

This file was deleted.

11 changes: 0 additions & 11 deletions source/js/main.js

This file was deleted.

Loading