Skip to content

Commit

Permalink
chore(next-release/main): merge in latest from main (#6040)
Browse files Browse the repository at this point in the history
* Copyedit of Auth guide for sign-in, sign-up, and sign-out

* add pr version of link checker script

* Updated authenticator callout for react native

* convert server to use serve instead of next-start

* add static server for testing

* update broken link for pr script

* update link checker script, add dev mode and pr link checker

* update link script

* remove unused code

* add axios timeout

* remove unused command

* remove choose filter filtering

* update links

* correct directory.mjs entry add react-native lib-v1 base page

* Update overview.mdx

* remove permissions

* update pathmap default

* GH action to check bundlesize of PR (#5986)

* add gh workflow to check bundle size of selected pages

* pinning versions

* remove unnecessary package

* remove errant script from package.json

* consolidating functions

* change logic for check

* fix issues

* fix main branch ref

---------

Co-authored-by: katiegoines <katiegoines@gmail.com>

* adding needed index files

* Update csp (#5987)

* Remove deprecated prefetch-src header

* Update alpha CSP to remove warnings during local testing

* update index script

* update write script

* add missing index files

* revert ssg revert

* add static generation to new js docs

* add static paths to page

* remove unlinked and unbuilt pages

* adding highlight for CDK support on main page

* update pages to match filters and generate the same index files as main

* Added What's New Banner

* addressed based on Janaina's feedback

* Update data-modeling.mdx

* update table in fragment to resolve hydration issue

* render contribute getting started text in spans

* chore(flutter): remove null safety references (#5998)

Co-authored-by: Tim Nguyen <54393192+timngyn@users.noreply.github.com>

* Update versions.ts

Updating the android library version

* Update-project-setup (#6007)

* updated project set up

* update framework info

* updated project set up

* update project set up

* Update src/pages/lib-v1/project-setup/create-application/q/platform/[platform].mdx

added period

* Update src/pages/lib-v1/project-setup/create-application/q/platform/[platform].mdx

Co-authored-by: Ashwin Kumar <ashwinkumar2468@gmail.com>

---------

Co-authored-by: Chris Womack <67726635+cwomack@users.noreply.github.com>
Co-authored-by: Ashwin Kumar <ashwinkumar2468@gmail.com>
Co-authored-by: Katie Goines <30757403+katiegoines@users.noreply.github.com>

* chore(deps): bump @aws-amplify/amplify-cli-core from 4.2.7 to 4.2.10 (#6011)

Bumps [@aws-amplify/amplify-cli-core](https://github.com/aws-amplify/amplify-cli/tree/HEAD/packages/amplify-cli-core) from 4.2.7 to 4.2.10.
- [Release notes](https://github.com/aws-amplify/amplify-cli/releases)
- [Changelog](https://github.com/aws-amplify/amplify-cli/blob/@aws-amplify/amplify-cli-core@4.2.10/packages/amplify-cli-core/CHANGELOG.md)
- [Commits](https://github.com/aws-amplify/amplify-cli/commits/@aws-amplify/amplify-cli-core@4.2.10/packages/amplify-cli-core)

---
updated-dependencies:
- dependency-name: "@aws-amplify/amplify-cli-core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Katie Goines <30757403+katiegoines@users.noreply.github.com>

* Add custom analytics event for the "What's New" banner (#6006)

* Add a custom adobe analytics event for the WhatsNewBanner component

* Add comment for function

* update home page to update page context

* fix: updating @babel/traverse (#6025)

* update @babel/core and @babel/traverse

* updated @babel/traverse

---------

Co-authored-by: katiegoines <katiegoines@gmail.com>

* update base lib, sdk, and guides pages

* update next/previous styles

* Amplify Android API Relational Models (#6020)

* feat(api): iOS Android API GraphQL relational models pages

* update schema

* Add callout, update many-to-many schema

* update callout to point to migration guide for existing developers

* add new sections for query and css

* Updates to Android API Relationship page

* Defragmented pages and reordered content.

* Remove iOS docs for now

* Remove iOS docs for now

* Remove fragments

* Add delete code snippet

* Correct description of query

---------

Co-authored-by: Michael Law <1365977+lawmicha@users.noreply.github.com>
Co-authored-by: Rene Brandel <renbran@amazon.com>

* Update CODEOWNERS to exclude documentation team from all files (#6030)

* chore: update auth docs now that cdk tokens are supported for adminRole and identityPoolId

* Update src/pages/cli/graphql/authorization-rules.mdx

* fix: update example naming

* Revert "Update CODEOWNERS to exclude documentation team from all files (#6030)" (#6031)

* update new page to include ssg required exports

* update sample amplifyconfiguration json file (#5874)

Co-authored-by: Tim Nguyen <54393192+timngyn@users.noreply.github.com>
Co-authored-by: Katie Goines <30757403+katiegoines@users.noreply.github.com>

* add choose your filter page

* filter out all but android (#6036)

Co-authored-by: katiegoines <katiegoines@gmail.com>
Co-authored-by: Rene Brandel <4989523+renebrandel@users.noreply.github.com>

* Update Amplify Android Version

* revert InternalLink back to next-release/main, needs to be refactored out

* fix versions export

* Delete some tests for now from components that are going to be removed

* Delete some tests for now from components that are going to be removed

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jim Eagan <jeeagan@amazon.com>
Co-authored-by: Jim Eagan <84857865+hibler13@users.noreply.github.com>
Co-authored-by: Jacob Logan <lognjc@amazon.com>
Co-authored-by: Heather Pundt <119376175+heatheramz@users.noreply.github.com>
Co-authored-by: jacoblogan <jacob.maiola.logan@gmail.com>
Co-authored-by: Rene Brandel <4989523+renebrandel@users.noreply.github.com>
Co-authored-by: Katie Goines <30757403+katiegoines@users.noreply.github.com>
Co-authored-by: katiegoines <katiegoines@gmail.com>
Co-authored-by: Tim Nguyen <54393192+timngyn@users.noreply.github.com>
Co-authored-by: Rene Brandel <renbran@amazon.com>
Co-authored-by: Dustin Noyes <dustin.noyes.dev@gmail.com>
Co-authored-by: gpanshu <91897496+gpanshu@users.noreply.github.com>
Co-authored-by: Abdallah Shaban <awshaban@amazon.com>
Co-authored-by: Chris Womack <67726635+cwomack@users.noreply.github.com>
Co-authored-by: Ashwin Kumar <ashwinkumar2468@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Roach <tjroach@amazon.com>
Co-authored-by: Michael Law <1365977+lawmicha@users.noreply.github.com>
Co-authored-by: Al Harris <alharris@amazon.com>
Co-authored-by: Tuan Pham <103537251+phantumcode@users.noreply.github.com>
  • Loading branch information
21 people authored Oct 19, 2023
1 parent 4892662 commit ef94a44
Show file tree
Hide file tree
Showing 774 changed files with 14,478 additions and 1,810 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/check_bundle_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Check Bundle Size
on:
pull_request:
branches: [main]
jobs:
checkBundleSizeChange:
permissions:
pull-requests: read
name: Check whether PR increases bundle size more than 5%
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 https://github.com/actions/checkout/commit/f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: main
- name: Setup Node.js 16.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 https://github.com/actions/setup-node/commit/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16.x
- name: Install dependencies
run: yarn
- name: Run build and analyze base bundle sizes
env:
CURRENT_BRANCH: ${{ github.base_ref }}
CURRENT_REPO: ${{ github.repository }}
NODE_OPTIONS: --max_old_space_size=4096
run: ANALYZE=true yarn next-build
- name: Check base bundle size of select pages
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: base-bundle-sizes
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { checkBundleSize } = require('./.github/workflows/scripts/check_bundle_size.js');
return checkBundleSize();
- name: Checkout PR branch
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 https://github.com/actions/checkout/commit/f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js 16.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v.3.8.1 https://github.com/actions/setup-node/commit/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16.x
- name: Install dependencies
run: yarn
- name: Run build and analyze head bundle sizes
env:
CURRENT_BRANCH: ${{ github.head_ref }}
CURRENT_REPO: ${{ github.repository }}
NODE_OPTIONS: --max_old_space_size=4096
run: ANALYZE=true yarn next-build
- name: Check head bundle size of select pages
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: head-bundle-sizes
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { checkBundleSize } = require('./.github/workflows/scripts/check_bundle_size.js');
return checkBundleSize();
- name: Compare bundle page bundle sizes
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: compare-bundles
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { compareBundles } = require('./.github/workflows/scripts/check_bundle_size.js');
const baseBundles = ${{ steps.base-bundle-sizes.outputs.result }}
const headBundles = ${{ steps.head-bundle-sizes.outputs.result }}
return await compareBundles(baseBundles, headBundles)
- name: Fail if bundle size growth exceeds 5% on any of the selected pages
if: ${{ steps.compare-bundles.outputs.result > 0 }}
run: exit 1
4 changes: 2 additions & 2 deletions .github/workflows/check_for_broken_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
with:
result-encoding: string
script: |
const { checkLinks } = require('./tasks/link-checker.js');
return await checkLinks();
const { checkProdLinks } = require('./tasks/link-checker.js');
return await checkProdLinks();
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check_pr_for_broken_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CheckPRLinks
on:
pull_request:
branches: [main]
types: [opened, synchronize]
jobs:
CheckPRLinks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 https://github.com/actions/checkout/commit/f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Setup Node.js 16.x
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 https://github.com/actions/setup-node/commit/e33196f7422957bea03ed53f6fbb155025ffc7b8
with:
node-version: 16.x
- name: Install Dependencies
run: yarn
- name: Run Build
run: yarn build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Run Server
run: |
node ./node_modules/.bin/serve client/www/next-build --no-request-logging &
sleep 5
- name: Run Link Checker
id: checkLinks
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
result-encoding: string
script: |
const { checkDevLinks } = require('./tasks/link-checker.js');
return await checkDevLinks();
- name: Fail if broken links have been found
if: ${{ steps.checkLinks.outputs.result }}
run: exit 1
47 changes: 47 additions & 0 deletions .github/workflows/scripts/check_bundle_size.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
checkBundleSize: () => {
const fs = require('fs');
const jsonString = fs.readFileSync('.github/analyze/bundles.json');
const data = JSON.parse(jsonString);
const pagesToCheck = [
'/',
'/cli/start/install',
'/lib/auth/getting-started/q/platform/[platform]',
'/start',
'/cli'
];
const bundleSizes = [];
data.pages.filter((page) => {
if (pagesToCheck.includes(page.label)) {
bundleSizes.push({
page: page.label,
gzipSize: page.gzipSize,
parsedSize: page.parsedSize,
statSize: page.statSize,
totalGzipSize: page.totalGzipSize,
totalParsedSize: page.totalParsedSize,
totalStatSize: page.totalStatSize
});
}
});
return bundleSizes;
},

compareBundles: (baseBundles, headBundles) => {
const fails = [];
baseBundles.forEach((basePage) => {
headBundles.forEach((headPage) => {
if (
basePage.page == headPage.page &&
basePage.parsedSize * 1.05 < headPage.parsedSize
) {
fails.push(basePage.page);
}
});
});
console.log(
`The bundle size of ${fails} increased by more than 5% with this PR`
);
return fails.length;
}
};
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,9 @@
"cloudwatchlogs",
"userids",
"xmark",
"refreshable"
"refreshable",
"querytransfers",
"generatemodelsforlazyloadandcustomselectionset"
],
"flagWords": ["hte", "full-stack", "Full-stack", "Full-Stack", "sudo"],
"patterns": [
Expand Down
2 changes: 1 addition & 1 deletion customHttp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ customHeaders:
- key: 'X-Content-Type-Options'
value: 'nosniff'
- key: 'Content-Security-Policy'
value: "upgrade-insecure-requests; default-src 'none'; prefetch-src 'self'; style-src 'self' 'unsafe-inline' *.shortbread.aws.dev; font-src 'self'; frame-src 'self' https://www.youtube-nocookie.com https://aws.demdex.net https://dpm.demdex.net; connect-src 'self' *.shortbread.aws.dev https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://d2c.aws.amazon.com https://vs.aws.amazon.com https://*.algolia.net https://*.algolianet.com *.amazonaws.com https://aws.amazon.com/ https://d2c-alpha.dse.marketing.aws.a2z.com https://aws-mktg-csds-alpha.integ.amazon.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; img-src 'self' https://img.shields.io https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; media-src 'self'; script-src 'self' *.shortbread.aws.dev https://a0.awsstatic.com/ https://aa0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://d2c.aws.amazon.com/;"
value: "upgrade-insecure-requests; default-src 'none'; style-src 'self' 'unsafe-inline' *.shortbread.aws.dev; font-src 'self'; frame-src 'self' https://www.youtube-nocookie.com https://aws.demdex.net https://dpm.demdex.net; connect-src 'self' *.shortbread.aws.dev https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://d2c.aws.amazon.com https://vs.aws.amazon.com https://*.algolia.net https://*.algolianet.com *.amazonaws.com https://aws.amazon.com/ https://d2c-alpha.dse.marketing.aws.a2z.com https://aws-mktg-csds-alpha.integ.amazon.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; img-src 'self' https://img.shields.io https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://aa0.awsstatic.com/; media-src 'self'; script-src 'self' *.shortbread.aws.dev https://a0.awsstatic.com/ https://aa0.awsstatic.com/ https://alpha.d2c.marketing.aws.dev/ https://d2c.aws.amazon.com/;"
# CSP also set in _document.tsx meta tag
30 changes: 6 additions & 24 deletions generatePathMap.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function generatePathMap(
'/lib-v1/q/platform/js': {
page: '/lib-v1/q/platform/[platform]'
},
'/lib-v1/q/platform/react-native': {
page: '/lib-v1/q/platform/[platform]'
},
'/sdk/q/platform/js': {
page: '/sdk/q/platform/[platform]'
},
Expand All @@ -79,6 +82,9 @@ function generatePathMap(
'/sdk/q/platform/flutter': {
page: '/sdk/q/platform/[platform]'
},
'/sdk/q/platform/react-native': {
page: '/sdk/q/platform/[platform]'
},
'/console': {
page: '/console'
},
Expand Down Expand Up @@ -120,19 +126,6 @@ function generatePathMap(
} else if (route.startsWith('/start')) {
filterKind = 'integration';
}

if (filterKind !== '') {
const aOrAn = 'aeiou'.includes(filterKind[0]) ? 'an' : 'a';
pathMap[route] = {
page: '/ChooseFilterPage',
query: {
address: route,
directoryPath: '/ChooseFilterPage',
filterKind: filterKind,
message: `Choose ${aOrAn} ${filterKind}:`
}
};
}
}

if (items) {
Expand Down Expand Up @@ -202,17 +195,6 @@ function generatePathMap(
page: `${route}/q/${routeType}/[${routeType}]`
};
});
const aOrAn = 'aeiou'.includes(routeType[0]) ? 'an' : 'a';
pathMap[route] = {
page: '/ChooseFilterPage',
query: {
address: route,
directoryPath: '/ChooseFilterPage',
filterKind: routeType,
filters: filters,
message: `Choose ${aOrAn} ${routeType}:`
}
};
}
return pathMap;
}
Expand Down
19 changes: 18 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default async () => {
}
});

const nextConfig = withMDX({
const shouldAnalyzeBundles = process.env.ANALYZE === 'true';

let nextConfig = withMDX({
env: {
BUILD_ENV: process.env.BUILD_ENV,
nextImageExportOptimizer_imageFolderPath: 'public',
Expand Down Expand Up @@ -75,5 +77,20 @@ export default async () => {
];
}
});

if (shouldAnalyzeBundles) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNextBundleAnalyzer = require('next-bundle-analyzer')({
format: ['json'],
reportDir: '../.github/analyze',
json: {
filter: {
pages: true
}
}
});
nextConfig = withNextBundleAnalyzer(nextConfig);
}

return nextConfig;
};
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@algolia/autocomplete-shared": "^1.5.6",
"@algolia/autocomplete-theme-classic": "^1.6.1",
"@algolia/client-search": "^4.13.0",
"@aws-amplify/amplify-cli-core": "^4.2.7",
"@aws-amplify/amplify-cli-core": "^4.2.10",
"@aws-amplify/ui-react": "^5.3.1",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.3.0",
Expand All @@ -28,6 +28,7 @@
"aws-amplify": "^5.0.5",
"classnames": "^2.3.2",
"copy-to-clipboard": "^3.2.1",
"cross-env": "^7.0.3",
"dotenv": "^16.0.0",
"emotion": "^10.0.23",
"eslint-config-next": "^13.2.4",
Expand Down Expand Up @@ -58,6 +59,7 @@
},
"devDependencies": {
"@next/mdx": "^13.5.4",
"@next/bundle-analyzer": "^13.5.3",
"@stencil/core": "^1.17.0",
"@stencil/eslint-plugin": "^0.2.1",
"@stencil/router": "^1.0.1",
Expand Down Expand Up @@ -85,9 +87,11 @@
"jest": "^26.6.3",
"jest-cli": "^26.6.3",
"prettier": "^3.0.3",
"next-bundle-analyzer": "^0.6.7",
"puppeteer": "^20.8.2",
"rollup-plugin-node-polyfills": "^0.2.1",
"sass": "^1.54.8",
"serve": "^14.2.1",
"tiny-glob": "0.2.9",
"ts-jest": "^26.0.3",
"ts-node": "^8.5.0",
Expand All @@ -96,6 +100,8 @@
},
"resolutions": {
"**/trim": "0.0.3",
"@babel/core": "^7.23.2",
"@babel/traverse": "^7.23.2",
"loader-utils": "2.0.4",
"minimatch": "3.1.2",
"json5": "2.2.2",
Expand Down Expand Up @@ -127,7 +133,11 @@
],
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
]
],
"moduleNameMapper": {
"\\.(css|less|scss)$": "<rootDir>/src/__mocks__/styleMock.js"
},
"transformIgnorePatterns": []
},
"scripts": {
"clean": "rm -rf node_modules yarn.lock",
Expand All @@ -140,6 +150,8 @@
"build:release": "yarn build && next-image-export-optimizer --exportFolderPath client/www/next-build",
"next-build": "next build",
"next-start": "next start",
"prepare": "husky install"
"amplify:submissionsLambda": "cd amplify/backend/function/submissionsLambda/src && yarn install && yarn build && yarn test",
"prepare": "husky install",
"analyze": "ANALYZE=true yarn next-build"
}
}
1 change: 1 addition & 0 deletions src/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
7 changes: 6 additions & 1 deletion src/components/Accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const Accordion: React.FC<AccordionProps> = ({
const [expandedHeight, setExpandedHeight] = useState(0);
const docsExpander = useRef<HTMLElement>(null);

let pathName = '';
if (typeof window !== 'undefined') {
pathName = window.location.pathname;
}

useEffect(() => {
const expander = docsExpander.current;

Expand Down Expand Up @@ -62,7 +67,7 @@ const Accordion: React.FC<AccordionProps> = ({

const anchor = createElement(
'a',
{ href: window.location.pathname + '#' + headingId },
{ href: pathName + '#' + headingId },
expanderTitle
);

Expand Down
Loading

0 comments on commit ef94a44

Please sign in to comment.