@newhighsco/press-start 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # ⚡️ Press Start [![Github version](https://img.shields.io/github/v/release/newhighsco/press-start)](https://github.com/newhighsco/press-start/releases)
2
+
3
+ Get a theme-able Next.js site up and running quickly
4
+
5
+ ## Setup
6
+
7
+ Install dependencies
8
+
9
+ ```
10
+ nvm install
11
+ yarn install
12
+ ```
13
+
14
+ ## Run
15
+
16
+ All project processes can be started using the following:
17
+
18
+ ```
19
+ yarn start
20
+ ```
21
+
22
+ ## Testing
23
+
24
+ Runs all the automated QA tools
25
+
26
+ This can be run using:
27
+
28
+ ```
29
+ yarn test
30
+ ```
31
+
32
+ ## Build
33
+
34
+ Generate a production build of the site using the following:
35
+
36
+ ```
37
+ yarn build
38
+ ```
39
+
40
+ ## [CHANGELOG](CHANGELOG.md)
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@newhighsco/press-start",
3
+ "description": "Chipset + Next.js site starter by New High Score",
4
+ "version": "2.0.0",
5
+ "author": "New High Score <hello@newhighsco.re>",
6
+ "license": "ISC",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/newhighsco/press-start.git"
10
+ },
11
+ "homepage": "https://github.com/newhighsco/press-start#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/newhighsco/press-start/issues"
14
+ },
15
+ "main": "src/index.js",
16
+ "files": [
17
+ "src"
18
+ ],
19
+ "scripts": {
20
+ "postinstall": "yarn --cwd template install",
21
+ "prestart": "yarn start:yalc",
22
+ "start": "yarn --cwd template start",
23
+ "prebuild": "yarn yalc",
24
+ "build": "yarn --cwd template build",
25
+ "serve": "yarn --cwd template serve",
26
+ "test": "yarn lint",
27
+ "lint": "npm-run-all --parallel lint:*",
28
+ "lint:js": "eslint --cache --ext .js,.json,.jsx,.mdx .",
29
+ "lint:css": "stylelint '**/*.{css,scss}' --cache",
30
+ "format": "npm-run-all --parallel format:*",
31
+ "format:js": "yarn lint:js --fix",
32
+ "format:css": "yarn lint:css --fix",
33
+ "yalc": "yalc publish && cd template && yalc add $npm_package_name",
34
+ "yalc:check": "cd template && yalc check",
35
+ "yalc:remove": "cd template && yalc remove $npm_package_name"
36
+ },
37
+ "dependencies": {
38
+ "next-seo": "4.27.0"
39
+ },
40
+ "devDependencies": {
41
+ "@commitlint/cli": "13.1.0",
42
+ "@newhighsco/commitlint-config": "1.0.14",
43
+ "@newhighsco/editor-config": "1.1.2",
44
+ "@newhighsco/eslint-config": "2.3.28",
45
+ "@newhighsco/prettier-config": "2.0.14",
46
+ "@newhighsco/release-config": "1.0.68",
47
+ "@newhighsco/stylelint-config": "2.0.46",
48
+ "eslint": "7.32.0",
49
+ "husky": "7.0.2",
50
+ "npm-run-all": "4.1.5",
51
+ "prettier": "2.4.1",
52
+ "semantic-release": "18.0.0",
53
+ "stylelint": "13.13.1",
54
+ "yalc": "1.0.0-pre.53"
55
+ },
56
+ "peerDependencies": {
57
+ "next": "11.1.2"
58
+ },
59
+ "commitlint": {
60
+ "extends": [
61
+ "@newhighsco"
62
+ ]
63
+ },
64
+ "eslintConfig": {
65
+ "extends": [
66
+ "@newhighsco/eslint-config/react"
67
+ ]
68
+ },
69
+ "husky": {
70
+ "hooks": {
71
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
72
+ "pre-commit": "yarn yalc:check && yarn lint"
73
+ }
74
+ },
75
+ "prettier": "@newhighsco/prettier-config",
76
+ "release": {
77
+ "extends": "@newhighsco/release-config",
78
+ "branches": [
79
+ "main"
80
+ ]
81
+ },
82
+ "renovate": {
83
+ "extends": [
84
+ "@newhighsco"
85
+ ],
86
+ "baseBranches": [
87
+ "main"
88
+ ]
89
+ },
90
+ "stylelint": {
91
+ "extends": [
92
+ "@newhighsco/stylelint-config"
93
+ ]
94
+ }
95
+ }
@@ -0,0 +1,62 @@
1
+ import React from 'react'
2
+ import { func, object } from 'prop-types'
3
+ import urlJoin from 'url-join'
4
+ import { DefaultSeo } from 'next-seo'
5
+ import { SiteContainer, ThemeProvider } from '@newhighsco/chipset'
6
+
7
+ const AppPage = ({ Component, pageProps, theme, config, meta }) => {
8
+ const { name, description, openGraphImage, twitterHandle, themeColor, logo } =
9
+ config
10
+ const url = process.env.NEXT_PUBLIC_SITE_URL
11
+
12
+ meta = {
13
+ ...meta,
14
+ titleTemplate: `%s | ${name}`,
15
+ description,
16
+ openGraph: {
17
+ site_name: name,
18
+ type: 'website',
19
+ images: [{ url: urlJoin(url, openGraphImage) }]
20
+ },
21
+ twitter: {
22
+ cardType: 'summary',
23
+ site: `@${twitterHandle}`,
24
+ handle: `@${twitterHandle}`
25
+ },
26
+ additionalMetaTags: [
27
+ ...(meta?.additionalMetaTags || []),
28
+ { name: 'theme-color', content: themeColor }
29
+ ],
30
+ additionalLinkTags: [
31
+ ...(meta?.additionalLinkTags || []),
32
+ {
33
+ rel: 'icon',
34
+ href: logo.vector
35
+ },
36
+ {
37
+ rel: 'sitemap',
38
+ type: 'application/xml',
39
+ href: '/sitemap.xml'
40
+ }
41
+ ]
42
+ }
43
+
44
+ return (
45
+ <ThemeProvider themes={theme}>
46
+ <SiteContainer>
47
+ <DefaultSeo {...meta} />
48
+ <Component {...pageProps} />
49
+ </SiteContainer>
50
+ </ThemeProvider>
51
+ )
52
+ }
53
+
54
+ AppPage.propTypes = {
55
+ Component: func,
56
+ pageProps: object,
57
+ theme: object,
58
+ config: object,
59
+ meta: object
60
+ }
61
+
62
+ export default AppPage
@@ -0,0 +1,49 @@
1
+ import React from 'react'
2
+ import { array, bool, node, object, string } from 'prop-types'
3
+ import { NextSeo } from 'next-seo'
4
+
5
+ const Meta = ({
6
+ children,
7
+ canonical,
8
+ customTitle,
9
+ title,
10
+ titleTemplate,
11
+ description,
12
+ images,
13
+ openGraph,
14
+ ...rest
15
+ }) => {
16
+ const meta = {
17
+ title,
18
+ titleTemplate: customTitle ? `%s` : titleTemplate,
19
+ description,
20
+ canonical,
21
+ openGraph: {
22
+ ...openGraph,
23
+ title,
24
+ description,
25
+ url: canonical,
26
+ images
27
+ }
28
+ }
29
+
30
+ return (
31
+ <>
32
+ <NextSeo {...meta} {...rest} />
33
+ {children}
34
+ </>
35
+ )
36
+ }
37
+
38
+ Meta.propTypes = {
39
+ children: node,
40
+ canonical: string,
41
+ customTitle: bool,
42
+ title: string,
43
+ titleTemplate: string,
44
+ description: string,
45
+ images: array,
46
+ openGraph: object
47
+ }
48
+
49
+ export default Meta
@@ -0,0 +1,2 @@
1
+ export { default as AppPage } from './AppPage'
2
+ export { default as Meta } from './Meta'
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './components'