From a8a3bf0643975c3375ffcff9e052d916fe46a10b Mon Sep 17 00:00:00 2001 From: Vadorequest Date: Sat, 9 Jan 2021 18:18:21 +0100 Subject: [PATCH] Documentation update for `v2-mst-aptd-at-lcz-sty` (#240) --- .../workflows/deploy-vercel-production.yml | 1 + .github/workflows/deploy-vercel-staging.yml | 1 + .../workflows/update-codeclimate-coverage.yml | 7 +- docs/_sass/custom/custom.scss | 24 ++- package.json | 19 +- src/components/pageLayouts/Footer.tsx | 36 +--- .../examples/built-in-features/analytics.tsx | 61 +++++- src/pages/api/preview.ts | 47 ++--- src/pages/api/startVercelDeployment.ts | 126 ++++++------ src/utils/cookies/cookieConsent.ts | 1 + src/utils/monitoring/sentry.ts | 2 +- yarn.lock | 184 +++++++++--------- 12 files changed, 286 insertions(+), 223 deletions(-) diff --git a/.github/workflows/deploy-vercel-production.yml b/.github/workflows/deploy-vercel-production.yml index 58d95137d..3d336f4e8 100644 --- a/.github/workflows/deploy-vercel-production.yml +++ b/.github/workflows/deploy-vercel-production.yml @@ -36,6 +36,7 @@ on: push: # Triggers on each pushed commit branches: - 'master' + - 'main' # Allow manual trigger via a button in github or a HTTP call - See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow # XXX Read more about how to use it with NRN in .github/WORKFLOW_DISPATCH.md diff --git a/.github/workflows/deploy-vercel-staging.yml b/.github/workflows/deploy-vercel-staging.yml index 47c10a46a..15f7dabc0 100644 --- a/.github/workflows/deploy-vercel-staging.yml +++ b/.github/workflows/deploy-vercel-staging.yml @@ -36,6 +36,7 @@ on: push: # Triggers on each pushed commit branches-ignore: - 'master' + - 'main' # Allow manual trigger via a button in github or a HTTP call - See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow # XXX Read more about how to use it with NRN in .github/WORKFLOW_DISPATCH.md diff --git a/.github/workflows/update-codeclimate-coverage.yml b/.github/workflows/update-codeclimate-coverage.yml index 75ca16feb..049dffbc8 100644 --- a/.github/workflows/update-codeclimate-coverage.yml +++ b/.github/workflows/update-codeclimate-coverage.yml @@ -1,6 +1,7 @@ # Summary: -# Run Unit and coverage tests, then upload it to Code Climate dashboard -# Read ./README.md for extensive documentation +# Runs unit and coverage tests, then uploads the coverage results to the Code Climate dashboard. +# +# LEARN MORE AT https://unlyed.github.io/next-right-now/guides/ci-cd/ # # Dependencies overview: # - https://github.com/paambaati/codeclimate-action https://github.com/paambaati/codeclimate-action/tree/v2.6.0 @@ -10,7 +11,7 @@ name: Update Code Climate test coverage on: push: branches: - - 'v2-mst-aptd-at-lcz-sty' # Change this branch name by your CodeClimate "main" branch use + - 'v2-mst-aptd-at-lcz-sty' # Change this branch name by your CodeClimate "main" branch jobs: # Configures the deployment environment, install dependencies (like node, npm, etc.) that are requirements for the upcoming jobs diff --git a/docs/_sass/custom/custom.scss b/docs/_sass/custom/custom.scss index 2a2d68f85..50a2c78f7 100644 --- a/docs/_sass/custom/custom.scss +++ b/docs/_sass/custom/custom.scss @@ -1,8 +1,28 @@ // XXX Overrides CSS styles - See https://pmarsceill.github.io/just-the-docs/docs/customization/#override-and-completely-custom-styles blockquote { - border-left: #f4f1fa 1px solid; - padding-left: 25px; + background: #f9f9f9; + border-left: 3px solid #a493f2; + margin: 1.5em 10px; + padding: 0.5em 10px; + + &:before, + &:after { + color: #a493f2; + } + + &:before { + content: '"'; + } + + &:after { + content: '"'; + } + + p:first-child, + p:last-child { + display: inline; + } } .pagination-section { diff --git a/package.json b/package.json index ec58e9a16..5db46c8fa 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "scripts": { "start": ". ./scripts/populate-git-env.sh && next dev --port 8888", "start:tunnel": "ngrok http 8888", - "build": "yarn test:once && next build", - "build:profiler": "next build --profile", + "build": "yarn test:once:group:no-integration && next build", + "build:profiler": ". ./scripts/populate-git-env.sh && next build --profile --debug", "analyse:bundle": "yarn analyse:bundle:production", "analyse:bundle:development": "ANALYZE_BUNDLE=true yarn start", "analyse:bundle:production": "ANALYZE_BUNDLE=true next build", @@ -23,12 +23,12 @@ "deploy:customer1:production": "yarn deploy:customer1:production:simple && yarn e2e:customer1:production", "deploy:customer1:production:simple": "yarn vercel:cleanup && yarn vercel:deploy --local-config=vercel.customer1.production.json --prod", "deploy:customer2:all": "yarn deploy:customer2 && yarn deploy:customer2:production", - "deploy:customer2": "yarn vercel:cleanup && yarn vercel:deploy --local-config=vercel.customer2.staging.json --debug", + "deploy:customer2": "yarn vercel:cleanup && yarn vercel:deploy --local-config=vercel.customer2.staging.json", "deploy:customer2:production": "yarn deploy:customer2:production:simple && yarn e2e:customer2:production", "deploy:customer2:production:simple": "yarn vercel:cleanup && yarn vercel:deploy --local-config=vercel.customer2.production.json --prod", "deploy:fake": "git commit --allow-empty -m \"Fake empty commit (force CI trigger)\"", - "vercel:cleanup": "npx del-cli .vercel/ && npx del-cli .vercel/", - "vercel:deploy": ". ./scripts/populate-git-env.sh && vercel -b GIT_COMMIT_TAGS=$GIT_COMMIT_TAGS -b GIT_COMMIT_REF=$GIT_COMMIT_REF -b GIT_COMMIT_SHA=$GIT_COMMIT_SHA --confirm --debug --force", + "vercel:cleanup": "npx del-cli .vercel/", + "vercel:deploy": ". ./scripts/populate-git-env.sh && vercel --build-env GIT_COMMIT_TAGS=$GIT_COMMIT_TAGS --build-env GIT_COMMIT_REF=$GIT_COMMIT_REF --build-env GIT_COMMIT_SHA=$GIT_COMMIT_SHA --confirm --debug --force", "script:populate-git-env:print": ". ./scripts/populate-git-env.sh && echo 'SHA: '${GIT_COMMIT_SHA} && echo 'REF (current branch/tag): '${GIT_COMMIT_REF} && echo 'TAGS: '${GIT_COMMIT_TAGS}", "git:getReleasesAndTags": "git tag --points-at HEAD | tr '\\r\\n' ' '", "git:getCommitSHA": "git rev-parse HEAD", @@ -45,11 +45,12 @@ "e2e:run": "CYPRESS_STAGE=${CYPRESS_STAGE:-development}; cypress run --config-file cypress/config-$CYPRESS_STAGE.json", "e2e:run:spec:common": "CYPRESS_STAGE=${CYPRESS_STAGE:-development}; cypress run --config-file cypress/config-$CYPRESS_STAGE.json --spec 'cypress/integration/app/common/*.js'", "e2e:ci": "yarn e2e:install && cypress run --record", - "preversion": "yarn lint:once && yarn test:once", - "release": "yarn bump --commit --tag && git add CHANGELOG.md README.md && git commit --amend --no-edit && git push && git push --tags", "doc:start": "cd docs/ && bundle exec jekyll serve --config _config-development.yml", "doc:start:fast": "cd docs/ && bundle exec jekyll serve --config _config-development.yml --incremental", "doc:gem:install": "cd docs/ && bundle install", + "doc": "yarn doc:online", + "doc:online": "open-cli https://unlyed.github.io/next-right-now/", + "doc:online:scripts": "open-cli https://unlyed.github.io/next-right-now/guides/scripts-and-utilities", "bump:major": "git commit --allow-empty -m \"(MAJOR) Empty commit, bumps MAJOR version\"", "bump:minor": "git commit --allow-empty -m \"(MINOR) Empty commit, bumps MINOR version\"", "lint": "esw src/ -w --ext .ts --ext .tsx", @@ -217,10 +218,10 @@ "next-unused": "0.0.3", "ngrok": "3.3.0", "node-mocks-http": "1.9.0", + "open-cli": "6.0.1", "react-test-renderer": "16.13.1", "ts-jest": "26.3.0", "typescript": "4.0.2", - "vercel": "21.0.0", - "version-bump-prompt": "6.1.0" + "vercel": "21.0.0" } } diff --git a/src/components/pageLayouts/Footer.tsx b/src/components/pageLayouts/Footer.tsx index 630b647c1..2dd4327f5 100644 --- a/src/components/pageLayouts/Footer.tsx +++ b/src/components/pageLayouts/Footer.tsx @@ -5,7 +5,6 @@ import { useTranslation } from 'react-i18next'; import { NRN_CO_BRANDING_LOGO_URL } from '../../constants'; import useCustomer from '../../hooks/useCustomer'; -import useUserSession, { UserSession } from '../../hooks/useUserSession'; import { CSSStyles } from '../../types/CSSStyles'; import { AirtableRecord } from '../../types/data/AirtableRecord'; import { Asset } from '../../types/data/Asset'; @@ -16,7 +15,6 @@ import AirtableAsset from '../assets/AirtableAsset'; import Logo from '../assets/Logo'; import I18nBtnChangeLocale from '../i18n/I18nBtnChangeLocale'; import I18nLink from '../i18n/I18nLink'; -import DisplayOnBrowserMount from '../rehydration/DisplayOnBrowserMount'; type Props = { style?: CSSStyles; @@ -27,12 +25,15 @@ const Footer: React.FunctionComponent = (props) => { style, } = props; const { t } = useTranslation(); - const { deviceId }: UserSession = useUserSession(); const customer: Customer = useCustomer(); const { availableLanguages } = customer; const shouldDisplayI18nButton = availableLanguages?.length > 1; const theme = useTheme(); - const { backgroundColor, onBackgroundColor, logo } = theme; + const { + backgroundColor, + onBackgroundColor, + logo, + } = theme; const logoSizesMultipliers = [ { size: SIZE_XS, @@ -137,33 +138,6 @@ const Footer: React.FunctionComponent = (props) => { {t('footer.privacy.link', 'Politique de confidentialité')} -
- - Device id (analytics):
- , - // that can be rendered using both SSG/SSR depending on the page, where SSR should render the component but SSG should wait for browser re-render - deps={[deviceId]} - > - {deviceId} - -
-
{ shouldDisplayI18nButton && ( diff --git a/src/pages/[locale]/examples/built-in-features/analytics.tsx b/src/pages/[locale]/examples/built-in-features/analytics.tsx index c97e85cc2..8868fcabc 100644 --- a/src/pages/[locale]/examples/built-in-features/analytics.tsx +++ b/src/pages/[locale]/examples/built-in-features/analytics.tsx @@ -1,4 +1,5 @@ import { Amplitude } from '@amplitude/react-amplitude'; +import { css } from '@emotion/core'; import { createLogger } from '@unly/utils-simple-logger'; import { GetStaticPaths, @@ -19,6 +20,7 @@ import DisplayOnBrowserMount from '../../../../components/rehydration/DisplayOnB import Code from '../../../../components/utils/Code'; import ExternalLink from '../../../../components/utils/ExternalLink'; import useUserConsent from '../../../../hooks/useUserConsent'; +import useUserSession, { UserSession } from '../../../../hooks/useUserSession'; import { LogEvent } from '../../../../types/Amplitude'; import { CommonServerSideParams } from '../../../../types/nextjs/CommonServerSideParams'; import { OnlyBrowserPageProps } from '../../../../types/pageProps/OnlyBrowserPageProps'; @@ -60,7 +62,11 @@ export const getStaticProps: GetStaticProps>; const ExampleAnalyticsPage: NextPage = (props): JSX.Element => { - const { isUserOptedOutOfAnalytics, hasUserGivenAnyCookieConsent } = useUserConsent(); + const { + isUserOptedOutOfAnalytics, + hasUserGivenAnyCookieConsent, + } = useUserConsent(); + const { deviceId }: UserSession = useUserSession(); return ( = (props): JSX.Element => { `} /> +
+ +
+

+ Your Amplitude Device ID +

+ + + This is only informational, your activity on this website is being tracked for analytics purposes and demonstration on how to perform analytics with Next.js and Amplitude (this uses userSessionContext store provider). + + + , + // that can be rendered using both SSG/SSR depending on the page, where SSR should render the component but SSG should wait for browser re-render + deps={[deviceId]} + > + {deviceId} + + +
+
+ + , + // that can be rendered using both SSG/SSR depending on the page, where SSR should render the component but SSG should wait for browser re-render + deps={[deviceId]} + > + {deviceId} + + `} + /> +
+ )} diff --git a/src/pages/api/preview.ts b/src/pages/api/preview.ts index 7fd1e7560..0905eae31 100644 --- a/src/pages/api/preview.ts +++ b/src/pages/api/preview.ts @@ -22,32 +22,34 @@ const logger = createLogger({ */ export const NO_AUTO_PREVIEW_MODE_KEY = 'noAutoPreviewMode'; -type EndpointRequest = NextApiRequest & { - query: { - /** - * Whether to start/stop the Preview Mode. - * - * @example ?stop=true Will stop the preview mode. - * @example ?stop=false Will start the preview mode. - * @default ?stop=false - */ - stop: string; +type EndpointRequestQuery = { + /** + * Whether to start/stop the Preview Mode. + * + * @example ?stop=true Will stop the preview mode. + * @example ?stop=false Will start the preview mode. + * @default ?stop=false + */ + stop: string; - /** - * Url to redirect to once the preview mode has been started/stopped. - * - * @example ?redirectTo=/en - * @example ?redirectTo=/fr/solutions - * @default ?redirectTo=/ - */ - redirectTo: string; - } + /** + * Url to redirect to once the preview mode has been started/stopped. + * + * @example ?redirectTo=/en + * @example ?redirectTo=/fr/solutions + * @default ?redirectTo=/ + */ + redirectTo: string; +} + +type EndpointRequest = NextApiRequest & { + query: EndpointRequestQuery; }; /** - * Preview Mode API + * Preview Mode API. * - * Enables and disables preview mode + * Enables and disables preview mode. * * The official example uses a security token to enable the preview mode, we don't. * This is a choice, as we don't need/want to protect our preview mode. @@ -56,6 +58,7 @@ type EndpointRequest = NextApiRequest & { * * @param req * @param res + * @method GET * * @see https://nextjs.org/docs/advanced-features/preview-mode#step-1-create-and-access-a-preview-api-route * @see https://nextjs.org/docs/advanced-features/preview-mode#clear-the-preview-mode-cookies @@ -67,7 +70,7 @@ export const preview = async (req: EndpointRequest, res: NextApiResponse): Promi const { stop = 'false', redirectTo = '/', - } = req.query; + }: EndpointRequestQuery = req.query; // Add NO_AUTO_PREVIEW_MODE_KEY parameter to query, to avoid running into infinite loops if the Preview mode couldn't start // Useful when the cookie created by Next.js cannot be written (Incognito mode) const safeRedirectUrl = appendQueryParameter(filterExternalAbsoluteUrl(redirectTo as string), `${NO_AUTO_PREVIEW_MODE_KEY}=true`); diff --git a/src/pages/api/startVercelDeployment.ts b/src/pages/api/startVercelDeployment.ts index 24bcab822..54ebeaab0 100644 --- a/src/pages/api/startVercelDeployment.ts +++ b/src/pages/api/startVercelDeployment.ts @@ -17,68 +17,70 @@ const logger = createLogger({ label: fileLabel, }); +type EndpointRequestQuery = { + /** + * Customer authentication token. (security) + * + * Used to make sure "naked" calls to the endpoint won't trigger a production deployment. + * E.g: A bot calling "/api/startVercelDeployment" will not trigger a deployment, because no token is provided. + * + * Used to make sure the request is authenticated, by using a token that belongs to the current customer. + * E.g: A customer A might call the "/api/startVercelDeployment" endpoint of another customer B, using the token of customer A will not work. + * + * @example ?customerAuthToken=customer1 Token for customer1 + * @example ?customerAuthToken=customer2 Token for customer2 + */ + customerAuthToken: string; + + /** + * Release reference of the platform. + * Basically, a Git commit hash, branch name, or tag. + * + * The ref used will be used to locate what version of the source code should be used for the deployment. + * + * XXX By design, should use the same ref as the one used by the staging environment, by default. + * This way, a customer who deploys a new version always use the same source code version as the staging version they have tested upon. + * + * @example ?platformReleaseRef=main + * @example ?platformReleaseRef=nrn-v2-mst-aptd-gcms-lcz-sty-c1 + * @example ?platformReleaseRef=my-git-branch + * @example ?platformReleaseRef=my-git-tag + * @example ?platformReleaseRef=252b76314184fbeaa236c336c70ea42ca89e0e87 + */ + platformReleaseRef?: string; + + /** + * Url to redirect to, once the deployment has been triggered. + * + * Will not wait for the actual deployment to be done, will not return whether the trigger was successful either. + * + * XXX We can't wait for the deployment to be performed by Vercel, as it'd definitely be longer than the maximum allowed serverless function running time (10-60sec depending on your Vercel plan). + * Thus, we redirect as early as possible and don't wait for any kind of feedback. + * + * XXX You'll need to implement your own business logic if you want to subscribe to the GitHub Action. + * Implementing a dedicated GitHub Action workflow, which in turn will calls your own API to update the status of each steps might be the way to go. + * + * @default "/" + * @example ?redirectTo=/ + * @example ?redirectTo=https://google.com + */ + redirectTo?: string; + + /** + * Force option to avoid being redirected. + * + * Meant to be used when debugging, to avoid being redirected all the time, but stay on the page instead. + * XXX Using any non-empty value will enable this option. (prefer using "true") + * + * @example ?forceNoRedirect=true Will not redirect + * @example ?forceNoRedirect=1 Will not redirect + * @example ?forceNoRedirect=false Will not redirect + */ + forceNoRedirect?: string; +}; + type EndpointRequest = NextApiRequest & { - query: { - /** - * Customer authentication token. (security) - * - * Used to make sure "naked" calls to the endpoint won't trigger a production deployment. - * E.g: A bot calling "/api/startVercelDeployment" will not trigger a deployment, because no token is provided. - * - * Used to make sure the request is authenticated, by using a token that belongs to the current customer. - * E.g: A customer A might call the "/api/startVercelDeployment" endpoint of another customer B, using the token of customer A will not work. - * - * @example ?customerAuthToken=customer1 Token for customer1 - * @example ?customerAuthToken=customer2 Token for customer2 - */ - customerAuthToken: string; - - /** - * Release reference of the platform. - * Basically, a Git commit hash, branch name, or tag. - * - * The ref used will be used to locate what version of the source code should be used for the deployment. - * - * XXX By design, should use the same ref as the one used by the staging environment, by default. - * This way, a customer who deploys a new version always use the same source code version as the staging version they have tested upon. - * - * @example ?platformReleaseRef=main - * @example ?platformReleaseRef=nrn-v2-mst-aptd-gcms-lcz-sty-c1 - * @example ?platformReleaseRef=my-git-branch - * @example ?platformReleaseRef=my-git-tag - * @example ?platformReleaseRef=252b76314184fbeaa236c336c70ea42ca89e0e87 - */ - platformReleaseRef?: string; - - /** - * Url to redirect to, once the deployment has been triggered. - * - * Will not wait for the actual deployment to be done, will not return whether the trigger was successful either. - * - * XXX We can't wait for the deployment to be performed by Vercel, as it'd definitely be longer than the maximum allowed serverless function running time (10-60sec depending on your Vercel plan). - * Thus, we redirect as early as possible and don't wait for any kind of feedback. - * - * XXX You'll need to implement your own business logic if you want to subscribe to the GitHub Action. - * Implementing a dedicated GitHub Action workflow, which in turn will calls your own API to update the status of each steps might be the way to go. - * - * @default "/" - * @example ?redirectTo=/ - * @example ?redirectTo=https://google.com - */ - redirectTo?: string; - - /** - * Force option to avoid being redirected. - * - * Meant to be used when debugging, to avoid being redirected all the time, but stay on the page instead. - * XXX Using any non-empty value will enable this option. (prefer using "true") - * - * @example ?forceNoRedirect=true Will not redirect - * @example ?forceNoRedirect=1 Will not redirect - * @example ?forceNoRedirect=false Will not redirect - */ - forceNoRedirect?: string; - } + query: EndpointRequestQuery; }; const GITHUB_ACTION_WORKFLOW_FILE_PATH_PRODUCTION = '.github/workflows/deploy-vercel-production.yml'; @@ -120,7 +122,7 @@ const startVercelDeployment = async (req: EndpointRequest, res: NextApiResponse) customerAuthToken, platformReleaseRef = process.env.NEXT_PUBLIC_NRN_PRESET, // XXX Because the NEXT_PUBLIC_NRN_PRESET contains the branch's name, it's suitable as a good default, for NRN. (But, you won't want this default in a private fork) redirectTo = '/', - } = req?.query; + }: EndpointRequestQuery = req?.query; const forceNoRedirect = !!size(req?.query?.forceNoRedirect); // Any non-empty value is considered as true const statusCode = forceNoRedirect ? 200 : 302; // Using a statusCode of 200 will break the redirection, making it ineffective diff --git a/src/utils/cookies/cookieConsent.ts b/src/utils/cookies/cookieConsent.ts index f0818d713..d606d4945 100644 --- a/src/utils/cookies/cookieConsent.ts +++ b/src/utils/cookies/cookieConsent.ts @@ -79,6 +79,7 @@ export const shouldDisplayConsentPopup = (allowedPages: string[] | null): boolea * * @param options * + * @see https://github.com/osano/cookieconsent * @see https://www.osano.com/cookieconsent/documentation/ * @see https://www.osano.com/cookieconsent/documentation/javascript-api/ * @see https://www.osano.com/cookieconsent/download/ diff --git a/src/utils/monitoring/sentry.ts b/src/utils/monitoring/sentry.ts index 974590d25..98980e782 100644 --- a/src/utils/monitoring/sentry.ts +++ b/src/utils/monitoring/sentry.ts @@ -51,7 +51,7 @@ if (process.env.SENTRY_DSN) { * Alert types, meant to be assigned to "alertType" tag when reporting a message/exception/event to Sentry. * * Then, you can configure your own Sentry Alerts using the "alertType" tag and perform specific data processing. - * @example If the event's tags match "alertType equals 'vercel-deployment-invoked'", then send it to Slack channel. + * @example If the event's tags match "alertType equals 'vercel-deployment-invoked'", then send it to a dedicated Slack channel. * * @see https://sentry.io/organizations/unly/alerts/next-right-now/new/ */ diff --git a/yarn.lock b/yarn.lock index e47d80d7d..c06bf7a85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2469,30 +2469,6 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jsdevtools/ez-spawn@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@jsdevtools/ez-spawn/-/ez-spawn-3.0.4.tgz#5641eb26fee6d31ec29f6788eba849470c52c7ff" - integrity sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA== - dependencies: - call-me-maybe "^1.0.1" - cross-spawn "^7.0.3" - string-argv "^0.3.1" - type-detect "^4.0.8" - -"@jsdevtools/version-bump-prompt@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@jsdevtools/version-bump-prompt/-/version-bump-prompt-6.1.0.tgz#5b796c05db9dd2c4e5c01b8674bbae9c98ea0e79" - integrity sha512-NJFLJRiD3LLFBgSxAb6B255xhWCGgdtzmh6UjHK2b7SRGX2DDKJH5O4BJ0GTStBu4NnaNgMbkr1TLW3pLOBkOQ== - dependencies: - "@jsdevtools/ez-spawn" "^3.0.4" - command-line-args "^5.1.1" - detect-indent "^6.0.0" - detect-newline "^3.1.0" - globby "^11.0.1" - inquirer "^7.3.3" - log-symbols "^4.0.0" - semver "^7.3.2" - "@next/bundle-analyzer@9.5.3": version "9.5.3" resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-9.5.3.tgz#8e10c80eda02a03c6716037699fc3d29c75c5fe4" @@ -2783,6 +2759,11 @@ dependencies: defer-to-connect "^1.0.1" +"@tokenizer/token@^0.1.0", "@tokenizer/token@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@tokenizer/token/-/token-0.1.1.tgz#f0d92c12f87079ddfd1b29f614758b9696bc29e3" + integrity sha512-XO6INPbZCxdprl+9qa/AAbFFOMzzwqYxpjPgLICrMD6C2FCw6qfJOPcBk6JqqPLSaZ/Qx87qn4rpPmPMwaAK6w== + "@types/amplitude-js@5.11.0": version "5.11.0" resolved "https://registry.yarnpkg.com/@types/amplitude-js/-/amplitude-js-5.11.0.tgz#2d45f43e701d52407a5b57547a42d321c6d3c1b4" @@ -2879,6 +2860,11 @@ "@types/keygrip" "*" "@types/node" "*" +"@types/debug@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== + "@types/events@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -4014,11 +4000,6 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-back@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" - integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== - array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -4906,11 +4887,6 @@ caching-transform@^4.0.0: package-hash "^4.0.0" write-file-atomic "^3.0.0" -call-me-maybe@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" - integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -5419,16 +5395,6 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== -command-line-args@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.1.1.tgz#88e793e5bb3ceb30754a86863f0401ac92fd369a" - integrity sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg== - dependencies: - array-back "^3.0.1" - find-replace "^3.0.0" - lodash.camelcase "^4.3.0" - typical "^4.0.0" - commander@^2.13.0, commander@^2.16.0, commander@^2.18.0, commander@^2.19.0, commander@^2.20.0, commander@^2.20.3, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -5730,15 +5696,6 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - crypto-browserify@3.12.0, crypto-browserify@^3.0.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -6284,17 +6241,12 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detect-indent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" - integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== - detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -detect-newline@^3.0.0, detect-newline@^3.1.0: +detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== @@ -7480,6 +7432,16 @@ file-exists-dazinatorfork@^1.0.2: resolved "https://registry.yarnpkg.com/file-exists-dazinatorfork/-/file-exists-dazinatorfork-1.0.2.tgz#cd8d0d85f63e39dc81eceb0b687c44a2cca95c47" integrity sha512-r70c72ln2YHzQINNfxDp02hAhbGkt1HffZ+Du8oetWDLjDtFja/Lm10lUaSh9e+wD+7VDvPee0b0C9SAy8pWZg== +file-type@^14.1.4: + version "14.7.1" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-14.7.1.tgz#f748732b3e70478bff530e1cf0ec2fe33608b1bb" + integrity sha512-sXAMgFk67fQLcetXustxfKX+PZgHIUFn96Xld9uH8aXPdX3xOp0/jg9OdouVTvQrf7mrn+wAa4jN/y9fUOOiRA== + dependencies: + readable-web-to-node-stream "^2.0.0" + strtok3 "^6.0.3" + token-types "^2.0.0" + typedarray-to-buffer "^3.1.5" + file-uri-to-path@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" @@ -7557,13 +7519,6 @@ find-cache-dir@^2.1.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-replace@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" - integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== - dependencies: - array-back "^3.0.1" - find-root@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -7864,6 +7819,11 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-stdin@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" + integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -8466,7 +8426,7 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -inquirer@7.3.3, inquirer@^7.3.3: +inquirer@7.3.3: version "7.3.3" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== @@ -8880,7 +8840,7 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -9951,11 +9911,6 @@ locize-lastused@3.0.9: dependencies: node-fetch "2.6.0" -lodash.camelcase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= - lodash.clonedeep@4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" @@ -10322,7 +10277,7 @@ memory-fs@^0.5.0: errno "^0.1.3" readable-stream "^2.0.1" -meow@^6.1.1: +meow@^6.1.0, meow@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/meow/-/meow-6.1.1.tgz#1ad64c4b76b2a24dfb2f635fddcadf320d251467" integrity sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg== @@ -11268,6 +11223,25 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" +open-cli@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/open-cli/-/open-cli-6.0.1.tgz#adcee24967dc12c65d8cb8bf994e7dc40aed7a8e" + integrity sha512-A5h8MF3GrT1efn9TiO9LPajDnLtuEiGQT5G8TxWObBlgt1cZJF1YbQo/kNtsD1bJb7HxnT6SaSjzeLq0Rfhygw== + dependencies: + file-type "^14.1.4" + get-stdin "^7.0.0" + meow "^6.1.0" + open "^7.0.3" + temp-write "^4.0.0" + +open@^7.0.3: + version "7.3.1" + resolved "https://registry.yarnpkg.com/open/-/open-7.3.1.tgz#111119cb919ca1acd988f49685c4fdd0f4755356" + integrity sha512-f2wt9DCBKKjlFbjzGb8MOAW8LH8F0mrs1zc7KTjAJ9PZNQbfenzWbNP1VZJvw6ICMG9r14Ah6yfwPn7T7i646A== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + opener@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" @@ -11623,6 +11597,11 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +peek-readable@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/peek-readable/-/peek-readable-3.1.1.tgz#795c1429374f256e4b5ab6c584cecfd3a110024f" + integrity sha512-QHJag0oYYPVkx6rVPEgCLEUMo6VRYbV3GUrqy00lxXJBEIw9LhPCP5MQI6mEfahJO9KYUP8W8qD8kC0V9RyZFQ== + pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -12404,6 +12383,11 @@ readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-web-to-node-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz#751e632f466552ac0d5c440cc01470352f93c4b7" + integrity sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA== + readdirp@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" @@ -13551,11 +13535,6 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= -string-argv@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" - integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== - string-hash@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" @@ -13741,6 +13720,15 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strtok3@^6.0.3: + version "6.0.6" + resolved "https://registry.yarnpkg.com/strtok3/-/strtok3-6.0.6.tgz#65ad16df313c8dfbf075ab0bcb1edd070002fcb3" + integrity sha512-fVxvAEKDwHFfbQO1yKxKBPfkWZyBr0Zf20UQ/mblbkAQe5h0Xdd2jDb3Mh7yRZd7LSItJ9JWgQWelpEmVoBe2g== + dependencies: + "@tokenizer/token" "^0.1.1" + "@types/debug" "^4.1.5" + peek-readable "^3.1.1" + style-loader@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.2.1.tgz#c5cbbfbf1170d076cfdd86e0109c5bba114baa1a" @@ -13934,6 +13922,22 @@ tar@^6.0.2: mkdirp "^1.0.3" yallist "^4.0.0" +temp-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" + integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= + +temp-write@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-4.0.0.tgz#cd2e0825fc826ae72d201dc26eef3bf7e6fc9320" + integrity sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw== + dependencies: + graceful-fs "^4.1.15" + is-stream "^2.0.0" + make-dir "^3.0.0" + temp-dir "^1.0.0" + uuid "^3.3.2" + temp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" @@ -14136,6 +14140,14 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +token-types@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/token-types/-/token-types-2.0.0.tgz#b23618af744818299c6fbf125e0fdad98bab7e85" + integrity sha512-WWvu8sGK8/ZmGusekZJJ5NM6rRVTTDO7/bahz4NGiSDb/XsmdYBn6a1N/bymUHuWYTWeuLUg98wUzvE4jPdCZw== + dependencies: + "@tokenizer/token" "^0.1.0" + ieee754 "^1.1.13" + touch@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/touch/-/touch-0.0.3.tgz#51aef3d449571d4f287a5d87c9c8b49181a0db1d" @@ -14311,7 +14323,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@4.0.8, type-detect@^4.0.8: +type-detect@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -14396,11 +14408,6 @@ typescript@^3.0.3, typescript@^3.7.5, typescript@^3.8.3, typescript@^3.9.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== -typical@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" - integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== - ua-parser-js@^0.7.18: version "0.7.21" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777" @@ -14701,13 +14708,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -version-bump-prompt@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/version-bump-prompt/-/version-bump-prompt-6.1.0.tgz#9f57b9bf3e57ee87f43929ff4f3f2123be07ccdb" - integrity sha512-GYC83GP8QOunWueKf2mbtZkdmisXhnBZPhIHWUmN/Yi4XXAQlIi9avM/IGWdI7KkJLfMENzGN1Xee+Zl3VJ5jg== - dependencies: - "@jsdevtools/version-bump-prompt" "6.1.0" - vm-browserify@1.1.2, vm-browserify@^1.0.0, vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"