{"_id":"@adobe-mcid/visitor-js-client","_rev":"2-3eb1acbaa6dd6c1523a5e0e30b6fc543","name":"@adobe-mcid/visitor-js-client","description":"Visitor API","dist-tags":{"latest":"2.5.0"},"versions":{"2.5.0":{"name":"@adobe-mcid/visitor-js-client","version":"2.5.0","description":"Visitor API","scripts":{"prepush-msg":"echo 'Running pre-push scripts...' && exit 0","precommit-msg":"echo 'Running pre-commit scripts...' && exit 0","lint":"echo '=> linting' && eslint lib/","test:crossplatform":"echo '=> testing cross browser' && test-cross-platform","test:saucelab-IE":"echo '=> IE' && SAUCE_IE=true SAUCE_USERNAME=$npm_package_config_sl_user SAUCE_ACCESS_KEY=$npm_package_config_sl_key karma start","test:saucelab-FIREFOX":"echo '=> FIREFOX' && SAUCE_FIREFOX=true SAUCE_USERNAME=$npm_package_config_sl_user SAUCE_ACCESS_KEY=$npm_package_config_sl_key karma start","test:saucelab-CHROME":"echo '=> CHROME' && SAUCE_CHROME=true SAUCE_USERNAME=$npm_package_config_sl_user SAUCE_ACCESS_KEY=$npm_package_config_sl_key karma start","test:saucelab-SAFARI":"echo '=> SAFARI' && SAUCE_SAFARI=true SAUCE_USERNAME=$npm_package_config_sl_user SAUCE_ACCESS_KEY=$npm_package_config_sl_key karma start","test:functional":"node test/run.js","test:htmlCoverageReporter":"echo '=> testing' && npm run build && REPORTER=HTML karma start","test":"echo '=> testing' && npm run build && REPORTER=TEXT karma start","minify:dev":"uglifyjs $npm_package_config_uglifydev $npm_package_config_uglifyopts","minify:prod":"uglifyjs $npm_package_config_uglifyprod $npm_package_config_uglifyopts","bundle:js":"mkdirp 'dist/js' && browserify lib/*.js -o dist/js/bundle.js","build:dev":"echo '=> building DEV' && npm run bundle:js && npm run minify:dev -s","build:prod":"echo '=> building PROD' && npm run bundle:js && npm run minify:prod -s","build":"npm run build:dev && npm run build:prod","server":"http-server app/","watch":"watch 'npm run build' lib/ app/css","start":"npm-run-all --parallel server","deployToGitPages":"git subtree push --prefix dist origin gh-pages"},"author":{"name":"ID Service team"},"pre-commit":["precommit-msg","lint"],"pre-push":["prepush-msg","test"],"dependencies":{"@adobe-mcid/visitor-js-shared":"~0.0.1"},"devDependencies":{"@adobe-mcid/test-cross-platform":"~0.0.4","browserify":"^13.1.0","browserify-shim":"^3.8.12","browserify-versionify":"^1.0.6","eslint":"^3.13.1","express":"^4.14.0","http-server":"^0.9.0","jasmine":"^2.5.2","jasmine-console-reporter":"^1.2.7","karma":"^1.4.0","karma-browserify":"^5.1.0","karma-chrome-launcher":"^2.0.0","karma-coverage":"^1.1.1","karma-jasmine":"^1.1.0","karma-phantomjs-launcher":"^1.0.2","karma-sauce-launcher":"^1.1.0","karma-spec-reporter":"0.0.26","mkdirp":"^0.5.1","npm-run-all":"^2.3.0","pre-commit":"^1.1.3","slimerjs":"^0.10.3","uglify-js":"^2.7.5","watch":"^0.19.1","watchify":"^3.8.0"},"browserify":{"transform":["browserify-versionify"]},"browserify-shim":{"Visitor":"global:Visitor"},"config":{"uglifyopts":"--comments --mangle toplevel,eval -c sequences,dead_code,conditionals,booleans,unused,if_return,join_vars,properties","uglifydev":"dist/js/bundle.js -b -o dist/js/visitorapi_debug.min.js --define VISITOR_DEBUG=true","uglifyprod":"dist/js/bundle.js -o dist/js/visitorapi.min.js --define VISITOR_DEBUG=false","sl_user":"j_khoury","sl_key":"2ecc9c37-c842-4220-a499-2f780f259bb1"},"testCrossPlatform":{"port":8080,"platforms":[["OS X 10.11","safari","10.0"],["Windows 7","internet explorer","9.0"]],"username":"j_khoury","key":"2ecc9c37-c842-4220-a499-2f780f259bb1"},"gitHead":"abfbc37de237df6bfc8a2d0c8d4512a1d78f9b3e","_id":"@adobe-mcid/visitor-js-client@2.5.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"adobe-mcid","email":"Grp-MCID-NPM@adobe.com"},"dist":{"integrity":"sha512-eSQCBUcEkFIoGPMT2e24QHI5SwWygiu4wxpyrWixnEO2RyIyJN3O3h7il1nkd0JnxFZkmUio+NG4f8xUobCrOQ==","shasum":"cec99604f1437e223ca772c2bd7729481ba9b663","tarball":"https://registry.npmjs.org/@adobe-mcid/visitor-js-client/-/visitor-js-client-2.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+TQXUWOsqXBQhTSKVx0ifixbx6dOBOkVPY/rQpXsfUwIhAPfWIB9Gp5agmq7Hh1wuxtIzJqGi2XMDBtdUtNkUghIT"}]},"maintainers":[{"name":"adobe-mcid","email":"Grp-MCID-NPM@adobe.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/visitor-js-client-2.5.0.tgz_1507561154766_0.9040276319719851"},"directories":{},"deprecated":"this package has been deprecated"}},"readme":"# Visitor JS Client\n\nThis is the new home for VisitorAPI. We have updated the build system and everything around it to make the DEV environment as dev friendly as possible.\n\n## Docs\n\n[Read public docs](https://marketing.adobe.com/resources/help/en_US/mcvid/mcvid-home.html)\n\n[Internal WIKI](https://wiki.corp.adobe.com/display/omtrcache/Visitor+API)\n\n## For developers:\n\nTo get started, clone the repo to your local machine, then install all the dependencies:\n\n##### Clone the repo\n```git clone git@git.corp.adobe.com:mc-visitor/visitor-js-client.git```\n\n##### Install all the dependencies from NPM\n```npm install```\n\n### Build & Dev explanation\n\nWe use simple NPM scripts to run our build processes.\n\nThe dev environment will help prevent syntax errors, enforce a coding standard and make sure unit tests are always apssing.\n\nTo do that, we lint the code and run the unit tests every time you commit.\n\n### How to build the project\n\nBuilding the code will output 3 files into the `dist/js` directory:\n\n- `bundle.js`: Since Visitor is using Modules, we use browserify to transform the file to a browser friendly object. This file is the bundle of Visitor and all the dependency that it needs, unminified.\n\n- `visitorapi.min.js`: Prod-Ready, minified and obfuscated version of Visitor.\n\n- `visitorapi_debug.min.js`: A debug version of Visitor. This is a work in progress, but the goal is to have a debug version of Visitor that outputs to the console, turns on metrics by default, checks the configuration and make sure it is done correctly and more...\n\n<strong>To build Visitor:</strong>\n```npm run build```\n\n## Testing pyramid\n\nWe have 3 layers of testing in this build environment:\n\n### Unit Tests\n\nWe have a suite of unit tests that is run every time you commit. This is a work in progress, working towards the optimal coverage that can confirm a happy path. We use Karma-browserify as test runner, write our tests in Jasmine 2.5, and use browserify-shim to make sure we can run Visitor in the console in NodeJS, since Visitor depends on window and document a good amount.\n\n<strong>To run the Unit Tests:</strong>\n```npm run test```\n\n\n### Run Unit Tests cross platform\n\nSince Visitor supports ALL browsers, we have built a simple Node project that will take our unit tests, and run them in Sauce Labs against multiple platforms and browsers. [Read more about test-cross-platform](https://www.npmjs.com/package/@adobe-mcid/test-cross-platform)\n\nIn order to change or view the `test-cross-platform` configurations, open `package.json` and look for the `\"testCrossPlatform\"` property.\n\n<strong>To run the Unit Tests cross platform:</strong>\n```npm run test:crossplatform```\n\n\n### Integration Tests\n\nThe last layer of testing are the integration tests. The goal of those tests is to place Visitor, AppMeasurement, AT.js and hopefully more soon on an HTML page, instantiate them, and make sure they play together nicely.\n\nWe use a combination of Jasmine, selenium-webdriver and BrowserMob proxy to run those tests.\n\n#### About browsermob-proxy and selenium standalone.\n\n- browsermob-proxy is an node binding to communicate with the actual Browsermob Proxy REST API and collect HAR data.\n\n- selenium-standalone can install the Selenium Standalone Server JAR file which is a requirement for browser mob, and can start the server.\n\nTo use all this cool stuff:\n\nTerminal Tab 1: `npm run startSelenium`\nTerminal Tab 2: `npm run startProxy’\nTerminal Tab 3: `npm run test:integration`\n\nMore to come, but this is the base framework.\n\n### Run HTML coverage report\n\nUse `npm run test:htmlCoverageReporter` and Istanbul will generate a very helpful HTML page that shows the sections we need to test, complexity and more... The page will go under `test/unit-tests/coverage`.\n\n\n## Sample app\n\nWe have implemented a sample app that implements Visitor and showcases it's features and best practices. The app resides in the `/dist/` folder. Features:\n\n- Visitor's interface.\n- Best practices\n- Pitfalls and known issues\n- Debugging\n\n<strong>To run the Sample App:</strong>\n```npm run start```\n\nThen open any browser and go to `localhost:8080`.\n\n\n## Github pages\n\nWe are publishing our sample on Github pages.\n\n[Visit the page here](https://git.corp.adobe.com/pages/mc-visitor/visitor-js-client/)\n\n<strong>To publish a change to the Sample App:</strong>\n```npm run deployToGitPages```\n\n## Git process\n\nIn order to contribute to this repo, please follow this process:\n\n1. Create a branch with a name that looks like this: `feature/TICKET_NUMBER`.\n2. Once your code is committed, make a Pull Request against the DEV branch for that release.\n3. Once your PR is approved, rebase your feature branch on top of the dev branch, then merge it into dev. Don't squash merge, keep all the commits as they were.\n\n## More about PRs (IMPORTANT):\n\nThe way we create PRs and commits affects the way we think about problems and how we can break them down into simpler problems which allows faster and better implementation. Breaking down user stories into sub tasks that relates to PRs is a great plus as well.\n\nWhen we put up a pull request for review, we should have the reviewer in mind. Small PRs with well named commits with atomic changes are very important so that the reviewer can follow and understand your implementation. You don't want the reviewer to open \"Files Changed\", instead he should be able to select each commit separately and understand the intention of this commit. You want your PR to be reviewed for language errors as well as logic issues, detect repetition, suggestions for abstractions and more. The only way the reviewer can do is when the PRs and commits are small and meaningful.\n\n\nTaking PRs seriously will enforce more readable code as well, which is another win.\n\nExample of a good commit message:\n\n```\n[MCID-666] This is a brief description of my commit\n\nThis is more details about the commit, if necessary. We can add TODOs, depenencies, WIP items...\n```\n\n- Provide a brief description on the first line (60 characters max). Include the issue id as the first part of the commit message (optionally)\n- Insert a single blank line after the first line\n- Provide a detailed description of the change in the following lines, breaking paragraphs where needed\n- Include external references to help the reviewer\n\n<strong>Things to avoid</strong>\n\n- No mixing functional changes with refactoring: use separate commits or, even better, separate pull requests\n- No mixing whitespace changes with functional code changes (separate the changes in two separate commits)\n- No mixing two functional changes in the same commit. If you have to use \"and\", break it in two separate commits\n- No All-in-one huge commits. Separate your commits in atomic pieces of functional changes.\n","maintainers":[{"name":"adobe-mcid","email":"Grp-MCID-NPM@adobe.com"}],"time":{"modified":"2022-04-04T11:33:57.534Z","created":"2017-10-09T14:59:14.841Z","2.5.0":"2017-10-09T14:59:14.841Z"},"author":{"name":"ID Service team"},"readmeFilename":"README.md"}