Skip to content

Commit

Permalink
Update README with notes on installing from and publishing to npm. Al…
Browse files Browse the repository at this point in the history
…so, add a pull request template that adds versioning to the checklist.
  • Loading branch information
danielnaab committed Dec 17, 2018
1 parent 6738b77 commit eaa1c1c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 9 deletions.
20 changes: 20 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Before making a pull request
----------------------------

- [ ] Make sure all tests run
- [ ] Update the changelog appropriately
- [ ] Verify that the version in package.json indicates your intent to publish a release or snapshot build

Title
-----------
Brief description of changes. Reference the JIRA ticket if appropriate

Description
-----------
If no JIRA ticket is referenced, describe the changes made. Note anything that
you want the reviewers to know while reviewing your pull request

After making a pull request
---------------------------
- [ ] If appropriate, put the link to the PR in the JIRA ticket
- [ ] Assign someone to review unless the change is trivial
35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,32 @@ Provides Sass stylesheets and images that can be used when creating web pages th
meet USGS visual identity standards. The stylesheets use USWDS (https://designsystem.digital.gov/)
as the basis so all USWDS components are available.

The repo can be installed in an existing project by installing directly from github:
## Usage

The repo can be installed in an existing project by installing via npm.

```bash
npm install wdfn-viz
```
% npm install git://github.com/usgs/wdfn-viz.git

To install the latest development snapshot (containing the current state of the master branch):

```bash
npm install wdfn-viz@snapshot
```

The main Sass stylesheet that should be imported into a web page's Sass file and is at /src/stylesheets/wdfnviz.scss.
This directory should be specified on the --include-path option when the site's Sass is built. This will also include
the USWDS style sheets so a separate import is not required. When building the style sheets the css should also be
The main Sass stylesheet that should be imported into a web page's Sass file and is at /src/stylesheets/wdfnviz.scss.
This directory should be specified on the --include-path option when the site's Sass is built. This will also include
the USWDS style sheets so a separate import is not required. When building the style sheets the css should also be
processed by postcss as follows:

```
% node-sass --include-path node_modules/wdfn-via/src/stylesheets src/styles.main.css dist/main.css
% postcss dist/main.css --no-map --use autoprefixer -o dist/main.css
```

When building the assets, the images should be collected in a common directory and specified in the project's Sass
files using the $image-path variable. This should include the images in src/img that provide the USGS favicon and
When building the assets, the images should be collected in a common directory and specified in the project's Sass
files using the $image-path variable. This should include the images in src/img that provide the USGS favicon and
logos. If using USWDS images those will also need to be collected. The images include a usgs_favicon.ico that can be used
for the page's favicon by adding the following line within the <head> section:
```
Expand All @@ -33,13 +42,21 @@ for the page's favicon by adding the following line within the <head> section:
Below are examples of commands that could be used to collect the assets.
```
% mkdir -p dist/img && cp -r node_modules/uswds/src/img/* dist/img && cp -r node_modules/wdfn-viz/src/img/* dist/img
% mkdir -p dist/fonts && cp node_modules/uswds/src/fonts/* dist/fonts
% mkdir -p dist/fonts && cp node_modules/uswds/src/fonts/* dist/fonts
```

The javascript can be imported and provides USWDS javascript as well as the ability to log unhandled exceptions to
Google Analytics if window.ga is defined.

Example html templates for the header and footer can be found here: ```src/templates```. To implement the header
and footers add the markup in those templates to your pages, adjusting the image url in the header.html template
and footers add the markup in those templates to your pages, adjusting the image url in the header.html template
as needed for the USGS logo and federal government logos.

## Publishing to npm

TravisCI is configured to publish to the [wdfn-viz](https://www.npmjs.com/package/wdfn-viz) npm package when commits are made to the master branch.

To make a release, merge a commit that sets the
[version attribute in package.json](https://github.com/usgs/wdfn-viz/blob/master/package.json#L3) to the appropriate
value. When merging work that is not intended for release, append `-snapshot` to the upcoming version. Snapshot
releases will be tagged in the form `0.1.10-snapshot.6738b77`, where `6738b77` is the corresponding git commit.

0 comments on commit eaa1c1c

Please sign in to comment.