From b6fbdaa94a9ecec706a99e1938fbf5cd028c72e0 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 6 Aug 2024 10:23:22 +0100 Subject: [PATCH 1/5] fix(cli): hardcoded supported Node.js version (#10742) * fix(cli): hardcoded supported Node.js version * Create chatty-teachers-sit.md --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> --- .changeset/chatty-teachers-sit.md | 5 +++++ packages/astro/astro.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/chatty-teachers-sit.md diff --git a/.changeset/chatty-teachers-sit.md b/.changeset/chatty-teachers-sit.md new file mode 100644 index 0000000000..9e4fd89b45 --- /dev/null +++ b/.changeset/chatty-teachers-sit.md @@ -0,0 +1,5 @@ +--- +"astro": major +--- + +The lowest version of Node supported by Astro is now Node v18.17.1 and higher. diff --git a/packages/astro/astro.js b/packages/astro/astro.js index 4ba0c800d6..81ef7d1259 100755 --- a/packages/astro/astro.js +++ b/packages/astro/astro.js @@ -12,7 +12,7 @@ const CI_INSTRUCTIONS = { }; // Hardcode supported Node.js version so we don't have to read differently in CJS & ESM. -const engines = '>=18.14.1'; +const engines = '>=18.17.1'; const skipSemverCheckIfAbove = 19; /** `astro *` */ From a7dba90e301a214981e0fbe85a27f400f7766941 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:32:54 +0200 Subject: [PATCH 2/5] chore: enter pre mode --- .changeset/pre.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .changeset/pre.json diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 0000000000..8a32716106 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,35 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "astro": "4.13.1", + "@astrojs/prism": "3.1.0", + "@astrojs/rss": "4.0.7", + "create-astro": "4.8.1", + "@astrojs/db": "0.12.0", + "@astrojs/alpinejs": "0.4.0", + "@astrojs/cloudflare": "0.0.0", + "@astrojs/lit": "4.3.0", + "@astrojs/markdoc": "0.11.3", + "@astrojs/mdx": "3.1.3", + "@astrojs/netlify": "0.0.0", + "@astrojs/node": "8.3.2", + "@astrojs/partytown": "2.1.1", + "@astrojs/preact": "3.5.1", + "@astrojs/react": "3.6.1", + "@astrojs/sitemap": "3.1.6", + "@astrojs/solid-js": "4.4.0", + "@astrojs/svelte": "5.7.0", + "@astrojs/tailwind": "5.1.0", + "@astrojs/vercel": "7.7.2", + "@astrojs/vue": "4.5.0", + "@astrojs/web-vitals": "1.0.0", + "@astrojs/internal-helpers": "0.4.1", + "@astrojs/markdown-remark": "5.2.0", + "@astrojs/studio": "0.1.1", + "@astrojs/telemetry": "3.1.0", + "@astrojs/underscore-redirects": "0.3.4", + "@astrojs/upgrade": "0.3.1" + }, + "changesets": [] +} From bbd8bfda92fb610bbf2b4f589616e7399dc2668f Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 6 Aug 2024 18:51:25 +0800 Subject: [PATCH 3/5] Update changeset base branch (#11632) --- .changeset/config.json | 2 +- CONTRIBUTING.md | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index 030941db23..7920f52b81 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,7 +4,7 @@ "commit": false, "linked": [], "access": "public", - "baseBranch": "main", + "baseBranch": "next", "updateInternalDependencies": "patch", "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { "onlyUpdatePeerDependentsWhenOutOfRange": true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f2e637867..caaa9e726e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -369,20 +369,22 @@ Full documentation: https://github.com/changesets/changesets/blob/main/docs/prer ### Entering prerelease mode -If you have gotten permission from the core contributors, you can enter into prerelease mode by following the following steps: +If you have gotten permission from the core contributors, you can enter into prerelease mode with the following steps: - Run: `pnpm exec changeset pre enter next` in the project root +- Update `.changeset/config.json` with `"baseBranch": "next"` (for easier changesets creation) - Create a new PR from the changes created by this command -- Review, approve, and more the PR to enter prerelease mode. +- Review, approve, and merge the PR to enter prerelease mode. - If successful, The "[ci] release" PR (if one exists) will now say "[ci] release (next)". ### Exiting prerelease mode -Exiting prerelease mode should happen once an experimental release is ready to go from `npm install astro@next` to `npm install astro`. Only a core contributor run these steps. These steps should be run before +Exiting prerelease mode should happen once an experimental release is ready to go from `npm install astro@next` to `npm install astro`. Only a core contributor can run these steps: - Run: `pnpm exec changeset pre exit` in the project root +- Update `.changeset/config.json` with `"baseBranch": "main"` - Create a new PR from the changes created by this command. -- Review, approve, and more the PR to enter prerelease mode. +- Review, approve, and merge the PR to enter prerelease mode. - If successful, The "[ci] release (next)" PR (if one exists) will now say "[ci] release". ### Releasing `astro@latest` while in prerelease mode From 83a2a648418ad30f4eb781d1c1b5f2d8a8ac846e Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Fri, 9 Aug 2024 21:52:21 +0800 Subject: [PATCH 4/5] Update to new shiki token names (#11661) Co-authored-by: Sarah Rainsberger --- .changeset/quick-ads-exercise.md | 10 +++++++ .../astro/test/astro-component-code.test.js | 6 ++-- packages/markdown/remark/src/shiki.ts | 30 ------------------- 3 files changed, 13 insertions(+), 33 deletions(-) create mode 100644 .changeset/quick-ads-exercise.md diff --git a/.changeset/quick-ads-exercise.md b/.changeset/quick-ads-exercise.md new file mode 100644 index 0000000000..dd4285a4cb --- /dev/null +++ b/.changeset/quick-ads-exercise.md @@ -0,0 +1,10 @@ +--- +'@astrojs/markdown-remark': major +--- + +Renames the following CSS variables theme color token names to better align with the Shiki v1 defaults: + +- `--astro-code-color-text` => `--astro-code-foreground` +- `--astro-code-color-background` => `--astro-code-background` + +You can perform a global find and replace in your project to migrate to the new token names. diff --git a/packages/astro/test/astro-component-code.test.js b/packages/astro/test/astro-component-code.test.js index 3e5bf5d9e3..80707f52de 100644 --- a/packages/astro/test/astro-component-code.test.js +++ b/packages/astro/test/astro-component-code.test.js @@ -88,12 +88,12 @@ describe('', () => { .map((i, f) => (f.attribs ? f.attribs.style : 'no style found')) .toArray(), [ - 'background-color:var(--astro-code-color-background);color:var(--astro-code-color-text); overflow-x: auto;', + 'background-color:var(--astro-code-background);color:var(--astro-code-foreground); overflow-x: auto;', 'color:var(--astro-code-token-constant)', 'color:var(--astro-code-token-function)', - 'color:var(--astro-code-color-text)', + 'color:var(--astro-code-foreground)', 'color:var(--astro-code-token-string-expression)', - 'color:var(--astro-code-color-text)', + 'color:var(--astro-code-foreground)', ] ); }); diff --git a/packages/markdown/remark/src/shiki.ts b/packages/markdown/remark/src/shiki.ts index fa29c9c06a..27b54f7bd6 100644 --- a/packages/markdown/remark/src/shiki.ts +++ b/packages/markdown/remark/src/shiki.ts @@ -5,7 +5,6 @@ import { getHighlighter, isSpecialLang, } from 'shiki'; -import { visit } from 'unist-util-visit'; import type { ShikiConfig } from './types.js'; export interface ShikiHighlighter { @@ -23,16 +22,6 @@ export interface ShikiHighlighter { ): Promise; } -// TODO: Remove this special replacement in Astro 5 -const ASTRO_COLOR_REPLACEMENTS: Record = { - '--astro-code-foreground': '--astro-code-color-text', - '--astro-code-background': '--astro-code-color-background', -}; -const COLOR_REPLACEMENT_REGEX = new RegExp( - `${Object.keys(ASTRO_COLOR_REPLACEMENTS).join('|')}`, - 'g' -); - let _cssVariablesTheme: ReturnType; const cssVariablesTheme = () => _cssVariablesTheme ?? @@ -145,21 +134,6 @@ export async function createShikiHighlighter({ return node.children[0] as typeof node; } }, - root(node) { - if (Object.values(themes).length) { - return; - } - - const themeName = typeof theme === 'string' ? theme : theme.name; - if (themeName === 'css-variables') { - // Replace special color tokens to CSS variables - visit(node as any, 'element', (child) => { - if (child.properties?.style) { - child.properties.style = replaceCssVariables(child.properties.style); - } - }); - } - }, }, ...transformers, ], @@ -171,7 +145,3 @@ export async function createShikiHighlighter({ function normalizePropAsString(value: Properties[string]): string | null { return Array.isArray(value) ? value.join(' ') : (value as string | null); } - -function replaceCssVariables(str: string) { - return str.replace(COLOR_REPLACEMENT_REGEX, (match) => ASTRO_COLOR_REPLACEMENTS[match] || match); -} From 5a3c1d1339cae18170143746741bab94021102e5 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:21:26 +0200 Subject: [PATCH 5/5] chore: update tag --- .changeset/pre.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 8a32716106..f239e523d5 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,6 +1,6 @@ { "mode": "pre", - "tag": "beta", + "tag": "alpha", "initialVersions": { "astro": "4.13.1", "@astrojs/prism": "3.1.0",