mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Merge branch 'next' into feat/unflag-astro-env
This commit is contained in:
commit
ff30bfb9f5
8 changed files with 62 additions and 40 deletions
5
.changeset/chatty-teachers-sit.md
Normal file
5
.changeset/chatty-teachers-sit.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"astro": major
|
||||||
|
---
|
||||||
|
|
||||||
|
The lowest version of Node supported by Astro is now Node v18.17.1 and higher.
|
|
@ -4,7 +4,7 @@
|
||||||
"commit": false,
|
"commit": false,
|
||||||
"linked": [],
|
"linked": [],
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"baseBranch": "main",
|
"baseBranch": "next",
|
||||||
"updateInternalDependencies": "patch",
|
"updateInternalDependencies": "patch",
|
||||||
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||||
"onlyUpdatePeerDependentsWhenOutOfRange": true
|
"onlyUpdatePeerDependentsWhenOutOfRange": true
|
||||||
|
|
35
.changeset/pre.json
Normal file
35
.changeset/pre.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"mode": "pre",
|
||||||
|
"tag": "alpha",
|
||||||
|
"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": []
|
||||||
|
}
|
10
.changeset/quick-ads-exercise.md
Normal file
10
.changeset/quick-ads-exercise.md
Normal file
|
@ -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.
|
|
@ -369,20 +369,22 @@ Full documentation: https://github.com/changesets/changesets/blob/main/docs/prer
|
||||||
|
|
||||||
### Entering prerelease mode
|
### 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
|
- 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
|
- 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)".
|
- If successful, The "[ci] release" PR (if one exists) will now say "[ci] release (next)".
|
||||||
|
|
||||||
### Exiting prerelease mode
|
### 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
|
- 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.
|
- 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".
|
- If successful, The "[ci] release (next)" PR (if one exists) will now say "[ci] release".
|
||||||
|
|
||||||
### Releasing `astro@latest` while in prerelease mode
|
### Releasing `astro@latest` while in prerelease mode
|
||||||
|
|
|
@ -12,7 +12,7 @@ const CI_INSTRUCTIONS = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hardcode supported Node.js version so we don't have to read differently in CJS & ESM.
|
// 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;
|
const skipSemverCheckIfAbove = 19;
|
||||||
|
|
||||||
/** `astro *` */
|
/** `astro *` */
|
||||||
|
|
|
@ -88,13 +88,13 @@ describe('<Code>', () => {
|
||||||
.map((i, f) => (f.attribs ? f.attribs.style : 'no style found'))
|
.map((i, f) => (f.attribs ? f.attribs.style : 'no style found'))
|
||||||
.toArray(),
|
.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-constant)',
|
||||||
'color:var(--astro-code-token-function)',
|
'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-token-string-expression)',
|
||||||
'color:var(--astro-code-color-text)',
|
'color:var(--astro-code-foreground)',
|
||||||
],
|
]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {
|
||||||
getHighlighter,
|
getHighlighter,
|
||||||
isSpecialLang,
|
isSpecialLang,
|
||||||
} from 'shiki';
|
} from 'shiki';
|
||||||
import { visit } from 'unist-util-visit';
|
|
||||||
import type { ShikiConfig } from './types.js';
|
import type { ShikiConfig } from './types.js';
|
||||||
|
|
||||||
export interface ShikiHighlighter {
|
export interface ShikiHighlighter {
|
||||||
|
@ -23,16 +22,6 @@ export interface ShikiHighlighter {
|
||||||
): Promise<string>;
|
): Promise<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove this special replacement in Astro 5
|
|
||||||
const ASTRO_COLOR_REPLACEMENTS: Record<string, string> = {
|
|
||||||
'--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<typeof createCssVariablesTheme>;
|
let _cssVariablesTheme: ReturnType<typeof createCssVariablesTheme>;
|
||||||
const cssVariablesTheme = () =>
|
const cssVariablesTheme = () =>
|
||||||
_cssVariablesTheme ??
|
_cssVariablesTheme ??
|
||||||
|
@ -145,21 +134,6 @@ export async function createShikiHighlighter({
|
||||||
return node.children[0] as typeof node;
|
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,
|
...transformers,
|
||||||
],
|
],
|
||||||
|
@ -171,7 +145,3 @@ export async function createShikiHighlighter({
|
||||||
function normalizePropAsString(value: Properties[string]): string | null {
|
function normalizePropAsString(value: Properties[string]): string | null {
|
||||||
return Array.isArray(value) ? value.join(' ') : (value as 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);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue