Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: segmentio/analytics-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e6b53bbccbd1fed26eee04a65d1ea234d85c697d
Choose a base ref
...
head repository: segmentio/analytics-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6ec082009c702272605252307685f4517c172d6d
Choose a head ref

Commits on May 24, 2018

  1. Copy the full SHA
    b97f8f1 View commit details

Commits on May 25, 2018

  1. Copy the full SHA
    60b252d View commit details
  2. Merge pull request #174 from segmentio/greenkeeper/delay-3.0.0

    Update delay to the latest version 🚀
    f2prateek authored May 25, 2018
    Copy the full SHA
    b14b1b4 View commit details

Commits on Jun 1, 2018

  1. Copy the full SHA
    4b9765f View commit details
  2. Merge pull request #175 from segmentio/greenkeeper/nyc-12.0.1

    Update nyc to the latest version 🚀
    f2prateek authored Jun 1, 2018
    Copy the full SHA
    523263f View commit details

Commits on Jun 3, 2018

  1. Copy the full SHA
    c139e3e View commit details

Commits on Jun 4, 2018

  1. Merge pull request #176 from segmentio/greenkeeper/nyc-12.0.2

    chore(package): update nyc to version 12.0.2
    f2prateek authored Jun 4, 2018
    Copy the full SHA
    fa1419d View commit details
  2. Merge pull request #178 from segmentio/greenkeeper/sinon-5.0.10

    chore(package): update sinon to version 5.0.10
    f2prateek authored Jun 4, 2018
    Copy the full SHA
    69060cc View commit details

Commits on Jun 11, 2018

  1. Copy the full SHA
    67115d5 View commit details
  2. Merge pull request #179 from segmentio/greenkeeper/sinon-6.0.0

    Update sinon to the latest version 🚀
    f2prateek authored Jun 11, 2018
    Copy the full SHA
    ba9a047 View commit details

Commits on Jun 29, 2018

  1. Migrate E2E tests from Runscope to Segment webhook

    Runscope shutdown the traffic inspector (https://blog.runscope.com/posts/phasing-out-traffic-inspector) we were using for our tests.
    
    This migrates to the custom webhook replacement we had built.
    f2prateek committed Jun 29, 2018
    Copy the full SHA
    0da3ed0 View commit details
  2. Merge pull request #183 from segmentio/migrate-e2e-tests

    Migrate E2E tests from Runscope to Segment webhook
    f2prateek authored Jun 29, 2018
    Copy the full SHA
    3db7e0e View commit details

Commits on Jul 7, 2018

  1. Migrate to Circle 2.0

    This migrates the CI config to Circle 2.0 and adds Snyk. It uses 3 workflows to speed up builds:
    
    1. multi-test that tests against multiple node versions
    2. test_and_publish that runs tests against node 10 and publishes to npm if the build passes and this is a tagged build.
    3. static_analysis that tests against node 10 and runs things like code coverage/snyk/size-limit
    
    We were already using `np` here, but I added docs to clarify how to use it, and a helper to run it with the `--no-publish` command.
    
    some helpful links:
    * https://circleci.com/docs/2.0/collect-test-data/#ava
    * https://circleci.com/docs/2.0/workflows/#git-tag-job-execution
    f2prateek committed Jul 7, 2018
    Copy the full SHA
    45e3925 View commit details
  2. Merge pull request #184 from segmentio/circle-2.0

    Migrate to Circle 2.0
    f2prateek authored Jul 7, 2018
    Copy the full SHA
    61aa26e View commit details

Commits on Aug 27, 2018

  1. add standardized makefile

    Instead of defining targets here, we delegate to Yarn for most targets.
    f2prateek committed Aug 27, 2018
    Copy the full SHA
    6fa2185 View commit details
  2. Merge pull request #187 from segmentio/makefile

    add standardized makefile
    f2prateek authored Aug 27, 2018
    Copy the full SHA
    13c57ef View commit details

Commits on Sep 5, 2018

  1. Use library-e2e-tester

    Instead of our handrolled end to end testing code, use library-e2e-tester which is more consistent and supports more message types.
    
    Requires refactoring the existing cli.js file to match the library-e2e-tester interface.
    f2prateek committed Sep 5, 2018
    Copy the full SHA
    f27c9a6 View commit details

Commits on Sep 10, 2018

  1. Merge pull request #190 from segmentio/e2e-tester

    Use library-e2e-tester
    nhi-nguyen authored Sep 10, 2018
    Copy the full SHA
    09cd86a View commit details

Commits on Sep 11, 2018

  1. Schedule e2e tests every 15 minutes past the hour (#191)

    nhi-nguyen authored and Nhi Nguyen committed Sep 11, 2018
    Copy the full SHA
    3570e7d View commit details

Commits on Oct 12, 2018

  1. Copy the full SHA
    ffd1daa View commit details
  2. Merge pull request #194 from segmentio/cli-host

    feat(cli): add ability to override host/api url
    dominicbarnes authored Oct 12, 2018
    Copy the full SHA
    11042e1 View commit details
  3. BREAKING CHANGE: remove cli from published package

    It adds unnecessary bulk to `analytics-node`, and will be moved to it's
    own package.
    dominicbarnes committed Oct 12, 2018
    Copy the full SHA
    0bd2241 View commit details

Commits on Nov 21, 2018

  1. Merge pull request #195 from segmentio/remove-cli

    refactor: move cli to a sub-package
    f2prateek authored Nov 21, 2018
    Copy the full SHA
    e7f7f9b View commit details

Commits on Mar 1, 2019

  1. Update README

    William Grosset committed Mar 1, 2019
    Copy the full SHA
    1d9e60e View commit details

Commits on Mar 7, 2019

  1. Copy the full SHA
    49ffa02 View commit details

Commits on Mar 25, 2019

  1. fix builds

    * remove nsp check as it is deprecated (https://blog.npmjs.org/post/175511531085/the-node-security-platform-service-is-shutting). we already have a replacement with Snyk.
    * upgrade handlebar dependency (https://snyk.io/vuln/SNYK-JS-HANDLEBARS-173692)
    f2prateek committed Mar 25, 2019
    Copy the full SHA
    ec4ad4f View commit details
  2. support integrations for cli

    update the cli to accept the `integrations` object, so it can work with the new fixtures. skips alias fixtures for now.
    f2prateek committed Mar 25, 2019
    Copy the full SHA
    a6bd8d4 View commit details
  3. Merge pull request #200 from segmentio/fix-builds

    fix builds
    f2prateek authored Mar 25, 2019
    Copy the full SHA
    bae4037 View commit details
  4. support alias tests

    f2prateek committed Mar 25, 2019
    Copy the full SHA
    38f36fc View commit details
  5. Merge pull request #201 from segmentio/alias-e2e-test

    support alias tests
    f2prateek authored Mar 25, 2019
    Copy the full SHA
    501ff0c View commit details

Commits on Mar 26, 2019

  1. run e2e tests concurrently

    use newer version of e2e harness and a higher concurrency
    f2prateek committed Mar 26, 2019
    Copy the full SHA
    97abfa4 View commit details
  2. Merge pull request #202 from segmentio/speed

    run e2e tests concurrently
    f2prateek authored Mar 26, 2019
    Copy the full SHA
    713db2e View commit details

Commits on Jun 7, 2019

  1. Upgrade devDependencies (#212)

    Fathy Boundjadj authored Jun 7, 2019
    Copy the full SHA
    eefaf83 View commit details
  2. Copy the full SHA
    d7d8129 View commit details

Commits on Jun 10, 2019

  1. Merge pull request #211 from segmentio/dependabot/npm_and_yarn/axios-…

    …0.18.1
    
    Bump axios from 0.17.1 to 0.18.1
    f2prateek authored Jun 10, 2019
    Copy the full SHA
    c5677c6 View commit details

Commits on Jun 12, 2019

  1. Update History.md

    fathyb committed Jun 12, 2019
    Copy the full SHA
    863b580 View commit details
  2. v3.4.0-beta

    fathyb committed Jun 12, 2019
    Copy the full SHA
    7123ff2 View commit details
  3. Update History.md

    fathyb committed Jun 12, 2019
    Copy the full SHA
    a00667c View commit details

Commits on Jun 19, 2019

  1. ci: fix publish step

    Previously the publish step would only run on tags such as `3.4.0-beta`, however, with `np` we name tags with a `v` prefix (e.g. `v3.4.0-beta`), causing the publish job step to never run.
    
    This updates the tag regex filter to allow the publish step to run on tags like `v3.4.0-beta`.
    f2prateek committed Jun 19, 2019
    Copy the full SHA
    e9a7aba View commit details
  2. Merge pull request #214 from segmentio/fix-release-step

    ci: fix publish step
    f2prateek authored Jun 19, 2019
    Copy the full SHA
    467101f View commit details

Commits on Jun 20, 2019

  1. add npm context to publish step

    we moved some tokens around, and the NPM_AUTH variable is available via the npm context in Circle CI.
    f2prateek committed Jun 20, 2019
    Copy the full SHA
    65c7d55 View commit details
  2. Merge pull request #215 from segmentio/add-npm-context

    add npm context to publish step
    f2prateek authored Jun 20, 2019
    Copy the full SHA
    e4b834a View commit details
  3. fix context declaration

    context is declared on the workflow, rather than the job.
    
    ```
    > circleci config validate -c .circleci/config.yml
    
    .circleci/config.yml is valid
    ```
    f2prateek committed Jun 20, 2019
    Copy the full SHA
    493954a View commit details
  4. Merge pull request #216 from segmentio/fix-context

    fix context declaration
    f2prateek authored Jun 20, 2019
    Copy the full SHA
    35e9d76 View commit details
  5. attach npm context to publish job

    As Nick pointed out in #216 (comment), this should be on the specific step in the job.
    
    ```
    > circleci config validate -c .circleci/config.yml
    Config file at .circleci/config.yml is valid.
    ```
    f2prateek committed Jun 20, 2019
    Copy the full SHA
    2ceac34 View commit details
  6. Merge pull request #217 from segmentio/fix-context-two

    attach `npm` context to publish job
    f2prateek authored Jun 20, 2019
    Copy the full SHA
    5e6bb55 View commit details
  7. v3.4.0-beta.1

    f2prateek committed Jun 20, 2019
    Copy the full SHA
    28a2b94 View commit details
  8. update changelog

    f2prateek committed Jun 20, 2019
    Copy the full SHA
    01ed42e View commit details

Commits on Jun 24, 2019

  1. Update axios

    michaltk committed Jun 24, 2019
    Copy the full SHA
    d0651cf View commit details

Commits on Jul 5, 2019

  1. Merge pull request #218 from michaltk/update-axios

    Update axios
    f2prateek authored Jul 5, 2019
    Copy the full SHA
    83ca8c3 View commit details
Showing with 9,344 additions and 186 deletions.
  1. +24 −0 .buildscript/bootstrap.sh
  2. +7 −0 .buildscript/circle.sh
  3. +13 −0 .buildscript/e2e.sh
  4. +125 −0 .circleci/config.yml
  5. +12 −0 .huskyrc.js
  6. +33 −0 History.md
  7. +8 −0 Makefile
  8. +9 −0 RELEASING.md
  9. +0 −22 circle.yml
  10. +96 −93 cli.js
  11. +4 −4 index.js
  12. +20 −22 package.json
  13. +41 −0 readme.md
  14. +71 −45 test.js
  15. +8,881 −0 yarn.lock
24 changes: 24 additions & 0 deletions .buildscript/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

if ! which brew >/dev/null; then
echo "homebrew is not available. Install it from http://brew.sh"
exit 1
else
echo "homebrew already installed"
fi

if ! which node >/dev/null; then
echo "installing node..."
brew install node
else
echo "node already installed"
fi

if ! which yarn >/dev/null; then
echo "installing yarn..."
brew install yarn
else
echo "yarn already installed"
fi

echo "all dependencies installed."
7 changes: 7 additions & 0 deletions .buildscript/circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if ! eMSG=$(circleci config validate -c .circleci/config.yml); then
echo "CircleCI Configuration Failed Validation."
echo $eMSG
exit 1
fi
13 changes: 13 additions & 0 deletions .buildscript/e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

if [ "$RUN_E2E_TESTS" != "true" ]; then
echo "Skipping end to end tests."
else
echo "Running end to end tests..."
wget https://github.com/segmentio/library-e2e-tester/releases/download/0.3.2/tester_linux_amd64 -O tester
chmod +x tester
./tester -path='./cli.js' -concurrency=3
echo "End to end tests completed!"
fi
125 changes: 125 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
workflows:
version: 2
validate-config:
jobs:
- circle-lint
multi-test:
jobs:
- test-node8
- test-node10
- test-node12
test_and_publish:
jobs:
- test:
filters:
tags:
only: /.*/
- publish:
context: npm
requires:
- test
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(-.+)?/
branches:
ignore: /.*/
static_analysis:
jobs:
- test
- size:
requires:
- test
- coverage:
requires:
- test
- snyk:
context: snyk
requires:
- test
scheduled_e2e_test:
triggers:
- schedule:
cron: "15 * * * *"
filters:
branches:
only:
- master
- scheduled_e2e_testing
jobs:
- test-node8
- test-node10
- test-node12

version: 2
jobs:
circle-lint:
working_directory: ~/analytics-node
docker:
- image: node
steps:
- checkout
- run: yarn run circle-lint
node-base-test: &node-base-test
working_directory: ~/analytics-node
docker:
- image: node
steps:
- checkout
- restore_cache:
key: yarn-dependency-cache-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile
- save_cache:
key: yarn-dependency-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn test
- persist_to_workspace:
root: .
paths: [.]

test-node8:
<<: *node-base-test
docker:
- image: circleci/node:8-browsers
test-node10:
<<: *node-base-test
docker:
- image: circleci/node:10-browsers
test-node12:
<<: *node-base-test
docker:
- image: circleci/node:12-browsers
test:
<<: *node-base-test
docker:
- image: circleci/node:10-browsers
coverage:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: yarn run report-coverage
size:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: yarn run size
snyk:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: yarn run snyk test --severity-threshold=high
- run: yarn run snyk monitor
publish:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
- run: npm publish .
12 changes: 12 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const tasks = arr => arr.join(' && ')
module.exports = {
'hooks': {
'pre-commit': tasks([
'exec < /dev/tty',
`if ! [ -x "$(command -v circleci)" ]; then
echo "If you want to verify your circleci config precommit, please install the local circleci tool from https://circleci.com/docs/2.0/local-cli/"; else
yarn run circle-lint
fi`
])
}
}
33 changes: 33 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
v3.5.0 / 2021-1-5
==========================
* Update axios to fix the Server-Side Request Forgery vulnerability (#259)


v3.4.1-beta.3 / 2020-10-26
==========================
* Update axios to fix the infinite retry bug (#255)
* Use a local instance of axios to prevent client options leaking to other contexts (#255)

v3.4.1-beta.2 / 2020-06-10
==========================
* Update lodash (#222) (#221) from segmentio/dependabot/npm_and_yarn/lodash-4.17.11 8e9a91d
* Fix typo (#220)
* Update axios (#218)


v3.4.1-beta.1 / 2019-06-20
==========================

* Upgrade dependencies ([#174](https://github.com/segmentio/analytics-node/pull/174), [#175](https://github.com/segmentio/analytics-node/pull/175), [#176](https://github.com/segmentio/analytics-node/pull/176), [#178](https://github.com/segmentio/analytics-node/pull/178), [#179](https://github.com/segmentio/analytics-node/pull/179), [#211](https://github.com/segmentio/analytics-node/pull/211), [#212](https://github.com/segmentio/analytics-node/pull/212))
* [Improvement](https://github.com/segmentio/analytics-node/pull/194): Add ability to override host/api url
* [BREAKING CHANGE](https://github.com/segmentio/analytics-node/pull/195): remove cli from published package

v3.4.0-beta / 2019-06-12
========================

* Due to a bug in the release step, this version was not published to NPM. It was instead re-published as `v3.4.1-beta.1`.

v3.3.0 / 2018-04-24
===================

* Promote `v3.3.0-beta.2` to stable

v3.3.0-beta.2 / 2018-03-02
==========================
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bootstrap:
.buildscript/bootstrap.sh

# use yarn scripts for the rest
%:
@yarn $@

.PHONY: bootstrap
9 changes: 9 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# RELEASING

We automatically publish Github tagged releases from our CI to NPM.

We use [`np`](https://github.com/sindresorhus/np) to prepare a release.

`np` will be automatically installed by running `yarn`, and you can run it with `yarn run np`. You can pass flags to it just as you would with `np`, e.g. you can run `yarn np minor`.

If you run `np` directly, take care to use the [`--no-publish`](https://github.com/sindresorhus/np#publish-with-a-ci) flag. This ensures that we don't directly publish to NPM from a local dev machine.
22 changes: 0 additions & 22 deletions circle.yml

This file was deleted.

Loading