Skip to content

Commit

Permalink
Add semi at the end of dist file
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinH committed Nov 30, 2017
1 parent ef63177 commit 087a4ad
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 130 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 6.4.2 (2017-11-30)
## Bug fix
- Add a semicolon at the end of the `dist/rzslider.js` file. It avoids errors when people concat this file with other libs without using the minified version.

# 6.4.1 (2017-11-17)
## Bug fix
- Options: react to changes of options of Function type (#590)
Expand Down
179 changes: 100 additions & 79 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
module.exports = function(grunt) {
var banner = '/*! <%= pkg.name %> - v<%= pkg.version %> - \n' +
var banner =
'/*! <%= pkg.name %> - v<%= pkg.version %> - \n' +
' (c) <%= pkg.author %> - \n' +
' <%= pkg.repository.url %> - \n' +
' <%= grunt.template.today("yyyy-mm-dd") %> */\n',
minBanner = banner.replace(/\n/g, '') + '\n';
minBanner = banner.replace(/\n/g, '') + '\n'

// Project configuration.
grunt.initConfig({

pkg: grunt.file.readJSON('package.json'),

minBanner: minBanner,

recess: {
options: {
compile: true
compile: true,
},

slider: {
src: ['src/rzslider.less'],
dest: 'dist/rzslider.css'
dest: 'dist/rzslider.css',
},

min: {
options: {
compress: true,
banner: '<%= minBanner %>'
banner: '<%= minBanner %>',
},
src: ['dist/rzslider.css'],
dest: 'dist/rzslider.min.css'
}
dest: 'dist/rzslider.min.css',
},
},

uglify: {
options: {
report: 'min',
banner: '<%= minBanner %>'
banner: '<%= minBanner %>',
},
rzslider: {
files: {
'dist/rzslider.min.js': [
'dist/rzslider.js'
]
}
}
'dist/rzslider.min.js': ['dist/rzslider.js'],
},
},
},

ngtemplates: {
Expand All @@ -59,133 +57,156 @@ module.exports = function(grunt) {
removeEmptyAttributes: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
removeStyleLinkTypeAttributes: true,
},
module: 'rzModule',
url: function(url) {
return url.replace('src/', '');
return url.replace('src/', '')
},
bootstrap: function(module, script) {
return 'module.run(function($templateCache) {\n' + script + '\n});';
}
}
}
return 'module.run(function($templateCache) {\n' + script + '\n});'
},
},
},
},

replace: {
dist: {
options: {
patterns: [{
match: /\/\*templateReplacement\*\//,
replacement: '<%= grunt.file.read("temp/templates.js") %>'
}]
patterns: [
{
match: /\/\*templateReplacement\*\//,
replacement: '<%= grunt.file.read("temp/templates.js") %>',
},
],
},
files: [{
expand: true,
flatten: true,
src: ['src/rzslider.js', 'rzslider.d.ts'],
dest: 'dist/'
}]
}
files: [
{
expand: true,
flatten: true,
src: ['src/rzslider.js', 'rzslider.d.ts'],
dest: 'dist/',
},
],
},
},

concat: {
options: {
stripBanners: true,
banner: banner
banner: banner,
footer: ';', // to prevent error when people concat the file and don't use the min version
},
js: {
src: ['dist/rzslider.js'],
dest: 'dist/rzslider.js'
dest: 'dist/rzslider.js',
},
css: {
src: ['dist/rzslider.css'],
dest: 'dist/rzslider.css'
}
dest: 'dist/rzslider.css',
},
},

ngAnnotate: {
options: {
singleQuotes: true
singleQuotes: true,
},
rzslider: {
files: [{
'dist/rzslider.js': 'dist/rzslider.js'
}, {
expand: true,
src: ['dist/rzslider.js']
}]
}
files: [
{
'dist/rzslider.js': 'dist/rzslider.js',
},
{
expand: true,
src: ['dist/rzslider.js'],
},
],
},
},
watch: {
all: {
files: ['dist/*', 'demo/*'],
options: {
livereload: true
}
livereload: true,
},
},
js: {
files: ['src/*.js', 'src/*.html'],
tasks: ['js']
tasks: ['js'],
},
less: {
files: ['src/*.less'],
tasks: ['css']
tasks: ['css'],
},
test: {
files: ['src/*.js', 'tests/specs/**/*.js'],
tasks: ['test']
}
tasks: ['test'],
},
},
serve: {
options: {
port: 9000
}
port: 9000,
},
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
singleRun: true,
},
},

copy: {
copyToSass: {
files: [
{expand: false, src: ['dist/rzslider.css'], dest: 'dist/rzslider.scss'},
]
}
{
expand: false,
src: ['dist/rzslider.css'],
dest: 'dist/rzslider.scss',
},
],
},
},
postcss: {
options: {
map: true,
processors: [
require('autoprefixer')({
browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']
})
]
browsers: ['> 1%', 'last 2 versions', 'Firefox ESR'],
}),
],
},
dist: {
src: 'dist/rzslider.css'
}
}
});
src: 'dist/rzslider.css',
},
},
})

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-ng-annotate');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-serve');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-recess')
grunt.loadNpmTasks('grunt-angular-templates')
grunt.loadNpmTasks('grunt-replace')
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-ng-annotate')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-serve')
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-postcss')

grunt.registerTask('default', ['css', 'js']);
grunt.registerTask('test', ['karma']);
grunt.registerTask('default', ['css', 'js'])
grunt.registerTask('test', ['karma'])

grunt.registerTask('css', ['recess', 'concat:css', 'postcss:dist', 'copy:copyToSass']);
grunt.registerTask('js', ['ngtemplates', 'replace', 'concat:js', 'ngAnnotate', 'uglify']);
};
grunt.registerTask('css', [
'recess',
'concat:css',
'postcss:dist',
'copy:copyToSass',
])
grunt.registerTask('js', [
'ngtemplates',
'replace',
'concat:js',
'ngAnnotate',
'uglify',
])
}
20 changes: 4 additions & 16 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
{
"name": "angularjs-slider",
"version": "6.4.0",
"version": "6.4.2",
"homepage": "https://github.com/angular-slider/angularjs-slider",
"authors": [
"Rafal Zajac <[email protected]>",
"Valentin Hervieu <[email protected]>",
"Jussi Saarivirta <[email protected]>"
],
"description": "AngularJS slider directive with no external dependencies. Mobile friendly!",
"main": [
"dist/rzslider.js",
"dist/rzslider.css"
],
"keywords": [
"angularjs",
"slider"
],
"main": ["dist/rzslider.js", "dist/rzslider.css"],
"keywords": ["angularjs", "slider"],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"ignore": ["**/.*", "node_modules", "bower_components", "test", "tests"],
"devDependencies": {
"angular": "~1.4.0"
}
Expand Down
6 changes: 3 additions & 3 deletions dist/rzslider.css

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions dist/rzslider.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! angularjs-slider - v6.4.1 -
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> -
https://github.com/angular-slider/angularjs-slider -
2017-11-17 */
2017-11-30 */
/*jslint unparam: true */
/*global angular: false, console: false, define, module */
;(function(root, factory) {
Expand Down Expand Up @@ -404,16 +404,16 @@

// Watchers (order is important because in case of simultaneous change,
// watchers will be called in the same order)
this.scope.$watchCollection(
'rzSliderOptions()',
function(newValue, oldValue) {
if (newValue === oldValue) return
self.applyOptions() // need to be called before synchronizing the values
self.syncLowValue()
if (self.range) self.syncHighValue()
self.resetSlider()
}
)
this.scope.$watchCollection('rzSliderOptions()', function(
newValue,
oldValue
) {
if (newValue === oldValue) return
self.applyOptions() // need to be called before synchronizing the values
self.syncLowValue()
if (self.range) self.syncHighValue()
self.resetSlider()
})

this.scope.$watch('rzSliderModel', function(newValue, oldValue) {
if (self.internalChange) return
Expand Down Expand Up @@ -2660,3 +2660,4 @@

return module.name
})
;
2 changes: 1 addition & 1 deletion dist/rzslider.min.css

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

2 changes: 1 addition & 1 deletion dist/rzslider.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 087a4ad

Please sign in to comment.