Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 73874ec

Browse files
committed
2 parents b32b24d + bfb127c commit 73874ec

17 files changed

+361
-225
lines changed

.eslintrc

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
11
{
2-
"extends": "segment/browser",
3-
4-
"rules": {
5-
"global-strict": 0,
6-
"max-len": 0,
7-
// FIXME: Remove this when linting error has been fixed
8-
"no-use-before-define": 0,
9-
"strict": 1
10-
},
11-
12-
"globals": {
13-
"exports": true,
14-
"module": true,
15-
"require": true
16-
}
2+
"extends": "@segment/eslint-config/browser/legacy"
173
}

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
*.log
2-
.DS_Store
3-
build.js
4-
components
1+
coverage
52
node_modules

Contributing.md CONTRIBUTING.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
We're huge fans of open-source, and we absolutely love getting good contributions to **analytics.js**! Integrations are available to thousands of Segment customers and we have hundreds of integrations in already in our queue, so it's important that you do the following _before writing a pull request_.
3+
We're huge fans of open-source, and we absolutely love getting good contributions to **analytics.js**! Integrations are available to thousands of Segment customers and we have hundreds of integrations in already in our queue, so it's important that you do the following _before writing a pull request_.
44

55
1. Read about our integration options and apply to be a partner: https://segment.com/partners/
66
1. Hear from the Segment team before submitting your pull request.
@@ -21,9 +21,8 @@ That will install all of our [npm](http://npmjs.org) and [component](http://comp
2121
The commands you'll want to know for development are:
2222

2323
```bash
24-
$ make # re-compiles the development build of analytics.js for testing
25-
$ make test # runs all of the tests in your terminal
26-
$ make test-browser # runs all of the tests in your browser, for nicer debugging
24+
$ make test # runs all of the tests in your terminal
25+
$ make test-browser BROWSERS=Chrome # runs all of the tests in Chrome for nicer debugging
2726
```
2827

2928
## Writing Tests

HISTORY.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2.0.0 / 2016-06-21
2+
==================
3+
4+
* Remove Duo compatibility
5+
* Add CI setup (coverage, linting, cross-browser compatibility, etc.)
6+
* Update eslint configuration
7+
8+
9+
1.0.8 / 2016-06-07
10+
==================
11+
12+
* Merge pull request #7 from segment-integrations/revert/apikey
13+
14+
1.0.7 / 2016-05-13
15+
==================
16+
17+
* Switch appcuesId to apiKey
18+
19+
1.0.6 / 2016-05-07
20+
==================
21+
22+
* Bump Analytics.js core, tester, integration to use Facade 2.x
23+
24+
1.0.5 / 2015-10-08
25+
==================
26+
27+
* analytics.page() should call Appcues.start().
28+
29+
1.0.4 / 2015-06-30
30+
==================
31+
32+
* Replace analytics.js dependency with analytics.js-core
33+
34+
1.0.3 / 2015-06-30
35+
==================
36+
37+
* Replace analytics.js dependency with analytics.js-core
38+
39+
1.0.2 / 2015-06-24
40+
==================
41+
42+
* Bump analytics.js-integration version
43+
44+
1.0.1 / 2015-06-24
45+
==================
46+
47+
* Bump analytics.js-integration version
48+
49+
1.0.0 / 2015-06-09
50+
==================
51+
52+
* Initial commit :sparkles:

History.md

-25
This file was deleted.

License.md LICENSE

File renamed without changes.

Makefile

+65-78
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,80 @@
1-
#
2-
# Binaries.
3-
#
4-
5-
DUO = node_modules/.bin/duo
6-
DUOT = node_modules/.bin/duo-test
7-
ESLINT = node_modules/.bin/eslint
8-
9-
#
10-
# Files.
11-
#
12-
13-
SRCS_DIR = lib
14-
SRCS = $(shell find $(SRCS_DIR) -type f -name "*.js")
15-
TESTS_DIR = test
16-
TESTS = $(shell find $(TESTS_DIR) -type f -name '*.test.js')
17-
18-
#
19-
# Task config.
20-
#
21-
22-
BROWSER ?= chrome
23-
24-
PORT ?= 0
25-
26-
DUOT_ARGS = \
27-
--reporter spec \
28-
--port $(PORT) \
29-
--commands "make build"
30-
31-
#
32-
# Chore tasks.
33-
#
34-
35-
# Install node dependencies.
1+
##
2+
# Binaries
3+
##
4+
5+
ESLINT := node_modules/.bin/eslint
6+
KARMA := node_modules/.bin/karma
7+
8+
##
9+
# Files
10+
##
11+
12+
LIBS = $(shell find lib -type f -name "*.js")
13+
TESTS = $(shell find test -type f -name "*.test.js")
14+
SUPPORT = $(wildcard karma.conf*.js)
15+
ALL_FILES = $(LIBS) $(TESTS) $(SUPPORT)
16+
17+
##
18+
# Program options/flags
19+
##
20+
21+
# A list of options to pass to Karma
22+
# Overriding this overwrites all options specified in this file (e.g. BROWSERS)
23+
KARMA_FLAGS ?=
24+
25+
# A list of Karma browser launchers to run
26+
# http://karma-runner.github.io/0.13/config/browsers.html
27+
BROWSERS ?=
28+
ifdef BROWSERS
29+
KARMA_FLAGS += --browsers $(BROWSERS)
30+
endif
31+
32+
ifdef CI
33+
KARMA_CONF ?= karma.conf.ci.js
34+
else
35+
KARMA_CONF ?= karma.conf.js
36+
endif
37+
38+
# Mocha flags.
39+
GREP ?= .
40+
41+
##
42+
# Tasks
43+
##
44+
45+
# Install node modules.
3646
node_modules: package.json $(wildcard node_modules/*/package.json)
3747
@npm install
48+
@touch $@
49+
50+
# Install dependencies.
51+
install: node_modules
3852

3953
# Remove temporary files and build artifacts.
4054
clean:
41-
rm -rf build.js
55+
rm -rf *.log coverage
4256
.PHONY: clean
4357

4458
# Remove temporary files, build artifacts, and vendor dependencies.
4559
distclean: clean
46-
rm -rf components node_modules
60+
rm -rf node_modules
4761
.PHONY: distclean
4862

49-
#
50-
# Build tasks.
51-
#
52-
53-
# Build all integrations, tests, and dependencies together for testing.
54-
build.js: node_modules component.json $(SRCS) $(TESTS)
55-
@$(DUO) --stdout --development $(TESTS) > $@
56-
57-
# Build shortcut.
58-
build: build.js
59-
.DEFAULT_GOAL = build
60-
61-
#
62-
# Test tasks.
63-
#
64-
65-
# Lint JavaScript source.
66-
lint: node_modules
67-
@$(ESLINT) $(SRCS) $(TESTS)
63+
# Lint JavaScript source files.
64+
lint: install
65+
@$(ESLINT) $(ALL_FILES)
6866
.PHONY: lint
6967

70-
# Test locally in PhantomJS.
71-
test-phantomjs: node_modules build.js
72-
@$(DUOT) phantomjs $(TESTS_DIR) args: \
73-
--path node_modules/.bin/phantomjs
74-
.PHONY: test
68+
# Attempt to fix linting errors.
69+
fmt: install
70+
@$(ESLINT) --fix $(ALL_FILES)
71+
.PHONY: fmt
72+
73+
# Run browser unit tests in a browser.
74+
test-browser: install
75+
@$(KARMA) start $(KARMA_FLAGS) $(KARMA_CONF)
7576

76-
# Test locally in the browser.
77-
test-browser: node_modules build.js
78-
@$(DUOT) browser --commands "make build" $(TESTS_DIR)
79-
.PHONY: test-browser
80-
81-
# Test in Sauce Labs. Note that you must set the SAUCE_USERNAME and
82-
# SAUCE_ACCESS_KEY environment variables using your Sauce Labs credentials.
83-
test-sauce: node_modules build.js
84-
@$(DUOT) saucelabs $(TESTS_DIR) \
85-
--name analytics.js-integrations \
86-
--browsers $(BROWSER) \
87-
--user $(SAUCE_USERNAME) \
88-
--key $(SAUCE_ACCESS_KEY)
89-
.PHONY: test-sauce
90-
91-
# Test shortcut.
92-
test: lint test-phantomjs
77+
# Default test target.
78+
test: lint test-browser
9379
.PHONY: test
80+
.DEFAULT_GOAL = test

Readme.md README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Appcues integration for [Analytics.js][].
44

55
## License
66

7-
Released under the [MIT license](License.md).
7+
Released under the [MIT license](LICENSE).
88

99

1010
[Analytics.js]: https://segment.com/docs/libraries/analytics.js/

circle.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
machine:
22
node:
3-
version: 0.12
3+
version: 4
4+
environment:
5+
NPM_CONFIG_PROGRESS: false
6+
NPM_CONFIG_SPIN: false
7+
SAUCE_ACCESS_KEY: 80dcffc2-c9a2-45e2-9fb7-87b29a6cd986
8+
SAUCE_USERNAME: segment-oss
9+
TEST_REPORTS_DIR: $CIRCLE_TEST_REPORTS
10+
411
dependencies:
512
pre:
6-
- echo "github.com,192.30.252.*,192.30.253.*,192.30.254.*,192.30.255.* ssh-rsa $(ssh-keyscan -t rsa github.com | cut -d ' ' -f 3-)" >> ~/.ssh/known_hosts
7-
- npm install -g npm@'>=2.7.0'
8-
- make
13+
- npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
14+
- npm -g install codecov
15+
override:
16+
- make install
17+
918
test:
1019
override:
1120
- make test
21+
post:
22+
- cp -R coverage $CIRCLE_ARTIFACTS/
23+
- codecov
24+
25+
deployment:
26+
publish:
27+
owner: segment-integrations
28+
# Works on e.g. `1.0.0-alpha.1`
29+
tag: /[0-9]+(\.[0-9]+)*(-.+)?/
30+
commands:
31+
- npm publish .

component.json

-18
This file was deleted.

0 commit comments

Comments
 (0)