dealstarter
The Deal Starter Application
Last updated 7 months ago by mmd-devops .
ISC · Repository · Original npm · Tarball · package.json
$ cnpm install dealstarter 
SYNC missed versions from official npm registry.

Team Node Version NPM Version Docker Version

DealStarter

DealStarter(DS) is Digital Retailing's off the self deal penciling widget.

Collaboration & List of Core Contributors

How to use DS

To use DS you simply have to sign up for an irrational amount of accounts across cox, drop a script tag on your site, call an exposed start method, and sell your first born to Digital Retailing.

Step 1 Sign up for Digital Retailing

Step 2 Drop script on a page your want the widget to show.

Step 3 Call start method with setup config when target div has loaded.

How to run locally

(for instructions on using widget test with DealStarter read this)

  1. Log into the MakeMyDeal NPM account, someone on your team should be able to provide credentials

  2. Add routes to your local system using one of the following:

    a. Clone Dr-System project and follow instructions in https://ghe.coxautoinc.com/DigitalRetailing/dr-system/blob/master/local-dev-proxy/osx/local-proxy-docs.md.

  3. We have an unified package.json (client & server) that expose this commands, if you wish to run only client or only server, these commands are available:
    npm run client-serve - runs client only
    npm run server-serve - runs server only npm start - runs both server and client Add THEME=default before the client to test with only one theme (no && needed)

    3(a). If you wish to run both client and server locally, you can do so with this command: npm run serve - runs both client and server

  4. If you want to connect the server to a locally run Node API, run this command: NODE_API_PROTOCOL=http NODE_API_HOST=w2.makemydealpreview.com NODE_API_PORT=5200 npm run server-serve

  5. If you want to connect the server to a locally run DR Services API, run this command: SERVICES_GATEWAY_PROTOCOL=http SERVICES_GATEWAY_HOST=127.0.0.1 SERVICES_GATEWAY_PORT=3000 npm run server-serve

  6. To see your running code, you can go to a demo dealer like Aperture Demo Dealer. Navigate to a vehicle page. Once there, add a query parameter to the end of the url dsEnv=local-ssl.

If you use VSCode, you can run client on a terminal with npm run client-serve and from VSCode go to the debugging tab and start server from the debugging dropdown, you will be able to setup breakpoints on server code if you debug from VSCode.

How to run automated tests

In terminal, run npm test which will run server and client tests.

How to run locally-linked dependencies

  1. Navigate to dependency (e.g. dr-platform-shared) and run npm link. Repeat this step for all dependencies you need linked.
  2. In DealStarter, for each dependency you want to link, run npm link ${dependencyName} such as npm link @makemydeal/dr-platform-shared. NOTE: In DealStarter, if you need to run an npm install for any reason and want to avoid having to relink your dependencies, run npm run deeplink. This will act as npm install while preserving local links. It does not create links for you, so you will have to run step 1 first to see a specific dependency linked on DealStarter.

To revert a locally linked dependency back to the latest published version, run the cutlink command with the dependency. Example: npm run cutlink dr-payment-redux will revert @makemydeal/dr-payment-redux to it's published version in package.json

More on running dependencies locally here

How to test using a locally running instance of ShopperPlatform

npm run start-all

Runs both DealStarter and ShopperPlatform concurrently. This script makes the assumption that your DealStarter and ShopperPlatform repos are in the same directory.

How to test all themes locally

There is a dev helper which allows you to see all themes and easily switch between them. You can access it one of three ways:

  • In the console, type: showDevHelper()
  • In the console, type: devHelperUtils.open()
  • Click inside the widget so that it is active. On your keyboard, press these keys: up up down down left right left right

Testing Local Code against Production

Note: Requires a resource override plugin for your browser

  1. Set NODE_ENV to production NODE_ENV=production

  2. Run both client and server

  3. Set your plugin to route https://{shop|accelerate}.dealer.com/static/ds/{liveVersion}/js/* to https://dealstarter-client.makemydeal.dev/static/ds/{localVersion}/js/*
    You can go one level up and remove the js on both if you want to test css or fonts

How to contribute

We thank you! We believe in our cause, but... we don't mind a little sleep either so if you follow the direction below we will owe you a beer (unless its a crap PR.. then you need to buy us one so we can get through reviewing it!).

  • Submit an issue discussing the problem/iteration you would like to see.
  • Branch off master, complete your work, submit PR.
  • Please reference the submitted issue number in any PR with work against said issue.
  • Merges should be squashed using conventional commits, so that we get our versioning working.

Please see CONTRIBUTING.md for more details.

How to test theme changes

THEME=sponsor1,sponsor2 npm run client-serve it will compile only the themes listed (comma separated format), i.e THEME=default,lexus,toyota npm run client-serve if you dont specify a sponsor or THEME it will compile all themes.

Requirements

  • Node.js@dubnium
  • Docker@latest
  • NPM@5.4.0+

Getting started

  • npm install
  • npm run dev

Logging

Server Logging

Digital Retailing Logger

Client Logging

Digital Retailing Client logger

Remote Logging

We do our remote logging using splunk. Our splunk data can be found at the following url: https://coxauto.splunkcloud.com/en-US/app/Agera/search

Common Search Terms

  • index="cai_mmd_preprod" eb_env="dr-dealstarter-dev" | search error
  • index="cai_mmd_prod" eb_env="dr-dealstarter-production-blue"

Troubleshooting

  • If you see "https://undefined/js/validateInitState.chunk.js net::ERR_NAME_NOT_RESOLVED" the problem may be caused by having NODE_ENV defined (this is a known issue that will be resolved in future) - use unset NODE_ENV before npm run serve to resolve issue.

Current Tags

  • 2.637.0                                ...           alpha (4 months ago)
  • 2.522.0                                ...           latest (7 months ago)

9 Versions

  • 2.637.0                                ...           4 months ago
  • 2.522.0                                ...           7 months ago
  • 2.179.0                                ...           a year ago
  • 2.130.0                                ...           a year ago
  • 2.95.0                                ...           a year ago
  • 2.67.0                                ...           a year ago
  • 2.35.11                                ...           a year ago
  • 2.34.9                                ...           a year ago
  • 2.34.5                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (101)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |