web: migrate to web platform- packages (#1405)

* migrate usages of nextjs-scripts to platform packages

* upgrade hashi packages

* use new downloads page component

* adds missing dep

* remove redundant head component

* remove styles

* remove unused prop
pull/1437/head
Bryce Kalow 5 years ago committed by GitHub
parent 6785055a4d
commit 8599b55f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
module.exports = {
...require('@hashicorp/nextjs-scripts/.eslintrc.js'),
...require('@hashicorp/platform-cli/config/.eslintrc'),
ignorePatterns: ['public/'],
}

@ -1,4 +1,4 @@
module.exports = {
...require('@hashicorp/nextjs-scripts/.stylelintrc.js'),
...require('@hashicorp/platform-cli/config/stylelint.config'),
/* Specify overrides here */
}

@ -27,6 +27,7 @@ export default function ProductSubnav() {
menuItems={subnavItems}
constrainWidth
Link={Link}
matchOnBasePath
/>
)
}

@ -1,2 +1,3 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="@hashicorp/platform-types" />

@ -1,4 +1,4 @@
const withHashicorp = require('@hashicorp/nextjs-scripts')
const withHashicorp = require('@hashicorp/platform-nextjs-plugin')
const path = require('path')
const redirects = require('./redirects.js')

File diff suppressed because it is too large Load Diff

@ -5,26 +5,30 @@
"author": "HashiCorp",
"dependencies": {
"@apidevtools/json-schema-ref-parser": "9.0.9",
"@hashicorp/mktg-global-styles": "3.0.1",
"@hashicorp/mktg-logos": "1.0.2",
"@hashicorp/nextjs-scripts": "19.0.2",
"@hashicorp/react-alert-banner": "6.1.1",
"@hashicorp/react-button": "5.0.0",
"@hashicorp/react-content": "7.0.1",
"@hashicorp/react-docs-page": "13.2.0",
"@hashicorp/react-hashi-stack-menu": "2.0.5",
"@hashicorp/react-head": "3.1.0",
"@hashicorp/react-hero": "7.2.1",
"@hashicorp/react-image": "4.0.0",
"@hashicorp/react-product-downloader": "8.0.0",
"@hashicorp/react-product-features-list": "4.0.1",
"@hashicorp/react-section-header": "5.0.2",
"@hashicorp/react-subnav": "8.1.0",
"@hashicorp/react-use-cases": "4.0.0",
"@hashicorp/react-vertical-text-block-list": "6.0.2",
"@hashicorp/mktg-global-styles": "^3.1.0",
"@hashicorp/mktg-logos": "^1.2.0",
"@hashicorp/platform-code-highlighting": "^0.1.1",
"@hashicorp/platform-runtime-error-monitoring": "^0.1.0",
"@hashicorp/platform-util": "^0.1.0",
"@hashicorp/react-alert-banner": "^6.1.2",
"@hashicorp/react-button": "^5.2.1",
"@hashicorp/react-consent-manager": "^5.3.2",
"@hashicorp/react-content": "^7.0.2",
"@hashicorp/react-docs-page": "^13.5.1",
"@hashicorp/react-enterprise-alert": "^5.0.1",
"@hashicorp/react-hashi-stack-menu": "^2.0.6",
"@hashicorp/react-head": "^3.1.1",
"@hashicorp/react-hero": "^7.3.2",
"@hashicorp/react-image": "^4.0.2",
"@hashicorp/react-product-downloads-page": "^2.3.1",
"@hashicorp/react-product-features-list": "^4.1.2",
"@hashicorp/react-section-header": "^5.0.3",
"@hashicorp/react-subnav": "^8.4.0",
"@hashicorp/react-use-cases": "^4.0.1",
"@hashicorp/react-vertical-text-block-list": "^6.0.3",
"change-case": "4.1.2",
"classnames": "2.2.6",
"next": "10.0.6",
"next": "10.2.2",
"next-mdx-remote": "3.0.1",
"react": "16.13.1",
"react-dom": "16.13.1",
@ -32,12 +36,17 @@
"react-player": "2.7.0"
},
"devDependencies": {
"@hashicorp/platform-cli": "^0.2.0",
"@hashicorp/platform-nextjs-plugin": "^0.1.0",
"@hashicorp/platform-types": "^0.1.0",
"@types/node": "^15.12.2",
"@types/react": "^17.0.11",
"dart-linkcheck": "2.0.15",
"glob": "7.1.6",
"husky": "4.3.5",
"prettier": "2.2.1"
"postcss": "^8.2.13",
"prettier": "2.2.1",
"typescript": "^4.3.5"
},
"husky": {
"hooks": {

@ -1,12 +1,12 @@
import './style.css'
import '@hashicorp/nextjs-scripts/lib/nprogress/style.css'
import NProgress from '@hashicorp/nextjs-scripts/lib/nprogress'
import createConsentManager from '@hashicorp/nextjs-scripts/lib/consent-manager'
import useAnchorLinkAnalytics from '@hashicorp/nextjs-scripts/lib/anchor-link-analytics'
import '@hashicorp/platform-util/nprogress/style.css'
import NProgress from '@hashicorp/platform-util/nprogress'
import createConsentManager from '@hashicorp/react-consent-manager/loader'
import useAnchorLinkAnalytics from '@hashicorp/platform-util/anchor-link-analytics'
import HashiStackMenu from '@hashicorp/react-hashi-stack-menu'
import Router from 'next/router'
import HashiHead from '@hashicorp/react-head'
import { ErrorBoundary } from '@hashicorp/nextjs-scripts/lib/bugsnag'
import { ErrorBoundary } from '@hashicorp/platform-runtime-error-monitoring'
import ProductSubnav from '../components/subnav'
import Footer from 'components/footer'
import Error from './_error'

@ -1,5 +1,5 @@
import NotFound from './404'
import Bugsnag from '@hashicorp/nextjs-scripts/lib/bugsnag'
import Bugsnag from '@hashicorp/platform-runtime-error-monitoring'
function Error({ statusCode }) {
return <NotFound statusCode={statusCode} />

@ -1,7 +1,6 @@
import { VERSION, DESKTOP_VERSION } from 'data/version.js'
import HashiHead from '@hashicorp/react-head'
import { productName, productSlug } from 'data/metadata'
import ProductDownloader from '@hashicorp/react-product-downloader'
import { productSlug } from 'data/metadata'
import ProductDownloadsPage from '@hashicorp/react-product-downloads-page'
import MerchDesktopClient from 'components/merch-desktop-client'
import styles from './style.module.css'
@ -9,95 +8,46 @@ const DESKTOP_BINARY_SLUG = 'boundary-desktop'
export default function DownloadsPage({ binaryReleases, desktopReleases }) {
return (
<div className={styles.root}>
<HashiHead title={`Downloads | ${productName} by HashiCorp`} />
<ProductDownloader
releases={binaryReleases}
packageManagers={[
{
label: 'Homebrew',
commands: [
'brew tap hashicorp/tap',
'brew install hashicorp/tap/boundary',
],
os: 'darwin',
},
{
label: 'Ubuntu/Debian',
commands: [
'curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -',
'sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"',
'sudo apt-get update && sudo apt-get install boundary',
],
os: 'linux',
},
{
label: 'CentOS/RHEL',
commands: [
'sudo yum install -y yum-utils',
'sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo',
'sudo yum -y install boundary',
],
os: 'linux',
},
{
label: 'Fedora',
commands: [
'sudo dnf install -y dnf-plugins-core',
'sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo',
'sudo dnf -y install boundary',
],
os: 'linux',
},
{
label: 'Amazon Linux',
commands: [
'sudo yum install -y yum-utils',
'sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo',
'sudo yum -y install boundary',
],
os: 'linux',
},
]}
latestVersion={VERSION}
getStartedLinks={[
{
label: 'Install Boundary',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-install',
},
{
label: 'Introduction to Boundary',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-intro',
},
{
label: 'Start a Development Environment',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-dev',
},
]}
logo={
<img
className={styles.logo}
alt="Boundary"
src={require('@hashicorp/mktg-logos/product/boundary/primary/color.svg')}
/>
}
product="boundary"
tutorialLink={{
label: 'View Tutorial on HashiCorp Learn',
<ProductDownloadsPage
releases={binaryReleases}
latestVersion={VERSION}
getStartedLinks={[
{
label: 'Install Boundary',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-install',
}}
merchandisingSlot={
<MerchDesktopClient
version={DESKTOP_VERSION}
releases={desktopReleases}
/>
}
/>
</div>
},
{
label: 'Introduction to Boundary',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-intro',
},
{
label: 'Start a Development Environment',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-dev',
},
]}
logo={
<img
className={styles.logo}
alt="Boundary"
src={require('@hashicorp/mktg-logos/product/boundary/primary/color.svg')}
/>
}
product="boundary"
tutorialLink={{
label: 'View Tutorial on HashiCorp Learn',
href:
'https://learn.hashicorp.com/tutorials/boundary/getting-started-install',
}}
merchandisingSlot={
<MerchDesktopClient
version={DESKTOP_VERSION}
releases={desktopReleases}
/>
}
/>
)
}

@ -1,16 +1,3 @@
.root {
/** DEBT — remove color overrides with upgrade to product-download-page */
& :global(.g-tab-trigger.active) {
& :global(.inner) {
border-bottom-color: var(--black);
}
}
& a {
color: var(--brand-link) !important;
}
}
.logo {
width: 140px;
}

@ -1,3 +1,3 @@
module.exports = {
...require('@hashicorp/nextjs-scripts/prettier.config.js'),
...require('@hashicorp/platform-cli/config/prettier.config'),
}

Loading…
Cancel
Save