mirror of
https://github.com/withastro/astro.git
synced 2025-01-23 11:01:54 -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/traverse": "^7.23.3",
|
||||
"@babel/types": "^7.23.3",
|
||||
"@shikijs/core": "^1.1.2",
|
||||
"@types/babel__core": "^7.20.4",
|
||||
"acorn": "^8.11.2",
|
||||
"aria-query": "^5.3.0",
|
||||
|
@ -155,7 +154,6 @@
|
|||
"js-yaml": "^4.1.0",
|
||||
"kleur": "^4.1.4",
|
||||
"magic-string": "^0.30.3",
|
||||
"mdast-util-to-hast": "13.0.2",
|
||||
"mime": "^3.0.0",
|
||||
"ora": "^7.0.1",
|
||||
"p-limit": "^5.0.0",
|
||||
|
|
|
@ -7,7 +7,6 @@ import { bgGreen, black, bold, dim, yellow } from 'kleur/colors';
|
|||
|
||||
import { formatWithOptions } from 'node:util';
|
||||
import dlv from 'dlv';
|
||||
// @ts-expect-error flattie types are mispackaged
|
||||
import { flattie } from 'flattie';
|
||||
import { resolveConfig } from '../../core/config/config.js';
|
||||
import { createSettings } from '../../core/config/settings.js';
|
||||
|
|
|
@ -279,7 +279,7 @@ export async function generateLookupMap({
|
|||
message: AstroErrorData.DuplicateContentEntrySlugError.message(
|
||||
collection,
|
||||
slug,
|
||||
lookupMap[collection]!.entries[slug],
|
||||
lookupMap[collection].entries[slug],
|
||||
rootRelativePath(root, filePath)
|
||||
),
|
||||
hint:
|
||||
|
|
|
@ -152,6 +152,8 @@ export async function staticBuild(
|
|||
settings.timer.end('Server generate');
|
||||
return;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type {
|
||||
RehypePlugin,
|
||||
RemarkPlugin,
|
||||
RemarkRehype,
|
||||
RehypePlugin as _RehypePlugin,
|
||||
RemarkPlugin as _RemarkPlugin,
|
||||
RemarkRehype as _RemarkRehype,
|
||||
ShikiConfig,
|
||||
} 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 path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import { type TypeOf, z } from 'zod';
|
||||
import { z } from 'zod';
|
||||
import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from '../path.js';
|
||||
|
||||
// These imports are required to appease TypeScript!
|
||||
// See https://github.com/withastro/astro/pull/8762
|
||||
import '@shikijs/core';
|
||||
import 'mdast-util-to-hast';
|
||||
// The below types are required boilerplate to workaround a Zod issue since v3.21.2. Since that version,
|
||||
// Zod's compiled TypeScript would "simplify" certain values to their base representation, causing references
|
||||
// to transitive dependencies that Astro don't depend on (e.g. `mdast-util-to-hast` or `remark-rehype`). For example:
|
||||
//
|
||||
// ```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']>;
|
||||
type ShikiTheme = NonNullable<ShikiConfig['theme']>;
|
||||
type ShikiTransformers = NonNullable<ShikiConfig['transformers']>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface ComplexifyUnionObj {}
|
||||
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 = {
|
||||
root: '.',
|
||||
|
@ -263,7 +285,7 @@ export const AstroConfigSchema = z.object({
|
|||
shikiConfig: z
|
||||
.object({
|
||||
langs: z
|
||||
.custom<ShikiLangs[number]>()
|
||||
.custom<ShikiLang>()
|
||||
.array()
|
||||
.transform((langs) => {
|
||||
for (const lang of langs) {
|
||||
|
@ -295,7 +317,7 @@ export const AstroConfigSchema = z.object({
|
|||
.default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.themes!),
|
||||
wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap!),
|
||||
transformers: z
|
||||
.custom<ShikiTransformers[number]>()
|
||||
.custom<ShikiTransformer>()
|
||||
.array()
|
||||
.transform((transformers) => {
|
||||
for (const transformer of transformers) {
|
||||
|
@ -331,7 +353,6 @@ export const AstroConfigSchema = z.object({
|
|||
.default(ASTRO_CONFIG_DEFAULTS.markdown.rehypePlugins),
|
||||
remarkRehype: z
|
||||
.custom<RemarkRehype>((data) => data instanceof Object && !Array.isArray(data))
|
||||
.optional()
|
||||
.default(ASTRO_CONFIG_DEFAULTS.markdown.remarkRehype),
|
||||
gfm: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.gfm),
|
||||
smartypants: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.smartypants),
|
||||
|
@ -384,7 +405,7 @@ export const AstroConfigSchema = z.object({
|
|||
.optional()
|
||||
.superRefine((i18n, ctx) => {
|
||||
if (i18n) {
|
||||
const { defaultLocale, locales: _locales, fallback, domains, routing } = i18n;
|
||||
const { defaultLocale, locales: _locales, fallback, domains } = i18n;
|
||||
const locales = _locales.map((locale) => {
|
||||
if (typeof locale === 'string') {
|
||||
return locale;
|
||||
|
|
|
@ -37,6 +37,7 @@ let originalConsoleError: any;
|
|||
let consoleFilterRefs = 0;
|
||||
|
||||
export async function renderJSX(result: SSRResult, vnode: any): Promise<any> {
|
||||
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
||||
switch (true) {
|
||||
case vnode instanceof HTMLString:
|
||||
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> {
|
||||
if (isVNode(vnode)) {
|
||||
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
||||
switch (true) {
|
||||
case !vnode.type: {
|
||||
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 $2 = cheerio.load(smartypantsHtml);
|
||||
assert.equal($2('p').html(), '“Smartypants” is — awesome');
|
||||
assert.equal($2('p').html(), '”Smartypants” is — awesome');
|
||||
|
||||
testRemark(gfmHtml);
|
||||
testRehype(gfmHtml, '#github-flavored-markdown-test');
|
||||
|
@ -82,7 +82,7 @@ describe('Astro Markdown plugins', () => {
|
|||
const $ = cheerio.load(html);
|
||||
|
||||
// test 1: smartypants applied correctly
|
||||
assert.equal($('p').html(), '“Smartypants” is — awesome');
|
||||
assert.equal($('p').html(), '”Smartypants” is — awesome');
|
||||
|
||||
testRemark(html);
|
||||
testRehype(html, '#smartypants-test');
|
||||
|
|
|
@ -47,7 +47,7 @@ describe('MDX plugins', () => {
|
|||
|
||||
const quote = selectSmartypantsQuote(document);
|
||||
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 () => {
|
||||
|
@ -174,7 +174,7 @@ describe('MDX plugins', () => {
|
|||
);
|
||||
} else {
|
||||
assert.equal(
|
||||
quote.textContent.includes('“Smartypants” is — awesome'),
|
||||
quote.textContent.includes('”Smartypants” is — awesome'),
|
||||
true,
|
||||
'Respects `markdown.smartypants` unexpectedly.'
|
||||
);
|
||||
|
|
|
@ -46,7 +46,7 @@ describe('MDX - Vite env vars', () => {
|
|||
assert.equal(
|
||||
document
|
||||
.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
|
||||
);
|
||||
});
|
||||
|
|
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