Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: swap out nuxt 2 boilerplate with nuxt 3 starter #1

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .eslintignore

This file was deleted.

33 changes: 17 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: '@babel/eslint-parser',
sourceType: 'module',
requireConfigFile: false
ecmaVersion: 'latest'
},
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'plugin:vue/essential',
'plugin:cypress/recommended'
'@nuxt/eslint-config',
'./.nuxt/.eslint.nuxt3-globals.json',
'plugin:vue/essential'
],
ignorePatterns: [
'.nuxt/',
'.output/',
'dist/'
],
// Add your custom rules here
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'no-console': process.env.NODE_ENV !== 'development' ? 'error' : 'off',
'eol-last': [2, 'always'],
'vue/html-closing-bracket-newline': ['error', {
singleline: 'never',
multiline: 'never'
Expand All @@ -37,7 +31,14 @@ module.exports = {
'no-lonely-if': 'off',
'no-new': 'off',
'no-prototype-builtins': 'off',
'promise/param-names': 'off',
'multiline-ternary': 'off',
'vue/multi-word-component-names': 'off'
'vue/multi-word-component-names': 'off',
"vue/max-attributes-per-line": ["error", {
"singleline": {
"max": 3
}
}],
'vue/script-setup-uses-vars': 'error'
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ packages/site/cypress/videos/

# Storybook
.nuxt-storybook
storybook-static
storybook-static
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-push

This file was deleted.

Empty file removed .nojekyll
Empty file.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

124 changes: 4 additions & 120 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,10 @@
# AU Nuxt Static Boilerplate

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

![Nuxt Static banner](https://raw.githubusercontent.com/agency-undone/nuxt-static/develop/static/images/open-graph.png)
# Singularity Website

## Overview

This is the boilerplate repository for building static sites using Nuxt
---
This is the repo for the Singularity marketing site.

- This repo represents a static site which requires compilation, but can then be served as a static resource
- This site can be hosted on any resource supporting static files, but may include some services that require a serverless node
- When running in production, this repository is primarily tested against the Netlify ecosystem, including Netlify Functions for any dynamic functionality
- The site itself is served statically, but internal navigation is virtualized in the browser: in other words, the site acts as an SPA when browsed on the client
- While a static site, this app can be extended at any time to a full application by changing the `target` in settings


## Stack

- Requires nodeJS and has been tested on node 16
- Uses a Vue framework, [nuxtJS 2](https://nuxtjs.org/), deployed in static mode
- Styles are written in SCSS, and are concatenated and tree-shaken during compile-time


## Setup

1) Follow "build" and "self-signed certificate" instructions below
2) Enable Github Pages for storybook deployment (Go to Github Repo > Settings > Pages > Branch - set both branch and folder to `docs`)
3) Add repo to [Fleek](https://docs.fleek.co/) for ci/cd setup or any other hosting provider


## Build

To build this site:
- Clone this repo
- Make sure Node.js 16 or newer is installed
- A version 1 lockfile will not be compatible with this site, so npm 7 or higher must be used
- Configure a self-signed certificate for local HTTPS support (see next section)
- Install npm dependencies by running `npm ci`
- Then, either generate the static site, or run it in local development mode:
- To build the static site
- Run `npm run generate`
- A directory `dist` is created, which contains the static site output
- To run in local development mode, for features like hot reload:
- Run `npm run dev`
- The site will be available in real time via a localhost URL


## Self-signed certificate

In order to use the site in local development mode, two files must be added to the repo's root directory. The following set of commands apply to a MacOS system, however, if `mkcert` is installed by another package manager, this can be run on any flavor of *nix.

```zsh
cd ~/.ssh
brew install mkcert ## replace with another package manager for linux distro
mkcert -install
mkcert -key-file localhost_key.pem -cert-file localhost_cert.pem localhost 127.0.0.1
cat localhost_cert.pem > localhost_fullchain.pem
cat "$(mkcert -CAROOT)/rootCA.pem" >> localhost_fullchain.pem
```

Now, navigate to your project directory, wherever the repo was cloned to, for example `cd ~/Sites/nuxt-static` and copy the `pem` files into the repo root. These keys are `.gitignored` by default.

```zsh
cp -v ~/.ssh/localhost_cert.pem ~/.ssh/localhost_key.pem .
```


## Updating dependencies

Please use `npm ci` in place of `npm i` when not explicitly upgrading dependencies. `npm ci` will only install versions of packages provided in the lockfile, leading to more stability.

Always regression test the site if upgrading packages, as they may contain breaking changes.


## Lint

- `npm run lint` runs `eslint` on all `.js` and `.vue` files
- Linting runs automatically as a pre-commit hook


## Commit Messages

Commit messages should use the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) format. `commitlint` has been installed to validate this usage. This means that all commits should be prefixed appropriately with a tag denoting the kind of code being committed.

- `feat:` A feature, or part of a feature
- `fix:` A bug fix
- `style:` A visual or stylistic change only
- `chore:` An operational task, such as routine maintenance, version control related operations, dependencies, etc.
- `refactor:` A change to the way the code is implemented, without materially changing the feature
- `perf:` A change that is made primarily to improve performance
- `test:` Any changes required to run a specific test or try out a behavior for the purposes of testing
- `cleanup:` Markup and syntactic cleanup that doesn't affect the code output
- `docs:` Documentation-related changes
- `content:` Changes to the project's content, such as copy or media


## Storybook

To better display the components available on the site, their properties, and the states they might appear in, a Storybook app is included in this repo.

- Each component that's developed must have its own story
- Use `npm run storybook` to run Storybook locally
- Or `npm run storybook-build` to generate a static Storybook UI website
- Storybook automatically deploys to [https://agency-undone.github.io/nuxt-static](https://agency-undone.github.io/nuxt-static) using Github pages. The static build is stored in `docs` branch under `docs` folder


## Style guide

1. All file names will be in `kebab-case`
2. All component names on import will be `PascalCase`
3. The grid used is a flexbox style system called [Gridlex](https://gridlex.devlint.fr/), its documentation is also available as a [readme in this repo](packages/site/assets/scss/grid/README.md)
4. Color name variables in `SCSS` are obtained from [this resource](https://chir.ag/projects/name-that-color/)


## [Release Please](https://github.com/googleapis/release-please)

- Release Please automates CHANGELOG generation, the creation of GitHub releases, and version bumps for your projects.
- It is currently setup as a github action in this repo
- See [documentation](https://github.com/googleapis/release-please) on how to use


## [Cypress](https://go.cypress.io/) as e2e test

- Cypress is setup as e2e test for the repo
- See [documentation](https://go.cypress.io/) on how to use
- While a static site, this app can be extended at any time to a full application by changing the target in settings
1 change: 0 additions & 1 deletion _redirects

This file was deleted.

29 changes: 0 additions & 29 deletions app.html

This file was deleted.

7 changes: 7 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>
32 changes: 0 additions & 32 deletions app/router.scrollBehavior.js

This file was deleted.

Binary file added assets/fonts/DIN/DIN-Black.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Black.ttf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-BlackItalic.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Bold.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-BoldItalic.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Light.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Light.ttf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-LightItalic.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Medium.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-MediumAlternate.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-MediumAlternate.ttf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-MediumItalic.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Regular.otf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/DIN/DIN-RegularItalic.otf
Binary file not shown.
Binary file not shown.
Binary file removed assets/fonts/eb-garamond/eb-garamond-variable.woff2
Binary file not shown.
28 changes: 0 additions & 28 deletions assets/scss/block.scss

This file was deleted.

23 changes: 23 additions & 0 deletions assets/scss/core/core.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* This file should only contain imports and stable, portable and long-lasting
* SCSS declarations.
*/

//////////////////////////////////////////////////////////////////////// Imports
//------------------------------------------------------------------------------
@import 'normalize';
@import 'grid/gridlex-2.7.1';
@import 'reset';
@import 'layout-grid';

//////////////////////////////////////////////////////////////////////// General
//------------------------------------------------------------------------------
html,
body {
&.no-scroll {
overflow-y: hidden;
}
&.no-cursor {
cursor: none;
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $gl-mq-width: 'max-width' !default;
$gl-mq-list: (
ulg: 140.625rem, // 2250px
xlg: 90rem, // 1440px
lg: 85rem, // 1360px
lg: 75rem, // 1200px
md: 64rem, // 1024px
sm: 53.125rem, // 850px
mi: 40rem, // 640px
Expand Down
Loading