# Panther

This project was created using the [Nuxt Starter Template](https://github.com/nuxt-community/starter-template), which has now been deprecated in favour of [create-nuxt-app](https://github.com/nuxt/create-nuxt-app).

## Build setup

See: https://nuxtjs.org/guide/commands/

``` bash
# Install dependencies
npm install

# Development mode
# Launch the development server on localhost with hot-reloading
npm start
# or
npm run dev

# Production mode
# Build for production, minify the JavaScript and CSS, and launch the server in production mode
# (you probably won't use this often because we always deploy Panther as a static site)
npm run prod

# Analyze the production Webpack bundle
npm run analyze

# Generate static project
# Build the application and generate every route as an HTML file (used for static hosting)
npm run generate

# Deploy static project via Surge
# (Surge must be installed globally first)
npm install --global surge
npm run deploy
```

For detailed explanation on how Nuxt works, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).

## Troubleshooting

If Node hangs for some reason, you may have to locate and kill the Node process (see [this StackOverflow answer](https://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac#answer-18706913)):

``` bash
# Assuming you're using port 3333
lsof -i :3333
kill -9 <PID>
```

## Prerelease dev notes

Until we've fully migrated over to Nuxt and `tgam-patterns` version `5.0.0` has been released, this codebase will publish a prerelease version of `tgam-patterns` to NPM (e.g. `5.0.0-alpha.1`). To publish a new prerelease version, run the following commands:

``` bash
npm version prerelease
npm publish --tag next
```

Then, in PageBuilder, install the latest prerelease version via:

``` bash
npm install tgam-patterns@next
```

Publishing prerelease versions with a custom tag means that `npm install tgam-patterns` and `npm install tgam-patterns@latest` will still install version `4.x` instead of `5.x`, which is ideal. See the following for more information:

- https://medium.com/@mbostock/prereleases-and-npm-e778fc5e2420
- https://docs.npmjs.com/adding-dist-tags-to-packages
