diff --git a/docs/devGuide/development/migratingNodeJs.md b/docs/devGuide/development/migratingNodeJs.md index 1db100b1c6..81e137add1 100644 --- a/docs/devGuide/development/migratingNodeJs.md +++ b/docs/devGuide/development/migratingNodeJs.md @@ -39,11 +39,14 @@ Switch to use the Node.js version that you are migrating to. - Go to the [Node.js changelog](https://nodejs.org/en/blog/release) of the new version - Go through the list of deprecated syntax and check if it is being used in MarkBind - Replace any deprecated syntax -2. Check that all user-facing functionalities are working +1. Update Node type dependency + - TypeScript does not automatically know which version of Node.js you are using. You must update the `@types/node` package to match your target Node.js runtime so that the compiler can recognize new global variables, modules, and method signatures. + - Run `npm install -D @types/node@` to install the new type definitions. +1. Check that all user-facing functionalities are working - A quick way to do this is to go to the Reader Facing Features in the User GuideReader Facing Features in the User Guide. -3. Check that there are no issues with development setup +1. Check that there are no issues with development setup - Set up the development environment by running through the steps in [Setting Up]({{baseUrl}}/devGuide/development/settingUp.html) to ensure there are no problems -4. Update GitHubActions +1. Update GitHubActions - Go to [MarkBind/markbind-action](https://github.com/MarkBind/markbind-action) and update the Node.js version numbers - See [Update node version from 14 to 16 PR](https://github.com/MarkBind/markbind-action/pull/8/files) for an example - Test there are no issues with workflows @@ -51,7 +54,7 @@ Switch to use the Node.js version that you are migrating to. Install correct version of npm in `action.yml` and `fork-build.yml`. Refer to [Update node version from 14 to 16 PR](https://github.com/MarkBind/markbind-action/pull/8/files) to see where npm install should be run. -5. Check deployment to Netlify/other platforms +1. Check deployment to Netlify/other platforms - Deployment to Netlify - Follow steps in Deploying to NetlifyDeploying to Netlify but change the `NODE_VERSION` value accordingly. Check there are no issues with deployment and deployed site is as expected. - MarkBind has two repos [init-minimal-netlify](https://github.com/MarkBind/init-minimal-netlify) and [init-typical-netlify](https://github.com/MarkBind/init-typical-netlify) which allows deployment to Netlify by using a config file. Update the config file `netlify.toml` with the correct Node.js version and check that deployment using button in `README` works as expected. @@ -66,11 +69,11 @@ Switch to use the Node.js version that you are migrating to. - Follow steps in Using CI PlatformsUsing CI Platforms but update the config files for the various CI Platforms to use the correct Node.js version. Try deploying and ensure there are no problems with deployment. Install the correct npm version before running npm commands. -6. Update documentation +1. Update documentation - Update Node.js and npm version in documentation. See [Update to use Node 16](https://github.com/MarkBind/markbind/pull/2233/files#diff-0f8e38868f41667abec6adacbb5131fbd6999c4913fc43e3429390b744f7a1f3) as an example. Don't forget to update the version numbers in the example config files in Deploying the SiteDeploying the Site! -7. Update `neftlify.toml` +1. Update `neftlify.toml` - The `neftlify.toml` file in the `markbind` repo's root directory is used to deploy our documentation site to Netlify. Update the `NODE_VERSION` value to the new Node.js version. {% from "njk/common.njk" import previous_next %} diff --git a/package-lock.json b/package-lock.json index a5a7d536b2..629d4ad484 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@babel/preset-typescript": "^7.28.5", "@stylistic/stylelint-plugin": "^2.1.0", - "@types/node": "^18.15.0", + "@types/node": "^22.19.11", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "danger": "^13.0.4", @@ -5723,10 +5723,14 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.15.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.9.tgz", - "integrity": "sha512-dUxhiNzBLr6IqlZXz6e/rN2YQXlFgOei/Dxy+e3cyXTJ4txSUbGT2/fmnD6zd/75jDMeW5bDee+YXxlFKHoV0A==", - "dev": true + "version": "22.19.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.11.tgz", + "integrity": "sha512-BH7YwL6rA93ReqeQS1c4bsPpcfOmJasG+Fkr6Y59q83f9M1WcBRHR2vM+P9eOisYRcN3ujQoiZY8uk5W+1WL8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", @@ -23437,6 +23441,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", @@ -24962,7 +24973,6 @@ "@types/katex": "^0.16.0", "@types/lodash": "^4.14.181", "@types/markdown-it": "^12.2.3", - "@types/node": "^18.15.0", "@types/nunjucks": "^3.2.1", "@types/path-is-inside": "^1.0.0", "@types/primer__octicons": "^17.11.0", @@ -28253,7 +28263,6 @@ "@types/katex": "^0.16.0", "@types/lodash": "^4.14.181", "@types/markdown-it": "^12.2.3", - "@types/node": "^18.15.0", "@types/nunjucks": "^3.2.1", "@types/path-is-inside": "^1.0.0", "@types/primer__octicons": "^17.11.0", @@ -29847,10 +29856,13 @@ "dev": true }, "@types/node": { - "version": "18.15.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.9.tgz", - "integrity": "sha512-dUxhiNzBLr6IqlZXz6e/rN2YQXlFgOei/Dxy+e3cyXTJ4txSUbGT2/fmnD6zd/75jDMeW5bDee+YXxlFKHoV0A==", - "dev": true + "version": "22.19.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.11.tgz", + "integrity": "sha512-BH7YwL6rA93ReqeQS1c4bsPpcfOmJasG+Fkr6Y59q83f9M1WcBRHR2vM+P9eOisYRcN3ujQoiZY8uk5W+1WL8w==", + "dev": true, + "requires": { + "undici-types": "~6.21.0" + } }, "@types/normalize-package-data": { "version": "2.4.4", @@ -42674,6 +42686,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", diff --git a/package.json b/package.json index 2f4abaf033..48fafdf598 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "devDependencies": { "@babel/preset-typescript": "^7.28.5", "@stylistic/stylelint-plugin": "^2.1.0", - "@types/node": "^18.15.0", + "@types/node": "^22.19.11", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "danger": "^13.0.4", diff --git a/packages/core/package.json b/packages/core/package.json index e4d47ed295..1420786803 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -83,7 +83,6 @@ "@types/katex": "^0.16.0", "@types/lodash": "^4.14.181", "@types/markdown-it": "^12.2.3", - "@types/node": "^18.15.0", "@types/nunjucks": "^3.2.1", "@types/path-is-inside": "^1.0.0", "@types/primer__octicons": "^17.11.0",