From 2a3e07d167786d0d0755f703d479d584d4cba6bf Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 28 Feb 2024 13:32:35 -0500 Subject: [PATCH 1/4] chore: remove increased mem limit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d892d2b4142..f2356cf7e74 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "scripts": { "prebuild": "npm run generate-markdown; scripts/i18n.sh; if [ -n \"$CROWDIN_PERSONAL_TOKEN\" ]; then npm run crowdin:sync; fi", - "build": "NODE_OPTIONS=--max_old_space_size=8192 npm run build:${VERCEL_ENV:-preview}", + "build": "npm run build:${VERCEL_ENV:-preview}", "build:preview": "docusaurus build --locale en", "build:production": "docusaurus build", "clear": "docusaurus clear", From ad79a0666ef527bbe85b605004e54d5d6015d469 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 28 Feb 2024 13:32:47 -0500 Subject: [PATCH 2/4] docs: archive v5 docs --- docusaurus.config.js | 35 +++++++++++++++++++++++++++++++++++ versions.json | 3 +-- versionsArchived.json | 3 +++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 versionsArchived.json diff --git a/docusaurus.config.js b/docusaurus.config.js index 16413a59785..a5659dbfc8d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -4,6 +4,25 @@ const fetch = require('node-fetch'); const VERSIONS_JSON = require('./versions.json'); +/** + * Old versions of the Ionic Docs are archived so + * that we do not need to re-build it every time we deploy. + * Building a large number of docs sites at once can cause + * out of memory issues, so archiving old docs sites + * allow us to keep memory usage and build times low. + */ +const ARCHIVED_VERSIONS_JSON = require('./versionsArchived.json'); + +/** + * This returns an array where each entry is an array + * containing the version name at index 0 and + * the archive url at index 1. + */ +const ArchivedVersionsDropdownItems = Object.entries(ARCHIVED_VERSIONS_JSON).splice( + 0, + 5, +); + const BASE_URL = '/docs'; module.exports = { @@ -165,6 +184,22 @@ module.exports = { type: 'docsVersionDropdown', position: 'right', dropdownItemsAfter: [ + ...ArchivedVersionsDropdownItems.map( + ([versionName, versionUrl]) => ({ + label: versionName, + /** + * Use "to" instead of "href" so the + * external URL icon does not show up. + */ + to: versionUrl, + /** + * Just like the version docs in this project, + * we want to archived versions to open in the + * same tab. + */ + target: '_self' + }), + ), { to: 'https://ionicframework.com/docs/v4/components', label: 'v4', target: '_blank' }, { to: 'https://ionicframework.com/docs/v3/', label: 'v3', target: '_blank' }, ], diff --git a/versions.json b/versions.json index 3c0ca864655..ed163ab5c09 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,4 @@ [ "v7", - "v6", - "v5" + "v6" ] diff --git a/versionsArchived.json b/versionsArchived.json new file mode 100644 index 00000000000..7316dab3747 --- /dev/null +++ b/versionsArchived.json @@ -0,0 +1,3 @@ +{ + "v5": "https://ionic-docs-5utg8ms4c-ionic1.vercel.app/docs/v5/" +} From 64f34860d52ad926946a16e2d1e869071d1f729e Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 28 Feb 2024 13:38:47 -0500 Subject: [PATCH 3/4] lint --- docusaurus.config.js | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index a5659dbfc8d..3a37ce783ec 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -18,10 +18,7 @@ const ARCHIVED_VERSIONS_JSON = require('./versionsArchived.json'); * containing the version name at index 0 and * the archive url at index 1. */ -const ArchivedVersionsDropdownItems = Object.entries(ARCHIVED_VERSIONS_JSON).splice( - 0, - 5, -); +const ArchivedVersionsDropdownItems = Object.entries(ARCHIVED_VERSIONS_JSON).splice(0, 5); const BASE_URL = '/docs'; @@ -184,22 +181,20 @@ module.exports = { type: 'docsVersionDropdown', position: 'right', dropdownItemsAfter: [ - ...ArchivedVersionsDropdownItems.map( - ([versionName, versionUrl]) => ({ - label: versionName, - /** - * Use "to" instead of "href" so the - * external URL icon does not show up. - */ - to: versionUrl, - /** - * Just like the version docs in this project, - * we want to archived versions to open in the - * same tab. - */ - target: '_self' - }), - ), + ...ArchivedVersionsDropdownItems.map(([versionName, versionUrl]) => ({ + label: versionName, + /** + * Use "to" instead of "href" so the + * external URL icon does not show up. + */ + to: versionUrl, + /** + * Just like the version docs in this project, + * we want to archived versions to open in the + * same tab. + */ + target: '_self', + })), { to: 'https://ionicframework.com/docs/v4/components', label: 'v4', target: '_blank' }, { to: 'https://ionicframework.com/docs/v3/', label: 'v3', target: '_blank' }, ], From 914bc7ef132de0201831d39f04619d10ef98030e Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 28 Feb 2024 13:51:50 -0500 Subject: [PATCH 4/4] add note --- docusaurus.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index 3a37ce783ec..44e25594cae 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -10,6 +10,11 @@ const VERSIONS_JSON = require('./versions.json'); * Building a large number of docs sites at once can cause * out of memory issues, so archiving old docs sites * allow us to keep memory usage and build times low. + * + * Note that this file is only for versions of the Ionic Docs + * that are built with Docusaurus. The + * Ionic v3 and v4 docs are built with other tools, so those + * versions are not included here. */ const ARCHIVED_VERSIONS_JSON = require('./versionsArchived.json');