Skip to content

Commit e97685e

Browse files
committedDec 3, 2019
style: reformat all files using prettier
1 parent e913dc5 commit e97685e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+6238
-2393
lines changed
 

‎Gruntfile.js

+98-48
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
/* eslint-disable no-process-env */
22
module.exports = function(grunt) {
3-
43
grunt.initConfig({
54
pkg: grunt.file.readJSON('package.json'),
65

7-
clean: ['tmp', 'dist', 'lib/handlebars/compiler/parser.js', 'integration-testing/**/node_modules'],
6+
clean: [
7+
'tmp',
8+
'dist',
9+
'lib/handlebars/compiler/parser.js',
10+
'integration-testing/**/node_modules'
11+
],
812

913
copy: {
1014
dist: {
1115
options: {
1216
processContent: function(content) {
13-
return grunt.template.process('/**!\n\n @license\n <%= pkg.name %> v<%= pkg.version %>\n\n<%= grunt.file.read("LICENSE") %>\n*/\n')
14-
+ content;
17+
return (
18+
grunt.template.process(
19+
'/**!\n\n @license\n <%= pkg.name %> v<%= pkg.version %>\n\n<%= grunt.file.read("LICENSE") %>\n*/\n'
20+
) + content
21+
);
1522
}
1623
},
17-
files: [
18-
{expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/'}
19-
]
24+
files: [{ expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/' }]
2025
},
2126
cdnjs: {
2227
files: [
23-
{expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/cdnjs'}
28+
{ expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/cdnjs' }
2429
]
2530
},
2631
components: {
2732
files: [
28-
{expand: true, cwd: 'components/', src: ['**'], dest: 'dist/components'},
29-
{expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/components'}
33+
{
34+
expand: true,
35+
cwd: 'components/',
36+
src: ['**'],
37+
dest: 'dist/components'
38+
},
39+
{ expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/components' }
3040
]
3141
}
3242
},
@@ -41,24 +51,28 @@ module.exports = function(grunt) {
4151
options: {
4252
modules: 'amd'
4353
},
44-
files: [{
45-
expand: true,
46-
cwd: 'lib/',
47-
src: '**/!(index).js',
48-
dest: 'dist/amd/'
49-
}]
54+
files: [
55+
{
56+
expand: true,
57+
cwd: 'lib/',
58+
src: '**/!(index).js',
59+
dest: 'dist/amd/'
60+
}
61+
]
5062
},
5163

5264
cjs: {
5365
options: {
5466
modules: 'common'
5567
},
56-
files: [{
57-
cwd: 'lib/',
58-
expand: true,
59-
src: '**/!(index).js',
60-
dest: 'dist/cjs/'
61-
}]
68+
files: [
69+
{
70+
cwd: 'lib/',
71+
expand: true,
72+
src: '**/!(index).js',
73+
dest: 'dist/cjs/'
74+
}
75+
]
6276
}
6377
},
6478
webpack: {
@@ -67,7 +81,12 @@ module.exports = function(grunt) {
6781
module: {
6882
loaders: [
6983
// the optional 'runtime' transformer tells babel to require the runtime instead of inlining it.
70-
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?optional=runtime&loose=es6.modules&auxiliaryCommentBefore=istanbul%20ignore%20next' }
84+
{
85+
test: /\.jsx?$/,
86+
exclude: /node_modules/,
87+
loader:
88+
'babel-loader?optional=runtime&loose=es6.modules&auxiliaryCommentBefore=istanbul%20ignore%20next'
89+
}
7190
]
7291
},
7392
output: {
@@ -116,15 +135,17 @@ module.exports = function(grunt) {
116135
preserveComments: /(?:^!|@(?:license|preserve|cc_on))/
117136
},
118137
dist: {
119-
files: [{
120-
cwd: 'dist/',
121-
expand: true,
122-
src: ['handlebars*.js', '!*.min.js'],
123-
dest: 'dist/',
124-
rename: function(dest, src) {
125-
return dest + src.replace(/\.js$/, '.min.js');
138+
files: [
139+
{
140+
cwd: 'dist/',
141+
expand: true,
142+
src: ['handlebars*.js', '!*.min.js'],
143+
dest: 'dist/',
144+
rename: function(dest, src) {
145+
return dest + src.replace(/\.js$/, '.min.js');
146+
}
126147
}
127-
}]
148+
]
128149
}
129150
},
130151

@@ -148,28 +169,41 @@ module.exports = function(grunt) {
148169
all: {
149170
options: {
150171
build: process.env.TRAVIS_JOB_ID,
151-
urls: ['http://localhost:9999/spec/?headless=true', 'http://localhost:9999/spec/amd.html?headless=true'],
172+
urls: [
173+
'http://localhost:9999/spec/?headless=true',
174+
'http://localhost:9999/spec/amd.html?headless=true'
175+
],
152176
detailedError: true,
153177
concurrency: 4,
154178
browsers: [
155-
{browserName: 'chrome'},
156-
{browserName: 'firefox', platform: 'Linux'},
179+
{ browserName: 'chrome' },
180+
{ browserName: 'firefox', platform: 'Linux' },
157181
// {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
158182
// {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
159-
{browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
160-
{browserName: 'internet explorer', version: 10, platform: 'Windows 8'}
183+
{
184+
browserName: 'internet explorer',
185+
version: 11,
186+
platform: 'Windows 8.1'
187+
},
188+
{
189+
browserName: 'internet explorer',
190+
version: 10,
191+
platform: 'Windows 8'
192+
}
161193
]
162194
}
163195
},
164196
sanity: {
165197
options: {
166198
build: process.env.TRAVIS_JOB_ID,
167-
urls: ['http://localhost:9999/spec/umd.html?headless=true', 'http://localhost:9999/spec/amd-runtime.html?headless=true', 'http://localhost:9999/spec/umd-runtime.html?headless=true'],
199+
urls: [
200+
'http://localhost:9999/spec/umd.html?headless=true',
201+
'http://localhost:9999/spec/amd-runtime.html?headless=true',
202+
'http://localhost:9999/spec/umd-runtime.html?headless=true'
203+
],
168204
detailedError: true,
169205
concurrency: 2,
170-
browsers: [
171-
{browserName: 'chrome'}
172-
]
206+
browsers: [{ browserName: 'chrome' }]
173207
}
174208
}
175209
},
@@ -180,7 +214,6 @@ module.exports = function(grunt) {
180214
bg: false,
181215
fail: true
182216
}
183-
184217
},
185218

186219
watch: {
@@ -211,9 +244,9 @@ module.exports = function(grunt) {
211244
grunt.task.loadTasks('tasks');
212245

213246
this.registerTask(
214-
'build',
215-
'Builds a distributable version of the current project',
216-
['parser', 'node', 'globals']
247+
'build',
248+
'Builds a distributable version of the current project',
249+
['parser', 'node', 'globals']
217250
);
218251

219252
this.registerTask('node', ['babel:cjs']);
@@ -231,13 +264,30 @@ module.exports = function(grunt) {
231264
this.registerTask('amd', ['babel:amd', 'requirejs']);
232265

233266
grunt.registerTask('bench', ['metrics']);
234-
grunt.registerTask('sauce', process.env.SAUCE_USERNAME ? ['tests', 'connect', 'saucelabs-mocha'] : []);
267+
grunt.registerTask(
268+
'sauce',
269+
process.env.SAUCE_USERNAME ? ['tests', 'connect', 'saucelabs-mocha'] : []
270+
);
235271
// Requires secret properties (saucelabs-credentials etc.) from .travis.yaml
236-
grunt.registerTask('extensive-tests-and-publish-to-aws', ['default', 'bgShell:integrationTests', 'sauce', 'metrics', 'publish:latest']);
237-
grunt.registerTask('on-file-change', ['build', 'amd', 'concat:tests', 'test']);
272+
grunt.registerTask('extensive-tests-and-publish-to-aws', [
273+
'default',
274+
'bgShell:integrationTests',
275+
'sauce',
276+
'metrics',
277+
'publish:latest'
278+
]);
279+
grunt.registerTask('on-file-change', [
280+
'build',
281+
'amd',
282+
'concat:tests',
283+
'test'
284+
]);
238285

239286
// === Primary tasks ===
240287
grunt.registerTask('dev', ['clean', 'connect', 'watch']);
241288
grunt.registerTask('default', ['clean', 'build', 'test', 'release']);
242-
grunt.registerTask('integration-tests', ['default', 'bgShell:integrationTests']);
289+
grunt.registerTask('integration-tests', [
290+
'default',
291+
'bgShell:integrationTests'
292+
]);
243293
};

‎bench/dist-size.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
var async = require('neo-async'),
2-
fs = require('fs'),
3-
zlib = require('zlib');
2+
fs = require('fs'),
3+
zlib = require('zlib');
44

55
module.exports = function(grunt, callback) {
66
var distFiles = fs.readdirSync('dist'),
7-
distSizes = {};
7+
distSizes = {};
88

9-
async.each(distFiles, function(file, callback) {
9+
async.each(
10+
distFiles,
11+
function(file, callback) {
1012
var content;
1113
try {
1214
content = fs.readFileSync('dist/' + file);
@@ -32,7 +34,10 @@ module.exports = function(grunt, callback) {
3234
});
3335
},
3436
function() {
35-
grunt.log.writeln('Distribution sizes: ' + JSON.stringify(distSizes, undefined, 2));
37+
grunt.log.writeln(
38+
'Distribution sizes: ' + JSON.stringify(distSizes, undefined, 2)
39+
);
3640
callback([distSizes]);
37-
});
41+
}
42+
);
3843
};

0 commit comments

Comments
 (0)
Please sign in to comment.