Skip to content

Commit 3df3a6e

Browse files
committed
Merge branch 'feature/2.0.0'
2 parents 49fd822 + 00ba802 commit 3df3a6e

31 files changed

+2072
-792
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,10 @@ results
1818
npm-debug.log
1919
node_modules
2020

21+
**/lodash.js
22+
dist
23+
tests/pages/*.js
24+
tags/tag.min.js
25+
2126
# creds for Grunt
2227
aws.json

.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ script: node node_modules/intern/runner.js config=tests/intern
44
language: node_js
55
before_script:
66
- npm install -g grunt-cli
7-
script: grunt travis
7+
script: grunt travis
8+
env:
9+
global:
10+
- secure: "Ort7jy0HpYi0EGfuRYGW4tawmVJzfUUNXhtJEOWR09FYL28XUyxvjUnpS1WZlD0/rBZiuDPBep1Tc81F88pSns4ZAg1lxlM/zheWrCKvYudeAia2g06OqOA1JfeVWX7TjemJ5s1lY66b5VQrDG1QLIO1RPjgWWea0MpSQzv00Ms="
11+
- secure: "JFprkMXxrQZhRlYvJb+ZOr540QuzMU2jQtf39oPzg8uqcV5TDDWTuUZ6D3ogyNJnzH0mYDRzHZQEAqxkyjfndpIgN+a+dBM1l4WoKrTR9BpA3ZZD6zFEG7UrHBcvZgvopbY1wMPXbn4JL7J7SPPOjvvrjjIk/QIsTUYft/UOyXI="

CHANGELOG

+39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
Version 2.0.0 (2014-07-03)
2+
--------------------------
3+
Moved fixUpUrl into its own file, called lib/proxies.js (#112)
4+
Fixed duplication of querystring parameter lookup (#111)
5+
Added tests for helpers.js (#96)
6+
Added tests for detectors.js (#95)
7+
Replaced cookie.js with browser-cookie-lite (#88)
8+
Added ad conversion tracking (#60)
9+
Added ad click tracking (#59)
10+
Added initial localStorage support for intermittent offline beacons, thanks @rcs! (#24)
11+
Added new trackAdImpression, mapping to unstructured event (#13)
12+
Removed references to referral cookie (#118)
13+
Implemented enableLinkTracking support (#51)
14+
Replaced hard-coded version with template value (#120)
15+
Added Sauce Labs small button at top of README (#123)
16+
Added Sauce full test summary widget (long bar) at bottom of README (#124)
17+
Added support for namespacing (#4)
18+
Passed tracker namespace through to collector in Tracker Protocol (#126)
19+
Moved to argmap-style tracker creation with 'newTracker' (#132)
20+
Added support for cookie namespacing (#131)
21+
Added new tag which allows queue to be renamed (#130)
22+
Started rigorously checking whether a page is cached by Yahoo (#142)
23+
Upgraded Intern to 1.5.0 (#119)
24+
Fixed link to code climate button in README.md (#149)
25+
Added examples of tracker namespacing (#159)
26+
Split async.html into async-small.html, async-medium.html (#160)
27+
Linked the Technical Docs and Setup Guide images to the appropriate pages (#164)
28+
Made JS invocation tag part of the build process (#158)
29+
Fixed warnings generated by the Closure Compiler, thanks @steve-gh! (#170)
30+
Added untracked files which should be ignored to .gitignore (#173)
31+
Removed ads/sync.html (#182)
32+
Updated ads/async.html (#183)
33+
Added pageUnloadTimer option to argmap (#171)
34+
Added event vendor as argument to trackUnstructEvent (#157)
35+
Removed type hints from unstructured events and custom contexts (#163)
36+
Added hardcoded schema to custom context arrays (#199)
37+
Added hardcoded schema to unstructured events (#196)
38+
Changed trackUnstructEvent to take a JSON containing schema and data fields (#197)
39+
140
Version 1.0.3 (2014-06-27)
241
--------------------------
342
Changed Base64 encoding function to prevent character encoding errors, thanks @shermozle! (#231)

Gruntfile.js

+52-15
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function(grunt) {
4545
" *\n" +
4646
" * @description <%= pkg.description %>\n" +
4747
" * @version <%= pkg.version %>\n" +
48-
" * @author <%= pkg.contributors %>\n" +
48+
" * @author " + pkg.contributors.join(', ') +"\n" +
4949
" * @copyright Anthon Pang, Snowplow Analytics Ltd\n" +
5050
" * @license <%= pkg.license %>\n" +
5151
" */\n\n" +
@@ -79,32 +79,45 @@ module.exports = function(grunt) {
7979

8080
lodash: {
8181
build: {
82-
dest: 'src/js/lib/lodash.js',
82+
dest: 'src/js/lib_managed/lodash.js',
8383
options: {
8484
exports: 'node',
85-
include: 'isArray, isFunction, isString, isObject, isDate, isUndefined, isNull',
85+
include: 'isArray, isFunction, isString, isObject, isDate, isUndefined, isNull, map, compact, isEmpty',
8686
flags: ['debug']
8787
}
8888
}
8989
},
9090

9191
browserify: {
92-
dist: {
92+
main: {
9393
files: {
9494
'dist/bundle.js': ['src/js/init.js']
9595
}
96+
},
97+
test: {
98+
files: {
99+
'tests/pages/helpers.js': ['tests/scripts/helpers.js'],
100+
'tests/pages/detectors.js': ['tests/scripts/detectors.js']
101+
}
96102
}
97103
},
98104

99105
concat: {
100106
dist: {
101107
options: {
102108
'report': 'gzip',
103-
'banner': '<%= banner %>'
109+
'banner': '<%= banner %>',
110+
'process': true
104111
},
105112
src: ['dist/bundle.js'],
106-
107113
dest: 'dist/snowplow.js'
114+
},
115+
tag: {
116+
options: {
117+
banner: ';'
118+
},
119+
src: ['tags/tag.min.js'],
120+
dest: 'tags/tag.min.js'
108121
}
109122
},
110123

@@ -116,18 +129,41 @@ module.exports = function(grunt) {
116129
},
117130
files: [
118131
{
119-
src: 'dist/snowplow.js',
120-
dest: 'dist/sp.js'
132+
src: 'dist/snowplow.js',
133+
dest: 'dist/sp.js'
134+
}
135+
]
136+
},
137+
tag: {
138+
options: {
139+
linebreak: 80
140+
},
141+
files: [
142+
{
143+
src: 'tags/tag.js',
144+
dest: 'tags/tag.min.js'
121145
}
122146
]
123147
}
124148
},
125149

126150
intern: {
127-
tests: {
151+
nonfunctional: {
128152
options: {
129153
runType: 'client',
130-
config: 'tests/intern.js'
154+
config: 'tests/intern.js',
155+
suites: [
156+
'tests/nonfunctional/payload.js',
157+
'tests/nonfunctional/in_queue.js',
158+
'tests/nonfunctional/proxies.js'
159+
]
160+
}
161+
},
162+
functional: {
163+
options: {
164+
runType: 'runner',
165+
config: 'tests/intern.js',
166+
functionalSuites: ['tests/functional/helpers.js']
131167
}
132168
}
133169
}
@@ -207,9 +243,10 @@ module.exports = function(grunt) {
207243
});
208244
});
209245

210-
grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify', 'concat', 'min']);
211-
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify', 'concat', 'min', 's3:not_pinned', 'invalidate_cloudfront:not_pinned']);
212-
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify', 'concat', 'min', 's3', 'invalidate_cloudfront']);
213-
grunt.registerTask('travis', 'Intern tests for Travis CI', ['lodash','intern']);
214-
246+
grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify:main', 'concat:dist', 'min:dist']);
247+
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify:main', 'concat:dist', 'min:dist', 's3:not_pinned', 'invalidate_cloudfront:not_pinned']);
248+
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify:main', 'concat:dist', 'min:dist', 's3', 'invalidate_cloudfront']);
249+
grunt.registerTask('test', 'Intern tests', ['browserify:test', 'intern']);
250+
grunt.registerTask('travis', 'Intern tests for Travis CI', ['lodash','browserify:test','intern']);
251+
grunt.registerTask('tags', 'Minifiy the Snowplow invocation tag', ['min:tag', 'concat:tag']);
215252
}

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# JavaScript web analytics for Snowplow
22

33
[ ![Build Status] [travis-image] ] [travis]
4+
[ ![Selenium Test Status] [saucelabs-button-image]][saucelabs]
45
[ ![Code Climate] [codeclimate-image] ] [codeclimate]
56
[ ![Built with Grunt] [grunt-image] ] [grunt]
67

@@ -14,7 +15,7 @@ With this tracker you can collect user event data (page views, e-commerce transa
1415

1516
| Technical Docs | Setup Guide | Roadmap & Contributing |
1617
|-----------------------------|-----------------------|--------------------------------------|
17-
| ![i1] [techdocs-image] | ![i2] [setup-image] | ![i3] [roadmap-image] |
18+
| [ ![i1] [techdocs-image] ] [tech-docs] | [ ![i2] [setup-image] ] [setup] | ![i3] [roadmap-image] |
1819
| [Technical Docs] [tech-docs] | [Setup Guide] [setup] | _coming soon_ |
1920

2021

@@ -29,6 +30,10 @@ Make sure you have `node` and `npm` installed and in your `$PATH`.
2930
`aws.json` file with valid credentials.
3031
* Build the package (default task concatenates and minifies) `grunt`
3132

33+
## Testing
34+
35+
[ ![Selenium Test Status][saucelabs-matrix-image]][saucelabs]
36+
3237
## Copyright and license
3338

3439
The Snowplow JavaScript Tracker is based on Anthon Pang's [`piwik.js`] [piwikjs], the JavaScript tracker for the open-source [Piwik] [piwik] project, and is distributed under the same license ([Simplified BSD] [bsd]).
@@ -55,4 +60,7 @@ Licensed under the [Simplified BSD] [bsd] license.
5560
[travis-image]: https://travis-ci.org/snowplow/snowplow-javascript-tracker.png?branch=master
5661
[travis]: http://travis-ci.org/snowplow/snowplow-javascript-tracker
5762
[codeclimate-image]: https://codeclimate.com/github/snowplow/snowplow-javascript-tracker.png
58-
[codeclimate]: https://codeclimate.com/github/github/snowplow/snowplow-javascript-tracker
63+
[codeclimate]: https://codeclimate.com/github/snowplow/snowplow-javascript-tracker
64+
[saucelabs]: https://saucelabs.com/u/snowplow_js_tracker
65+
[saucelabs-button-image]: https://saucelabs.com/buildstatus/snowplow_js_tracker
66+
[saucelabs-matrix-image]: https://saucelabs.com/browser-matrix/snowplow_js_tracker.svg

0 commit comments

Comments
 (0)