mirror of
https://github.com/withastro/astro.git
synced 2025-01-23 19:02:14 -05:00
[ci] update lockfile (#10234)
Co-authored-by: matthewp <matthewp@users.noreply.github.com> Co-authored-by: bluwy <bjornlu.dev@gmail.com>
This commit is contained in:
parent
0b0e244d1e
commit
b3dbb49058
10 changed files with 1996 additions and 2106 deletions
|
@ -124,7 +124,6 @@
|
||||||
"@babel/plugin-transform-react-jsx": "^7.22.5",
|
"@babel/plugin-transform-react-jsx": "^7.22.5",
|
||||||
"@babel/traverse": "^7.23.3",
|
"@babel/traverse": "^7.23.3",
|
||||||
"@babel/types": "^7.23.3",
|
"@babel/types": "^7.23.3",
|
||||||
"@shikijs/core": "^1.1.2",
|
|
||||||
"@types/babel__core": "^7.20.4",
|
"@types/babel__core": "^7.20.4",
|
||||||
"acorn": "^8.11.2",
|
"acorn": "^8.11.2",
|
||||||
"aria-query": "^5.3.0",
|
"aria-query": "^5.3.0",
|
||||||
|
@ -155,7 +154,6 @@
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"kleur": "^4.1.4",
|
"kleur": "^4.1.4",
|
||||||
"magic-string": "^0.30.3",
|
"magic-string": "^0.30.3",
|
||||||
"mdast-util-to-hast": "13.0.2",
|
|
||||||
"mime": "^3.0.0",
|
"mime": "^3.0.0",
|
||||||
"ora": "^7.0.1",
|
"ora": "^7.0.1",
|
||||||
"p-limit": "^5.0.0",
|
"p-limit": "^5.0.0",
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { bgGreen, black, bold, dim, yellow } from 'kleur/colors';
|
||||||
|
|
||||||
import { formatWithOptions } from 'node:util';
|
import { formatWithOptions } from 'node:util';
|
||||||
import dlv from 'dlv';
|
import dlv from 'dlv';
|
||||||
// @ts-expect-error flattie types are mispackaged
|
|
||||||
import { flattie } from 'flattie';
|
import { flattie } from 'flattie';
|
||||||
import { resolveConfig } from '../../core/config/config.js';
|
import { resolveConfig } from '../../core/config/config.js';
|
||||||
import { createSettings } from '../../core/config/settings.js';
|
import { createSettings } from '../../core/config/settings.js';
|
||||||
|
|
|
@ -279,7 +279,7 @@ export async function generateLookupMap({
|
||||||
message: AstroErrorData.DuplicateContentEntrySlugError.message(
|
message: AstroErrorData.DuplicateContentEntrySlugError.message(
|
||||||
collection,
|
collection,
|
||||||
slug,
|
slug,
|
||||||
lookupMap[collection]!.entries[slug],
|
lookupMap[collection].entries[slug],
|
||||||
rootRelativePath(root, filePath)
|
rootRelativePath(root, filePath)
|
||||||
),
|
),
|
||||||
hint:
|
hint:
|
||||||
|
|
|
@ -152,6 +152,8 @@ export async function staticBuild(
|
||||||
settings.timer.end('Server generate');
|
settings.timer.end('Server generate');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type {
|
import type {
|
||||||
RehypePlugin,
|
RehypePlugin as _RehypePlugin,
|
||||||
RemarkPlugin,
|
RemarkPlugin as _RemarkPlugin,
|
||||||
RemarkRehype,
|
RemarkRehype as _RemarkRehype,
|
||||||
ShikiConfig,
|
ShikiConfig,
|
||||||
} from '@astrojs/markdown-remark';
|
} from '@astrojs/markdown-remark';
|
||||||
import { markdownConfigDefaults } from '@astrojs/markdown-remark';
|
import { markdownConfigDefaults } from '@astrojs/markdown-remark';
|
||||||
|
@ -11,17 +11,39 @@ import type { AstroUserConfig, ViteUserConfig } from '../../@types/astro.js';
|
||||||
import type { OutgoingHttpHeaders } from 'node:http';
|
import type { OutgoingHttpHeaders } from 'node:http';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { pathToFileURL } from 'node:url';
|
import { pathToFileURL } from 'node:url';
|
||||||
import { type TypeOf, z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from '../path.js';
|
import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from '../path.js';
|
||||||
|
|
||||||
// These imports are required to appease TypeScript!
|
// The below types are required boilerplate to workaround a Zod issue since v3.21.2. Since that version,
|
||||||
// See https://github.com/withastro/astro/pull/8762
|
// Zod's compiled TypeScript would "simplify" certain values to their base representation, causing references
|
||||||
import '@shikijs/core';
|
// to transitive dependencies that Astro don't depend on (e.g. `mdast-util-to-hast` or `remark-rehype`). For example:
|
||||||
import 'mdast-util-to-hast';
|
//
|
||||||
|
// ```ts
|
||||||
|
// // input
|
||||||
|
// type Foo = { bar: string };
|
||||||
|
// export const value: Foo;
|
||||||
|
//
|
||||||
|
// // output
|
||||||
|
// export const value: { bar: string }; // <-- `Foo` is gone
|
||||||
|
// ```
|
||||||
|
//
|
||||||
|
// The types below will "complexify" the types so that TypeScript would not simplify them. This way it will
|
||||||
|
// reference the complex type directly, instead of referencing non-existent transitive dependencies.
|
||||||
|
//
|
||||||
|
// Also, make sure to not index the complexified type, as it would return a simplified value type, which goes
|
||||||
|
// back to the issue again. The complexified type should be the base representation that we want to expose.
|
||||||
|
|
||||||
type ShikiLangs = NonNullable<ShikiConfig['langs']>;
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||||
type ShikiTheme = NonNullable<ShikiConfig['theme']>;
|
interface ComplexifyUnionObj {}
|
||||||
type ShikiTransformers = NonNullable<ShikiConfig['transformers']>;
|
type ComplexifyWithUnion<T> = T & ComplexifyUnionObj;
|
||||||
|
type ComplexifyWithOmit<T> = Omit<T, '__nonExistent'>;
|
||||||
|
|
||||||
|
type ShikiLang = ComplexifyWithUnion<NonNullable<ShikiConfig['langs']>[number]>;
|
||||||
|
type ShikiTheme = ComplexifyWithUnion<NonNullable<ShikiConfig['theme']>>;
|
||||||
|
type ShikiTransformer = ComplexifyWithUnion<NonNullable<ShikiConfig['transformers']>[number]>;
|
||||||
|
type RehypePlugin = ComplexifyWithUnion<_RehypePlugin>;
|
||||||
|
type RemarkPlugin = ComplexifyWithUnion<_RemarkPlugin>;
|
||||||
|
type RemarkRehype = ComplexifyWithOmit<_RemarkRehype>;
|
||||||
|
|
||||||
const ASTRO_CONFIG_DEFAULTS = {
|
const ASTRO_CONFIG_DEFAULTS = {
|
||||||
root: '.',
|
root: '.',
|
||||||
|
@ -263,7 +285,7 @@ export const AstroConfigSchema = z.object({
|
||||||
shikiConfig: z
|
shikiConfig: z
|
||||||
.object({
|
.object({
|
||||||
langs: z
|
langs: z
|
||||||
.custom<ShikiLangs[number]>()
|
.custom<ShikiLang>()
|
||||||
.array()
|
.array()
|
||||||
.transform((langs) => {
|
.transform((langs) => {
|
||||||
for (const lang of langs) {
|
for (const lang of langs) {
|
||||||
|
@ -295,7 +317,7 @@ export const AstroConfigSchema = z.object({
|
||||||
.default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.themes!),
|
.default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.themes!),
|
||||||
wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap!),
|
wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap!),
|
||||||
transformers: z
|
transformers: z
|
||||||
.custom<ShikiTransformers[number]>()
|
.custom<ShikiTransformer>()
|
||||||
.array()
|
.array()
|
||||||
.transform((transformers) => {
|
.transform((transformers) => {
|
||||||
for (const transformer of transformers) {
|
for (const transformer of transformers) {
|
||||||
|
@ -331,7 +353,6 @@ export const AstroConfigSchema = z.object({
|
||||||
.default(ASTRO_CONFIG_DEFAULTS.markdown.rehypePlugins),
|
.default(ASTRO_CONFIG_DEFAULTS.markdown.rehypePlugins),
|
||||||
remarkRehype: z
|
remarkRehype: z
|
||||||
.custom<RemarkRehype>((data) => data instanceof Object && !Array.isArray(data))
|
.custom<RemarkRehype>((data) => data instanceof Object && !Array.isArray(data))
|
||||||
.optional()
|
|
||||||
.default(ASTRO_CONFIG_DEFAULTS.markdown.remarkRehype),
|
.default(ASTRO_CONFIG_DEFAULTS.markdown.remarkRehype),
|
||||||
gfm: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.gfm),
|
gfm: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.gfm),
|
||||||
smartypants: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.smartypants),
|
smartypants: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.smartypants),
|
||||||
|
@ -384,7 +405,7 @@ export const AstroConfigSchema = z.object({
|
||||||
.optional()
|
.optional()
|
||||||
.superRefine((i18n, ctx) => {
|
.superRefine((i18n, ctx) => {
|
||||||
if (i18n) {
|
if (i18n) {
|
||||||
const { defaultLocale, locales: _locales, fallback, domains, routing } = i18n;
|
const { defaultLocale, locales: _locales, fallback, domains } = i18n;
|
||||||
const locales = _locales.map((locale) => {
|
const locales = _locales.map((locale) => {
|
||||||
if (typeof locale === 'string') {
|
if (typeof locale === 'string') {
|
||||||
return locale;
|
return locale;
|
||||||
|
|
|
@ -37,6 +37,7 @@ let originalConsoleError: any;
|
||||||
let consoleFilterRefs = 0;
|
let consoleFilterRefs = 0;
|
||||||
|
|
||||||
export async function renderJSX(result: SSRResult, vnode: any): Promise<any> {
|
export async function renderJSX(result: SSRResult, vnode: any): Promise<any> {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case vnode instanceof HTMLString:
|
case vnode instanceof HTMLString:
|
||||||
if (vnode.toString().trim() === '') {
|
if (vnode.toString().trim() === '') {
|
||||||
|
@ -72,6 +73,7 @@ export async function renderJSX(result: SSRResult, vnode: any): Promise<any> {
|
||||||
|
|
||||||
async function renderJSXVNode(result: SSRResult, vnode: AstroVNode, skip: Skip): Promise<any> {
|
async function renderJSXVNode(result: SSRResult, vnode: AstroVNode, skip: Skip): Promise<any> {
|
||||||
if (isVNode(vnode)) {
|
if (isVNode(vnode)) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case !vnode.type: {
|
case !vnode.type: {
|
||||||
throw new Error(`Unable to render ${result.pathname} because it contains an undefined Component!
|
throw new Error(`Unable to render ${result.pathname} because it contains an undefined Component!
|
||||||
|
|
|
@ -60,7 +60,7 @@ describe('Astro Markdown plugins', () => {
|
||||||
|
|
||||||
const smartypantsHtml = await fixture.readFile('/with-smartypants/index.html');
|
const smartypantsHtml = await fixture.readFile('/with-smartypants/index.html');
|
||||||
const $2 = cheerio.load(smartypantsHtml);
|
const $2 = cheerio.load(smartypantsHtml);
|
||||||
assert.equal($2('p').html(), '“Smartypants” is — awesome');
|
assert.equal($2('p').html(), '”Smartypants” is — awesome');
|
||||||
|
|
||||||
testRemark(gfmHtml);
|
testRemark(gfmHtml);
|
||||||
testRehype(gfmHtml, '#github-flavored-markdown-test');
|
testRehype(gfmHtml, '#github-flavored-markdown-test');
|
||||||
|
@ -82,7 +82,7 @@ describe('Astro Markdown plugins', () => {
|
||||||
const $ = cheerio.load(html);
|
const $ = cheerio.load(html);
|
||||||
|
|
||||||
// test 1: smartypants applied correctly
|
// test 1: smartypants applied correctly
|
||||||
assert.equal($('p').html(), '“Smartypants” is — awesome');
|
assert.equal($('p').html(), '”Smartypants” is — awesome');
|
||||||
|
|
||||||
testRemark(html);
|
testRemark(html);
|
||||||
testRehype(html, '#smartypants-test');
|
testRehype(html, '#smartypants-test');
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe('MDX plugins', () => {
|
||||||
|
|
||||||
const quote = selectSmartypantsQuote(document);
|
const quote = selectSmartypantsQuote(document);
|
||||||
assert.notEqual(quote, null);
|
assert.notEqual(quote, null);
|
||||||
assert.equal(quote.textContent.includes('“Smartypants” is — awesome'), true);
|
assert.equal(quote.textContent.includes('”Smartypants” is — awesome'), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports custom rehype plugins', async () => {
|
it('supports custom rehype plugins', async () => {
|
||||||
|
@ -174,7 +174,7 @@ describe('MDX plugins', () => {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
quote.textContent.includes('“Smartypants” is — awesome'),
|
quote.textContent.includes('”Smartypants” is — awesome'),
|
||||||
true,
|
true,
|
||||||
'Respects `markdown.smartypants` unexpectedly.'
|
'Respects `markdown.smartypants` unexpectedly.'
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,7 @@ describe('MDX - Vite env vars', () => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
document
|
document
|
||||||
.querySelector('[data-env-variable-exports-unknown]')
|
.querySelector('[data-env-variable-exports-unknown]')
|
||||||
?.innerHTML.includes('exports: ””'), // NOTE: these double quotes are special unicode quotes emitted in the HTML file
|
?.innerHTML.includes('exports: ""'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
4032
pnpm-lock.yaml
generated
4032
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue