From 5bacf0ff8048e41953920232c31775dc3512da2e Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 28 Oct 2021 10:08:40 -0700 Subject: [PATCH] Add dist compilation --- README.md | 15 +++++++++++++++ package-lock.json | 18 ++++++++++++++++++ package.json | 6 ++++++ 3 files changed, 39 insertions(+) diff --git a/README.md b/README.md index 5cc1503..c1f4039 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,21 @@ This integration does the following things: * Create transactional email templates in SendGrid, unless a template ID was provided for each email type * Assemble data for transactional emails and send them using the SendGrid API +## Using this repo + +This repository runs in combination with the [integration-helper](https://github.com/chec/integration-helper). That +repository provides context (e.g. merchant, API connectivity, integration info) and then runs the code in this +repository. + +### Building + +When you make changes to this repository you will need to rebuild the dist files. For this, we use +[`@vercel/ncc`](https://github.com/vercel/ncc): + +``` +npm run build +``` + ## Email types * Customers: new order. Sent when a new order is placed, this is the order receipt the customer receives. diff --git a/package-lock.json b/package-lock.json index e1c640b..c9a83f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,9 @@ "@chec/webhook-verifier": "^1.0.1", "@sendgrid/client": "^7.5.0", "@sendgrid/mail": "^7.5.0" + }, + "devDependencies": { + "@vercel/ncc": "^0.31.1" } }, "node_modules/@chec/webhook-verifier": { @@ -54,6 +57,15 @@ "node": "6.* || 8.* || >=10.*" } }, + "node_modules/@vercel/ncc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.31.1.tgz", + "integrity": "sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA==", + "dev": true, + "bin": { + "ncc": "dist/ncc/cli.js" + } + }, "node_modules/axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -122,6 +134,12 @@ "@sendgrid/helpers": "^7.5.0" } }, + "@vercel/ncc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.31.1.tgz", + "integrity": "sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA==", + "dev": true + }, "axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", diff --git a/package.json b/package.json index 6fd88f6..2f53ec8 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,15 @@ "author": "Robbie Averill ", "license": "Proprietary", "private": true, + "scripts": { + "build": "ncc build index.js -o dist -m" + }, "dependencies": { "@chec/webhook-verifier": "^1.0.1", "@sendgrid/client": "^7.5.0", "@sendgrid/mail": "^7.5.0" + }, + "devDependencies": { + "@vercel/ncc": "^0.31.1" } }