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

* migrate usages of nextjs-scripts to platform packages

* Updates hashi packages
This commit is contained in:
Bryce Kalow 2021-07-27 17:43:40 -05:00 committed by GitHub
parent 1b07add3cc
commit 7d3febfccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 3033 additions and 1535 deletions

View file

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

View file

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

View file

@ -1,5 +1,5 @@
import md from '@hashicorp/nextjs-scripts/markdown/markdown-to-html'
import mdInline from '@hashicorp/nextjs-scripts/markdown/markdown-to-inline-html'
import md from '@hashicorp/platform-markdown-utils/markdown-to-html'
import mdInline from '@hashicorp/platform-markdown-utils/markdown-to-inline-html'
export default async function processBeforeAfterDiagramProps(props) {
const { beforeHeadline, beforeContent, afterHeadline, afterContent } = props

View file

@ -19,7 +19,8 @@ export default function ProductSubnav() {
},
{
text: 'Try Cloud',
url: 'https://portal.cloud.hashicorp.com/sign-up?utm_source=vault_io&utm_content=top_nav_vault',
url:
'https://portal.cloud.hashicorp.com/sign-up?utm_source=vault_io&utm_content=top_nav_vault',
},
{
text: 'Download',
@ -30,6 +31,7 @@ export default function ProductSubnav() {
menuItems={menuItems}
menuItemsAlign="right"
constrainWidth
matchOnBasePath
/>
)
}

View file

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

View file

@ -1,4 +1,4 @@
const withHashicorp = require('@hashicorp/nextjs-scripts')
const withHashicorp = require('@hashicorp/platform-nextjs-plugin')
const redirects = require('./redirects.next')
module.exports = withHashicorp({

4455
website/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,31 +4,35 @@
"version": "1.0.0",
"author": "HashiCorp",
"dependencies": {
"@hashicorp/mktg-global-styles": "3.0.2",
"@hashicorp/mktg-logos": "1.2.0",
"@hashicorp/nextjs-scripts": "19.0.2",
"@hashicorp/react-alert-banner": "6.1.1",
"@hashicorp/react-button": "5.1.0",
"@hashicorp/react-case-study-slider": "6.1.0",
"@hashicorp/react-code-block": "4.1.2",
"@hashicorp/react-content": "7.0.1",
"@hashicorp/react-docs-page": "13.4.0",
"@hashicorp/react-featured-slider": "4.1.0",
"@hashicorp/react-hashi-stack-menu": "2.0.5",
"@hashicorp/react-head": "3.1.0",
"@hashicorp/react-hero": "7.3.0",
"@hashicorp/react-image": "4.0.1",
"@hashicorp/react-inline-svg": "6.0.1",
"@hashicorp/react-logo-grid": "4.1.0",
"@hashicorp/react-markdown-page": "1.2.0",
"@hashicorp/react-product-downloads-page": "2.1.0",
"@hashicorp/react-section-header": "5.0.2",
"@hashicorp/react-subnav": "8.3.0",
"@hashicorp/react-tabs": "6.0.1",
"@hashicorp/react-text-split": "3.2.0",
"@hashicorp/react-text-splits": "3.2.2",
"@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-markdown-utils": "^0.1.3",
"@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-case-study-slider": "^6.1.2",
"@hashicorp/react-code-block": "^4.1.4",
"@hashicorp/react-consent-manager": "^5.3.2",
"@hashicorp/react-content": "^7.0.2",
"@hashicorp/react-docs-page": "^13.5.1",
"@hashicorp/react-featured-slider": "^4.1.2",
"@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-inline-svg": "^6.0.2",
"@hashicorp/react-logo-grid": "^4.1.2",
"@hashicorp/react-markdown-page": "^1.3.1",
"@hashicorp/react-product-downloads-page": "^2.3.1",
"@hashicorp/react-section-header": "^5.0.3",
"@hashicorp/react-subnav": "^8.4.0",
"@hashicorp/react-tabs": "^6.0.1",
"@hashicorp/react-text-split": "^3.2.2",
"@hashicorp/react-text-splits": "^3.2.5",
"@hashicorp/react-use-cases": "^4.0.1",
"@hashicorp/react-vertical-text-block-list": "^6.0.3",
"next": "10.2.2",
"next-mdx-remote": "3.0.2",
"next-remote-watch": "1.0.0",
@ -37,11 +41,15 @@
"tippy.js": "4.0.0"
},
"devDependencies": {
"@hashicorp/platform-cli": "^0.2.0",
"@hashicorp/platform-nextjs-plugin": "^0.1.0",
"@hashicorp/platform-types": "^0.1.0",
"@types/react": "^17.0.11",
"dart-linkcheck": "^2.0.15",
"husky": "^4.3.8",
"inquirer": "^8.1.1",
"prettier": "^2.3.1"
"prettier": "^2.3.1",
"typescript": "^4.3.5"
},
"husky": {
"hooks": {

View file

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

View file

@ -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} />

View file

@ -7,7 +7,7 @@ import BeforeAfterDiagram from '../../components/before-after-diagram'
import HcpCalloutSection from 'components/hcp-callout-section'
// Imports below are used in getStaticProps only
import RAW_CONTENT from './content.json'
import highlightData from '@hashicorp/nextjs-scripts/prism/highlight-data'
import highlightData from '@hashicorp/platform-code-highlighting/highlight-data'
import processBeforeAfterDiagramProps from 'components/before-after-diagram/server'
export async function getStaticProps() {
@ -31,7 +31,8 @@ export default function Homepage({ content }) {
{
external: false,
title: 'Try Cloud',
url: 'https://portal.cloud.hashicorp.com/sign-up?utm_source=vault_io&utm_content=hero',
url:
'https://portal.cloud.hashicorp.com/sign-up?utm_source=vault_io&utm_content=hero',
},
{
external: false,
@ -140,7 +141,8 @@ export default function Homepage({ content }) {
links={[
{
text: 'Learn More',
url: 'https://cloud.hashicorp.com/?utm_source=vault_io&utm_content=hcp_vault_detail',
url:
'https://cloud.hashicorp.com/?utm_source=vault_io&utm_content=hcp_vault_detail',
},
]}
/>

View file

@ -13,7 +13,6 @@
@import '~@hashicorp/react-button/styles/index.css';
@import '~@hashicorp/react-content/style.css';
@import '~@hashicorp/react-docs-page/style.css';
@import '~@hashicorp/react-enterprise-alert/style.css';
@import '~@hashicorp/react-featured-slider/style.css';
@import '~@hashicorp/react-hero/style.css';
@import '~@hashicorp/react-logo-grid/style.css';

View file

@ -5,7 +5,7 @@ import BeforeAfterDiagram from 'components/before-after-diagram'
import UseCaseCtaSection from 'components/use-case-cta-section'
// Imports below are used in getStaticProps
import RAW_CONTENT from './content.json'
import highlightData from '@hashicorp/nextjs-scripts/prism/highlight-data'
import highlightData from '@hashicorp/platform-code-highlighting/highlight-data'
import processBeforeAfterDiagramProps from 'components/before-after-diagram/server'
export async function getStaticProps() {

View file

@ -5,7 +5,7 @@ import BeforeAfterDiagram from 'components/before-after-diagram'
import UseCaseCtaSection from 'components/use-case-cta-section'
// Imports below are used in getStaticProps
import RAW_CONTENT from './content.json'
import highlightData from '@hashicorp/nextjs-scripts/prism/highlight-data'
import highlightData from '@hashicorp/platform-code-highlighting/highlight-data'
import processBeforeAfterDiagramProps from 'components/before-after-diagram/server'
export async function getStaticProps() {

View file

@ -5,7 +5,7 @@ import BeforeAfterDiagram from 'components/before-after-diagram'
import UseCaseCtaSection from 'components/use-case-cta-section'
// Imports below are used in getStaticProps
import RAW_CONTENT from './content.json'
import highlightData from '@hashicorp/nextjs-scripts/prism/highlight-data'
import highlightData from '@hashicorp/platform-code-highlighting/highlight-data'
import processBeforeAfterDiagramProps from 'components/before-after-diagram/server'
import FeaturedSlider from '@hashicorp/react-featured-slider'
@ -59,11 +59,13 @@ export default function SecretsManagmentUseCase({ content }) {
features={[
{
logo: {
url: 'https://www.datocms-assets.com/2885/1539889072-1524097013-adobe-white-1.svg',
url:
'https://www.datocms-assets.com/2885/1539889072-1524097013-adobe-white-1.svg',
alt: 'Adobe Logo',
},
image: {
url: 'https://www.datocms-assets.com/2885/1520367019-dan_mcteer_adobe_hashiconf2017.jpg?fit=crop&amp;fm=jpg&amp;h=312.5&amp;q=80&amp;w=500',
url:
'https://www.datocms-assets.com/2885/1520367019-dan_mcteer_adobe_hashiconf2017.jpg?fit=crop&amp;fm=jpg&amp;h=312.5&amp;q=80&amp;w=500',
alt: 'Dan McTeer at HashiConf 2017',
},
heading:
@ -72,7 +74,8 @@ export default function SecretsManagmentUseCase({ content }) {
'Securing secrets and application data is a complex task for globally distributed organizations. For Adobe, managing secrets for over 20 products across 100,000 hosts, four regions, and trillions of transactions annually requires a different approach altogether.',
link: {
text: 'Read Case Study',
url: 'https://www.hashicorp.com/resources/adobe-100-trillion-transactions-hashicorp-vault',
url:
'https://www.hashicorp.com/resources/adobe-100-trillion-transactions-hashicorp-vault',
type: 'outbound',
},
},

View file

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