From 39cc2c91f508716c1d1eff77dbf6072184b876b0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Fri, 15 Nov 2024 09:46:20 -0300 Subject: [PATCH 1/2] DOCS: Add versions generator script to fetch meteor,node and npm versions --- v3-docs/v3-migration-docs/index.md | 31 +++++++++------ v3-docs/v3-migration-docs/package.json | 1 + .../v3-migration-docs/versions-generator.js | 39 +++++++++++++++++++ 3 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 v3-docs/v3-migration-docs/versions-generator.js diff --git a/v3-docs/v3-migration-docs/index.md b/v3-docs/v3-migration-docs/index.md index cf07f5ffe7..aff0df2510 100644 --- a/v3-docs/v3-migration-docs/index.md +++ b/v3-docs/v3-migration-docs/index.md @@ -1,3 +1,8 @@ +--- +meteor_version: 3.0.4 +node_version: 20.18.0 +npm_version: 10.8.2 +--- # Meteor 3.0 Migration Guide :::info You are reading the migration guide for Meteor 3! @@ -11,24 +16,24 @@ This guide is for users with Meteor 2.x projects understand the changes between Meteor 3.0 is currently in its official version! -**Latest version:** `3.0.4`
-**Node.js version:** `20.18.0 LTS`
-**NPM version:** `10.8.2` +**Latest version:** `{{ $frontmatter.meteor_version }}`
+**Node.js version:** `{{ $frontmatter.node_version }} LTS`
+**NPM version:** `{{ $frontmatter.npm_version }}` ## How to try Meteor 3.0? You can create a new Meteor 3.0 project by running the command below: -```bash -meteor create my-new-project --release 3.0.4 +```bash-vue + meteor create my-new-project --release {{ $frontmatter.meteor_version }} ``` ## How to upgrade from Meteor 2.x? You can upgrade your Meteor 2.x project by running the command below inside your project folder: -```bash -meteor update --release 3.0.4 +```bash-vue +meteor update --release {{ $frontmatter.meteor_version }} meteor reset # resets project to a fresh state ``` @@ -53,6 +58,7 @@ This guide covers the necessary topics for migrating your application from Meteo - [Frequently Asked Questions](./frequently-asked-questions/index.md), answers to common questions. - [Breaking Changes](./breaking-changes/index.md), an overview of the changes that will affect your application. + - [Meteor.call x Meteor.callAsync](./breaking-changes/call-x-callAsync.md), why should you change your methods to use `Async` methods. - [Upgrading packages](./breaking-changes/upgrading-packages.md), how to upgrade your packages to the be compatible with Meteor v3. @@ -69,14 +75,15 @@ This guide covers the necessary topics for migrating your application from Meteo We are aware of these articles and guides to assist with your migration: - - [Prepare your Meteor.js project for the big 3.0 release](https://dev.to/jankapunkt/prepare-your-meteorjs-project-for-the-big-30-release-14bf) - - [Gradually upgrading a Meteor.js project to 3.0](https://dev.to/meteor/gradually-upgrading-a-meteorjs-project-to-30-5aj0) - - [Meteor 3.0 Migration Guide, from Daniel](https://docs.google.com/document/d/1XxHE5MQaS0-85HQ-bkiXxmGlYi41ggkX3F-9Rjb9HhE/edit#heading=h.65xi3waq9bb) - - [Illustreets Migration Guide, large SaaS migrated to 3.0](https://forums.meteor.com/t/large-saas-migrated-to-3-0/61113) & their how-to [post](https://forums.meteor.com/t/meteor-3-0-beta-6-is-out/61277/12) - +- [Prepare your Meteor.js project for the big 3.0 release](https://dev.to/jankapunkt/prepare-your-meteorjs-project-for-the-big-30-release-14bf) +- [Gradually upgrading a Meteor.js project to 3.0](https://dev.to/meteor/gradually-upgrading-a-meteorjs-project-to-30-5aj0) +- [Meteor 3.0 Migration Guide, from Daniel](https://docs.google.com/document/d/1XxHE5MQaS0-85HQ-bkiXxmGlYi41ggkX3F-9Rjb9HhE/edit#heading=h.65xi3waq9bb) +- [Illustreets Migration Guide, large SaaS migrated to 3.0](https://forums.meteor.com/t/large-saas-migrated-to-3-0/61113) & their how-to [post](https://forums.meteor.com/t/meteor-3-0-beta-6-is-out/61277/12) + ### Videos Migrating apps to Meteor 3.0: + - TicTacToe & others: [YouTube](https://www.youtube.com/watch?v=MtStd0aeyQA) - Complex Svelte todo list & others: [YouTube](https://www.youtube.com/watch?v=-XW8xwSk-zU) - Meteor University with v3 diff --git a/v3-docs/v3-migration-docs/package.json b/v3-docs/v3-migration-docs/package.json index 23a9213fd2..a6fb13b23f 100644 --- a/v3-docs/v3-migration-docs/package.json +++ b/v3-docs/v3-migration-docs/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", + "generators:versions": "node ./versions-generator.js", "docs:dev": "vitepress dev", "docs:build": "vitepress build", "docs:preview": "vitepress preview", diff --git a/v3-docs/v3-migration-docs/versions-generator.js b/v3-docs/v3-migration-docs/versions-generator.js new file mode 100644 index 0000000000..ddbe2579c1 --- /dev/null +++ b/v3-docs/v3-migration-docs/versions-generator.js @@ -0,0 +1,39 @@ +const fs = require("node:fs"); + +const develDevBundleLink = + "https://raw.githubusercontent.com/meteor/meteor/refs/heads/devel/scripts/build-dev-bundle-common.sh"; + +const meteorToolLink = + "https://raw.githubusercontent.com/meteor/meteor/refs/heads/devel/packages/meteor-tool/package.js"; + +const getMeteorVersionFromDevel = async () => { + const response = await fetch(meteorToolLink); + const text = await response.text(); + const version = text.match(/version: '(.*)'/)[1]; + return version; +}; + +const getNodeAndNpmVersionFromDevel = async () => { + const response = await fetch(develDevBundleLink); + const text = await response.text(); + const nodeVersion = text.match(/NODE_VERSION=(.*)/)[1]; + const npmVersion = text.match(/NPM_VERSION=(.*)/)[1]; + return { nodeVersion, npmVersion }; +}; + +async function main() { + const [meteorVersion, { nodeVersion, npmVersion }] = await Promise.all([ + getMeteorVersionFromDevel(), + getNodeAndNpmVersionFromDevel(), + ]); + + const newIndexFile = fs + .readFileSync("index.md", "utf8") + .replace(/meteor_version: (.*)/, `meteor_version: ${meteorVersion}`) + .replace(/node_version: (.*)/, `node_version: ${nodeVersion}`) + .replace(/npm_version: (.*)/, `npm_version: ${npmVersion}`); + + fs.writeFileSync("index.md", newIndexFile); +} + +main(); From 07b89937feb6c7dfa72259042ced026a0bb2852a Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Mon, 18 Nov 2024 08:37:04 -0300 Subject: [PATCH 2/2] DEV: add generator for every command --- v3-docs/v3-migration-docs/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v3-docs/v3-migration-docs/package.json b/v3-docs/v3-migration-docs/package.json index a6fb13b23f..a84b26ec04 100644 --- a/v3-docs/v3-migration-docs/package.json +++ b/v3-docs/v3-migration-docs/package.json @@ -6,9 +6,9 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "generators:versions": "node ./versions-generator.js", - "docs:dev": "vitepress dev", - "docs:build": "vitepress build", - "docs:preview": "vitepress preview", + "docs:dev": "npm run generators:versions && vitepress dev", + "docs:build": "npm run generators:versions && vitepress build", + "docs:preview": "npm run generators:versions && vitepress preview", "deploy:preview": "npm run docs:build && npm run docs:preview" }, "repository": {