There are two projects in this repository:
/power-the-polls-form
contains the main submission form as an independent web component. It is used by/site
and intended for sharing with partners and generally spreading the signup as wide as possible./site
contains the website for powerthepolls.org
- Run
npm install
to install dependencies - Run
npm run dev
to start a server locally and watch changes
To do a full build, run npm run build
.
This is currently done manually
- Bump the version in
./package.json
, if creating a beta version, make sure there is a revision, e.g.,1.0.0-beta.1
,1.2.0-beta.24
. - Run
npm run release
to do a production release. Runnpm run release:beta
to do a beta release. - Enter your 2-factor auth key when prompted in order to publish to NPM
- You will then also want to change
/site/package.json
to this new version (or usenpm update
)
Both of these pieces could be replaced with similar products with minimal disruption.
- ActionKit, is the data store and provides marketing and chase functionality
- SmartyStreets, is used for address autocomplete and data augmentation.
- WorkElections, provides all our jurisdiction and election data.
./public
Files here are copied directly to the build output and will be available at/*
in the deployed website../styles
Root SCSS for the entire app in addition to styles injected into every component. These app-wide styles should be kept to a minimum in favor of component styles../src
Compiled TypeScript files comprising the app. Start at./src/index.html
which just has a single<app-root>
element, then look at the component in./src/components/app-root
and go from there...
- Run
npm install
to install dependencies - Run
npm run dev
to start a server locally and watch changes to files
- In
/site
, remove the npm version and reference the local version withnpm uninstall @ptp-us/power-the-polls-form
and thennpm install ../power-the-polls-form
- In
page-form.tsx
change the import fromimport "@ptp-us/power-the-polls-form";
toimport "@ptp-us/power-the-polls-form/dist";
- In
/power-the-polls-form
Usenpm run build
which will build the form and then in/site
runnpm run dev
NOTE: Watch doesn't work across the projects atm. So you'll still have to kill the process and re-run
npm run dev
if you change the form. - Make sure you don't commit this
package.json
orpage-form.tsx
Run npm run build
to do a production build. The contents of /dist/www
can then be deployed to a host or CDN.
Currently, commits to the master
branch and opened pull requests trigger automatic deploys in Netlify to the production site (master
) or a custom subdomain (PRs).
Deploy settings should look like:
command: cd site && npm install && npm run release
publish directory: /dist/www