Compare commits
6 commits
main
...
chore/use-
Author | SHA1 | Date | |
---|---|---|---|
|
a09ee5a95c | ||
|
6a3ce6c738 | ||
|
3fd60556ac | ||
|
966bc2ca0e | ||
|
a58cc96091 | ||
|
07613b96bb |
320 changed files with 1398 additions and 989 deletions
184
.eslintrc.cjs
184
.eslintrc.cjs
|
@ -1,98 +1,98 @@
|
|||
const { builtinModules } = require('module');
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended-type-checked',
|
||||
'plugin:@typescript-eslint/stylistic-type-checked',
|
||||
'prettier',
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'],
|
||||
rules: {
|
||||
// These off/configured-differently-by-default rules fit well for us
|
||||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
|
||||
],
|
||||
'no-only-tests/no-only-tests': 'error',
|
||||
'@typescript-eslint/no-shadow': ['error'],
|
||||
'no-console': 'warn',
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended-type-checked',
|
||||
'plugin:@typescript-eslint/stylistic-type-checked',
|
||||
'prettier',
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'],
|
||||
rules: {
|
||||
// These off/configured-differently-by-default rules fit well for us
|
||||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
|
||||
],
|
||||
'no-only-tests/no-only-tests': 'error',
|
||||
'@typescript-eslint/no-shadow': ['error'],
|
||||
'no-console': 'warn',
|
||||
|
||||
// Todo: do we want these?
|
||||
'@typescript-eslint/array-type': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/class-literal-property-style': 'off',
|
||||
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
||||
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/no-base-to-string': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-floating-promises': 'off',
|
||||
'@typescript-eslint/no-misused-promises': 'off',
|
||||
'@typescript-eslint/no-redundant-type-constituents': 'off',
|
||||
'@typescript-eslint/no-this-alias': 'off',
|
||||
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||
'@typescript-eslint/no-unsafe-call': 'off',
|
||||
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||
'@typescript-eslint/no-unsafe-return': 'off',
|
||||
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
||||
'@typescript-eslint/prefer-optional-chain': 'off',
|
||||
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
|
||||
'@typescript-eslint/require-await': 'off',
|
||||
'@typescript-eslint/restrict-plus-operands': 'off',
|
||||
'@typescript-eslint/restrict-template-expressions': 'off',
|
||||
'@typescript-eslint/sort-type-constituents': 'off',
|
||||
'@typescript-eslint/unbound-method': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
// Todo: do we want these?
|
||||
'@typescript-eslint/array-type': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/class-literal-property-style': 'off',
|
||||
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
||||
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/no-base-to-string': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-floating-promises': 'off',
|
||||
'@typescript-eslint/no-misused-promises': 'off',
|
||||
'@typescript-eslint/no-redundant-type-constituents': 'off',
|
||||
'@typescript-eslint/no-this-alias': 'off',
|
||||
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||
'@typescript-eslint/no-unsafe-call': 'off',
|
||||
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||
'@typescript-eslint/no-unsafe-return': 'off',
|
||||
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
||||
'@typescript-eslint/prefer-optional-chain': 'off',
|
||||
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
|
||||
'@typescript-eslint/require-await': 'off',
|
||||
'@typescript-eslint/restrict-plus-operands': 'off',
|
||||
'@typescript-eslint/restrict-template-expressions': 'off',
|
||||
'@typescript-eslint/sort-type-constituents': 'off',
|
||||
'@typescript-eslint/unbound-method': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
|
||||
// These rules enabled by the preset configs don't work well for us
|
||||
'@typescript-eslint/await-thenable': 'off',
|
||||
'prefer-const': 'off',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
// Ensure Node builtins aren't included in Astro's server runtime
|
||||
files: ['packages/astro/src/runtime/**/*.ts'],
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
paths: [...builtinModules],
|
||||
patterns: ['node:*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['packages/**/test/*.js', 'packages/**/*.js'],
|
||||
env: {
|
||||
mocha: true,
|
||||
},
|
||||
globals: {
|
||||
globalThis: false, // false means read-only
|
||||
},
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['packages/integrations/**/*.ts'],
|
||||
rules: {
|
||||
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['benchmark/**/*.js'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
// These rules enabled by the preset configs don't work well for us
|
||||
'@typescript-eslint/await-thenable': 'off',
|
||||
'prefer-const': 'off',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
// Ensure Node builtins aren't included in Astro's server runtime
|
||||
files: ['packages/astro/src/runtime/**/*.ts'],
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
paths: [...builtinModules],
|
||||
patterns: ['node:*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['packages/**/test/*.js', 'packages/**/*.js'],
|
||||
env: {
|
||||
mocha: true,
|
||||
},
|
||||
globals: {
|
||||
globalThis: false, // false means read-only
|
||||
},
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['packages/integrations/**/*.ts'],
|
||||
rules: {
|
||||
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['benchmark/**/*.js'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -4,3 +4,5 @@
|
|||
1335797903a57716e9a02b0ffd8ca636b3883c62
|
||||
# Manually format .astro files in example projects (#3862)
|
||||
59e8c71786fd1c154904b3fefa7d26d88f4d92d2
|
||||
# New formatting using Biome
|
||||
07613b96bbe7a74179895c8cbe5f364133edd9ee
|
||||
|
|
56
.github/scripts/bundle-size.mjs
vendored
56
.github/scripts/bundle-size.mjs
vendored
|
@ -1,18 +1,18 @@
|
|||
import { build } from 'esbuild';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { build } from 'esbuild';
|
||||
|
||||
const CLIENT_RUNTIME_PATH = 'packages/astro/src/runtime/client/';
|
||||
|
||||
function formatBytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 B';
|
||||
if (bytes === 0) return '0 B';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
export default async function checkBundleSize({ github, context }) {
|
||||
|
@ -24,7 +24,7 @@ export default async function checkBundleSize({ github, context }) {
|
|||
pull_number: PR_NUM,
|
||||
});
|
||||
const clientRuntimeFiles = files.filter((file) => {
|
||||
return file.filename.startsWith(CLIENT_RUNTIME_PATH) && file.status !== 'removed'
|
||||
return file.filename.startsWith(CLIENT_RUNTIME_PATH) && file.status !== 'removed';
|
||||
});
|
||||
if (clientRuntimeFiles.length === 0) return;
|
||||
|
||||
|
@ -35,17 +35,26 @@ export default async function checkBundleSize({ github, context }) {
|
|||
const output = await bundle(clientRuntimeFiles);
|
||||
|
||||
for (let [filename, { oldSize, newSize, sourceFile }] of Object.entries(output)) {
|
||||
filename = ['idle', 'load', 'media', 'only', 'visible'].includes(filename) ? `client:${filename}` : filename;
|
||||
const prefix = (newSize - oldSize) === 0 ? '' : (newSize - oldSize) > 0 ? '+ ' : '- ';
|
||||
filename = ['idle', 'load', 'media', 'only', 'visible'].includes(filename)
|
||||
? `client:${filename}`
|
||||
: filename;
|
||||
const prefix = newSize - oldSize === 0 ? '' : newSize - oldSize > 0 ? '+ ' : '- ';
|
||||
const change = `${prefix}${formatBytes(newSize - oldSize)}`;
|
||||
table.push(`| [\`${filename}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${context.payload.pull_request.head.ref}/${sourceFile}) | ${formatBytes(oldSize)} | ${formatBytes(newSize)} | ${change} |`);
|
||||
table.push(
|
||||
`| [\`${filename}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${
|
||||
context.payload.pull_request.head.ref
|
||||
}/${sourceFile}) | ${formatBytes(oldSize)} | ${formatBytes(newSize)} | ${change} |`
|
||||
);
|
||||
}
|
||||
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
...context.repo,
|
||||
issue_number: PR_NUM
|
||||
})
|
||||
const comment = comments.find(comment => comment.user.login === 'github-actions[bot]' && comment.body.includes('Bundle Size Check'));
|
||||
issue_number: PR_NUM,
|
||||
});
|
||||
const comment = comments.find(
|
||||
(comment) =>
|
||||
comment.user.login === 'github-actions[bot]' && comment.body.includes('Bundle Size Check')
|
||||
);
|
||||
const method = comment ? 'updateComment' : 'createComment';
|
||||
const payload = comment ? { comment_id: comment.id } : { issue_number: PR_NUM };
|
||||
await github.rest.issues[method]({
|
||||
|
@ -60,26 +69,35 @@ ${table.join('\n')}`,
|
|||
}
|
||||
|
||||
async function bundle(files) {
|
||||
|
||||
const { metafile } = await build({
|
||||
entryPoints: [...files.map(({ filename }) => filename), ...files.map(({ filename }) => `main/${filename}`).filter(f => existsSync(f))],
|
||||
entryPoints: [
|
||||
...files.map(({ filename }) => filename),
|
||||
...files.map(({ filename }) => `main/${filename}`).filter((f) => existsSync(f)),
|
||||
],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
sourcemap: false,
|
||||
target: ['es2018'],
|
||||
outdir: 'out',
|
||||
metafile: true,
|
||||
})
|
||||
});
|
||||
|
||||
return Object.entries(metafile.outputs).reduce((acc, [filename, info]) => {
|
||||
filename = filename.slice('out/'.length);
|
||||
if (filename.startsWith('main/')) {
|
||||
filename = filename.slice('main/'.length).replace(CLIENT_RUNTIME_PATH, '').replace('.js', '');
|
||||
const oldSize = info.bytes;
|
||||
return Object.assign(acc, { [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { oldSize }) });
|
||||
return Object.assign(acc, {
|
||||
[filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { oldSize }),
|
||||
});
|
||||
}
|
||||
filename = filename.replace(CLIENT_RUNTIME_PATH, '').replace('.js', '');
|
||||
const newSize = info.bytes;
|
||||
return Object.assign(acc, { [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { newSize, sourceFile: Object.keys(info.inputs).find(src => src.endsWith('.ts')) }) });
|
||||
return Object.assign(acc, {
|
||||
[filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, {
|
||||
newSize,
|
||||
sourceFile: Object.keys(info.inputs).find((src) => src.endsWith('.ts')),
|
||||
}),
|
||||
});
|
||||
}, {});
|
||||
}
|
||||
|
|
|
@ -16,3 +16,9 @@ benchmark/results/
|
|||
|
||||
# Files
|
||||
pnpm-lock.yaml
|
||||
*.js
|
||||
*.ts
|
||||
*.mjs
|
||||
*.cjs
|
||||
*.json
|
||||
*.jsonc
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { execaCommand } from 'execa';
|
||||
import { markdownTable } from 'markdown-table';
|
||||
import fs from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { execaCommand } from 'execa';
|
||||
import { markdownTable } from 'markdown-table';
|
||||
import { astroBin } from './_util.js';
|
||||
|
||||
/** @typedef {Record<string, import('../../packages/astro/src/core/config/timer').Stat>} AstroTimerStat */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { execaCommand } from 'execa';
|
||||
import { markdownTable } from 'markdown-table';
|
||||
import fs from 'node:fs/promises';
|
||||
import http from 'node:http';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { execaCommand } from 'execa';
|
||||
import { markdownTable } from 'markdown-table';
|
||||
import { waitUntilBusy } from 'port-authority';
|
||||
import { calculateStat, astroBin } from './_util.js';
|
||||
import { renderFiles } from '../make-project/render-default.js';
|
||||
import { astroBin, calculateStat } from './_util.js';
|
||||
|
||||
const port = 4322;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import fs from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import autocannon from 'autocannon';
|
||||
import { execaCommand } from 'execa';
|
||||
import { markdownTable } from 'markdown-table';
|
||||
import fs from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { waitUntilBusy } from 'port-authority';
|
||||
import pb from 'pretty-bytes';
|
||||
import { astroBin } from './_util.js';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import mri from 'mri';
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import mri from 'mri';
|
||||
|
||||
const args = mri(process.argv.slice(2));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { CreatePreviewServer } from 'astro';
|
||||
import { createServer } from 'node:http';
|
||||
import type { CreatePreviewServer } from 'astro';
|
||||
import enableDestroy from 'server-destroy';
|
||||
|
||||
const preview: CreatePreviewServer = async function ({ serverEntrypoint, host, port }) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import type { SSRManifest } from 'astro';
|
||||
import { NodeApp, applyPolyfills } from 'astro/app/node';
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
|
||||
applyPolyfills();
|
||||
|
||||
|
|
41
biome.json
Normal file
41
biome.json
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.2.1/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": true,
|
||||
"ignore": [
|
||||
"examples/basics/src/layouts/**",
|
||||
"examples/with-nanostores/src/layouts/**",
|
||||
"benchmark/projects/**",
|
||||
"benchmark/results/**",
|
||||
"**/dist",
|
||||
"**/smoke",
|
||||
"**/node_modules",
|
||||
"**/fixtures",
|
||||
"**/vendor",
|
||||
"**/.vercel"
|
||||
]
|
||||
},
|
||||
"linter": {
|
||||
"enabled": false
|
||||
},
|
||||
"formatter": {
|
||||
"lineWidth": 100
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "single",
|
||||
"trailingComma": "es5"
|
||||
}
|
||||
},
|
||||
"json": {
|
||||
"parser": {
|
||||
"allowComments": true
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import mdx from '@astrojs/mdx';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
import sitemap from '@astrojs/sitemap';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import rss from '@astrojs/rss';
|
||||
import { SITE_DESCRIPTION, SITE_TITLE } from '../consts';
|
||||
import { getCollection } from 'astro:content';
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
||||
|
||||
export async function GET(context) {
|
||||
const posts = await getCollection('blog');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import alpine from '@astrojs/alpinejs';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import lit from '@astrojs/lit';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import preact from '@astrojs/preact';
|
||||
import react from '@astrojs/react';
|
||||
import solid from '@astrojs/solid-js';
|
||||
import svelte from '@astrojs/svelte';
|
||||
import vue from '@astrojs/vue';
|
||||
import solid from '@astrojs/solid-js';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import preact from '@astrojs/preact';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { h, Fragment } from 'preact';
|
||||
import { Fragment, h } from 'preact';
|
||||
import './Counter.css';
|
||||
|
||||
export default function Counter({ children, count }) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import react from '@astrojs/react';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import solid from '@astrojs/solid-js';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import svelte from '@astrojs/svelte';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import vue from '@astrojs/vue';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import node from '@astrojs/node';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import node from '@astrojs/node';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineMiddleware, sequence } from 'astro:middleware';
|
||||
import htmlMinifier from 'html-minifier';
|
||||
import { defineMiddleware, sequence } from 'astro:middleware';
|
||||
|
||||
const limit = 50;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import svelte from '@astrojs/svelte';
|
||||
import node from '@astrojs/node';
|
||||
import svelte from '@astrojs/svelte';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { productMap } from '../../../models/db';
|
||||
import type { APIContext } from 'astro';
|
||||
import { productMap } from '../../../models/db';
|
||||
|
||||
export function GET({ params }: APIContext) {
|
||||
const id = Number(params.id);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import markdoc from '@astrojs/markdoc';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { defineMarkdocConfig, component } from '@astrojs/markdoc/config';
|
||||
import { component, defineMarkdocConfig } from '@astrojs/markdoc/config';
|
||||
|
||||
export default defineMarkdocConfig({
|
||||
tags: {
|
||||
|
|
|
@ -10,9 +10,7 @@ const adder = ([selector, className]) => {
|
|||
return (node) => selectAll(selector, node).forEach(writer);
|
||||
};
|
||||
|
||||
const write =
|
||||
(className) =>
|
||||
({ properties }) => {
|
||||
if (!properties.className) properties.className = className;
|
||||
else properties.className += ` ${className}`;
|
||||
};
|
||||
const write = (className) => ({ properties }) => {
|
||||
if (!properties.className) properties.className = className;
|
||||
else properties.className += ` ${className}`;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import mdx from '@astrojs/mdx';
|
||||
import preact from '@astrojs/preact';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import preact from '@astrojs/preact';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { isCartOpen, addCartItem } from '../cartStore';
|
||||
import type { CartItemDisplayInfo } from '../cartStore';
|
||||
import type { ComponentChildren } from 'preact';
|
||||
import { addCartItem, isCartOpen } from '../cartStore';
|
||||
import type { CartItemDisplayInfo } from '../cartStore';
|
||||
|
||||
type Props = {
|
||||
item: CartItemDisplayInfo;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import tailwind from '@astrojs/tailwind';
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
"dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
|
||||
"format": "pnpm run format:code",
|
||||
"format:ci": "pnpm run format:imports && pnpm run format:code",
|
||||
"format:code": "prettier -w \"**/*\" --ignore-unknown --cache",
|
||||
"format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json",
|
||||
"format:code": "biome check --apply-unsafe ./ && prettier -w \"**/*\" --ignore-unknown --cache",
|
||||
"test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
|
||||
"test:match": "cd packages/astro && pnpm run test:match",
|
||||
"test:unit": "cd packages/astro && pnpm run test:unit",
|
||||
|
@ -78,6 +77,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/check": "^0.1.0",
|
||||
"@biomejs/biome": "1.2.1",
|
||||
"@changesets/changelog-github": "^0.4.8",
|
||||
"@changesets/cli": "^2.26.2",
|
||||
"@types/node": "^18.17.8",
|
||||
|
@ -89,7 +89,6 @@
|
|||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"only-allow": "^1.1.1",
|
||||
"organize-imports-cli": "^0.10.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier-plugin-astro": "^0.12.0",
|
||||
"tiny-glob": "^0.2.9",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import chai from 'chai';
|
||||
import chaiPromises from 'chai-as-promised';
|
||||
import { phpFeedItem, web1FeedItem } from './test-utils.js';
|
||||
import { pagesGlobToRssItems } from '../dist/index.js';
|
||||
import { phpFeedItem, web1FeedItem } from './test-utils.js';
|
||||
|
||||
chai.use(chaiPromises);
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import rss, { getRssString } from '../dist/index.js';
|
||||
import { rssSchema } from '../dist/schema.js';
|
||||
import chai from 'chai';
|
||||
import chaiPromises from 'chai-as-promised';
|
||||
import chaiXml from 'chai-xml';
|
||||
import rss, { getRssString } from '../dist/index.js';
|
||||
import { rssSchema } from '../dist/schema.js';
|
||||
import {
|
||||
title,
|
||||
description,
|
||||
site,
|
||||
phpFeedItem,
|
||||
phpFeedItemWithContent,
|
||||
phpFeedItemWithCustomData,
|
||||
site,
|
||||
title,
|
||||
web1FeedItem,
|
||||
web1FeedItemWithContent,
|
||||
web1FeedItemWithAllData,
|
||||
web1FeedItemWithContent,
|
||||
} from './test-utils.js';
|
||||
|
||||
chai.use(chaiPromises);
|
||||
|
@ -21,15 +21,93 @@ chai.use(chaiXml);
|
|||
// note: I spent 30 minutes looking for a nice node-based snapshot tool
|
||||
// ...and I gave up. Enjoy big strings!
|
||||
// prettier-ignore
|
||||
const validXmlResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${phpFeedItem.title}]]></title><link>${site}${phpFeedItem.link}/</link><guid isPermaLink="true">${site}${phpFeedItem.link}/</guid><description><![CDATA[${phpFeedItem.description}]]></description><pubDate>${new Date(phpFeedItem.pubDate).toUTCString()}</pubDate></item><item><title><![CDATA[${web1FeedItem.title}]]></title><link>${site}${web1FeedItem.link}/</link><guid isPermaLink="true">${site}${web1FeedItem.link}/</guid><description><![CDATA[${web1FeedItem.description}]]></description><pubDate>${new Date(web1FeedItem.pubDate).toUTCString()}</pubDate></item></channel></rss>`;
|
||||
const validXmlResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${
|
||||
phpFeedItem.title
|
||||
}]]></title><link>${site}${phpFeedItem.link}/</link><guid isPermaLink="true">${site}${
|
||||
phpFeedItem.link
|
||||
}/</guid><description><![CDATA[${phpFeedItem.description}]]></description><pubDate>${new Date(
|
||||
phpFeedItem.pubDate
|
||||
).toUTCString()}</pubDate></item><item><title><![CDATA[${
|
||||
web1FeedItem.title
|
||||
}]]></title><link>${site}${web1FeedItem.link}/</link><guid isPermaLink="true">${site}${
|
||||
web1FeedItem.link
|
||||
}/</guid><description><![CDATA[${web1FeedItem.description}]]></description><pubDate>${new Date(
|
||||
web1FeedItem.pubDate
|
||||
).toUTCString()}</pubDate></item></channel></rss>`;
|
||||
// prettier-ignore
|
||||
const validXmlWithoutWeb1FeedResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${phpFeedItem.title}]]></title><link>${site}${phpFeedItem.link}/</link><guid isPermaLink="true">${site}${phpFeedItem.link}/</guid><description><![CDATA[${phpFeedItem.description}]]></description><pubDate>${new Date(phpFeedItem.pubDate).toUTCString()}</pubDate></item></channel></rss>`;
|
||||
const validXmlWithoutWeb1FeedResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${
|
||||
phpFeedItem.title
|
||||
}]]></title><link>${site}${phpFeedItem.link}/</link><guid isPermaLink="true">${site}${
|
||||
phpFeedItem.link
|
||||
}/</guid><description><![CDATA[${phpFeedItem.description}]]></description><pubDate>${new Date(
|
||||
phpFeedItem.pubDate
|
||||
).toUTCString()}</pubDate></item></channel></rss>`;
|
||||
// prettier-ignore
|
||||
const validXmlWithContentResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${phpFeedItemWithContent.title}]]></title><link>${site}${phpFeedItemWithContent.link}/</link><guid isPermaLink="true">${site}${phpFeedItemWithContent.link}/</guid><description><![CDATA[${phpFeedItemWithContent.description}]]></description><pubDate>${new Date(phpFeedItemWithContent.pubDate).toUTCString()}</pubDate><content:encoded><![CDATA[${phpFeedItemWithContent.content}]]></content:encoded></item><item><title><![CDATA[${web1FeedItemWithContent.title}]]></title><link>${site}${web1FeedItemWithContent.link}/</link><guid isPermaLink="true">${site}${web1FeedItemWithContent.link}/</guid><description><![CDATA[${web1FeedItemWithContent.description}]]></description><pubDate>${new Date(web1FeedItemWithContent.pubDate).toUTCString()}</pubDate><content:encoded><![CDATA[${web1FeedItemWithContent.content}]]></content:encoded></item></channel></rss>`;
|
||||
const validXmlWithContentResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${
|
||||
phpFeedItemWithContent.title
|
||||
}]]></title><link>${site}${phpFeedItemWithContent.link}/</link><guid isPermaLink="true">${site}${
|
||||
phpFeedItemWithContent.link
|
||||
}/</guid><description><![CDATA[${
|
||||
phpFeedItemWithContent.description
|
||||
}]]></description><pubDate>${new Date(
|
||||
phpFeedItemWithContent.pubDate
|
||||
).toUTCString()}</pubDate><content:encoded><![CDATA[${
|
||||
phpFeedItemWithContent.content
|
||||
}]]></content:encoded></item><item><title><![CDATA[${
|
||||
web1FeedItemWithContent.title
|
||||
}]]></title><link>${site}${web1FeedItemWithContent.link}/</link><guid isPermaLink="true">${site}${
|
||||
web1FeedItemWithContent.link
|
||||
}/</guid><description><![CDATA[${
|
||||
web1FeedItemWithContent.description
|
||||
}]]></description><pubDate>${new Date(
|
||||
web1FeedItemWithContent.pubDate
|
||||
).toUTCString()}</pubDate><content:encoded><![CDATA[${
|
||||
web1FeedItemWithContent.content
|
||||
}]]></content:encoded></item></channel></rss>`;
|
||||
// prettier-ignore
|
||||
const validXmlResultWithAllData = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${phpFeedItem.title}]]></title><link>${site}${phpFeedItem.link}/</link><guid isPermaLink="true">${site}${phpFeedItem.link}/</guid><description><![CDATA[${phpFeedItem.description}]]></description><pubDate>${new Date(phpFeedItem.pubDate).toUTCString()}</pubDate></item><item><title><![CDATA[${web1FeedItemWithAllData.title}]]></title><link>${site}${web1FeedItemWithAllData.link}/</link><guid isPermaLink="true">${site}${web1FeedItemWithAllData.link}/</guid><description><![CDATA[${web1FeedItemWithAllData.description}]]></description><pubDate>${new Date(web1FeedItemWithAllData.pubDate).toUTCString()}</pubDate><category>${web1FeedItemWithAllData.categories[0]}</category><category>${web1FeedItemWithAllData.categories[1]}</category><author>${web1FeedItemWithAllData.author}</author><comments>${web1FeedItemWithAllData.commentsUrl}</comments><source url="${web1FeedItemWithAllData.source.url}">${web1FeedItemWithAllData.source.title}</source><enclosure url="${site}${web1FeedItemWithAllData.enclosure.url}" length="${web1FeedItemWithAllData.enclosure.length}" type="${web1FeedItemWithAllData.enclosure.type}"/></item></channel></rss>`;
|
||||
const validXmlResultWithAllData = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${
|
||||
phpFeedItem.title
|
||||
}]]></title><link>${site}${phpFeedItem.link}/</link><guid isPermaLink="true">${site}${
|
||||
phpFeedItem.link
|
||||
}/</guid><description><![CDATA[${phpFeedItem.description}]]></description><pubDate>${new Date(
|
||||
phpFeedItem.pubDate
|
||||
).toUTCString()}</pubDate></item><item><title><![CDATA[${
|
||||
web1FeedItemWithAllData.title
|
||||
}]]></title><link>${site}${web1FeedItemWithAllData.link}/</link><guid isPermaLink="true">${site}${
|
||||
web1FeedItemWithAllData.link
|
||||
}/</guid><description><![CDATA[${
|
||||
web1FeedItemWithAllData.description
|
||||
}]]></description><pubDate>${new Date(
|
||||
web1FeedItemWithAllData.pubDate
|
||||
).toUTCString()}</pubDate><category>${web1FeedItemWithAllData.categories[0]}</category><category>${
|
||||
web1FeedItemWithAllData.categories[1]
|
||||
}</category><author>${web1FeedItemWithAllData.author}</author><comments>${
|
||||
web1FeedItemWithAllData.commentsUrl
|
||||
}</comments><source url="${web1FeedItemWithAllData.source.url}">${
|
||||
web1FeedItemWithAllData.source.title
|
||||
}</source><enclosure url="${site}${web1FeedItemWithAllData.enclosure.url}" length="${
|
||||
web1FeedItemWithAllData.enclosure.length
|
||||
}" type="${web1FeedItemWithAllData.enclosure.type}"/></item></channel></rss>`;
|
||||
// prettier-ignore
|
||||
const validXmlWithCustomDataResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${phpFeedItemWithCustomData.title}]]></title><link>${site}${phpFeedItemWithCustomData.link}/</link><guid isPermaLink="true">${site}${phpFeedItemWithCustomData.link}/</guid><description><![CDATA[${phpFeedItemWithCustomData.description}]]></description><pubDate>${new Date(phpFeedItemWithCustomData.pubDate).toUTCString()}</pubDate>${phpFeedItemWithCustomData.customData}</item><item><title><![CDATA[${web1FeedItemWithContent.title}]]></title><link>${site}${web1FeedItemWithContent.link}/</link><guid isPermaLink="true">${site}${web1FeedItemWithContent.link}/</guid><description><![CDATA[${web1FeedItemWithContent.description}]]></description><pubDate>${new Date(web1FeedItemWithContent.pubDate).toUTCString()}</pubDate><content:encoded><![CDATA[${web1FeedItemWithContent.content}]]></content:encoded></item></channel></rss>`;
|
||||
const validXmlWithCustomDataResult = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link><item><title><![CDATA[${
|
||||
phpFeedItemWithCustomData.title
|
||||
}]]></title><link>${site}${phpFeedItemWithCustomData.link}/</link><guid isPermaLink="true">${site}${
|
||||
phpFeedItemWithCustomData.link
|
||||
}/</guid><description><![CDATA[${
|
||||
phpFeedItemWithCustomData.description
|
||||
}]]></description><pubDate>${new Date(phpFeedItemWithCustomData.pubDate).toUTCString()}</pubDate>${
|
||||
phpFeedItemWithCustomData.customData
|
||||
}</item><item><title><![CDATA[${web1FeedItemWithContent.title}]]></title><link>${site}${
|
||||
web1FeedItemWithContent.link
|
||||
}/</link><guid isPermaLink="true">${site}${
|
||||
web1FeedItemWithContent.link
|
||||
}/</guid><description><![CDATA[${
|
||||
web1FeedItemWithContent.description
|
||||
}]]></description><pubDate>${new Date(
|
||||
web1FeedItemWithContent.pubDate
|
||||
).toUTCString()}</pubDate><content:encoded><![CDATA[${
|
||||
web1FeedItemWithContent.content
|
||||
}]]></content:encoded></item></channel></rss>`;
|
||||
// prettier-ignore
|
||||
const validXmlWithStylesheet = `<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/feedstylesheet.css"?><rss version="2.0"><channel><title><![CDATA[${title}]]></title><description><![CDATA[${description}]]></description><link>${site}/</link></channel></rss>`;
|
||||
// prettier-ignore
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { getHighlighter as getShikiHighlighter } from 'shiki';
|
||||
import { themes } from './shiki-themes.js';
|
||||
import { languages } from './shiki-languages.js';
|
||||
import { themes } from './shiki-themes.js';
|
||||
|
||||
// Caches Promise<Highlighter> for reuse when the same theme and langs are provided
|
||||
const _resolvedHighlighters = new Map();
|
||||
|
|
|
@ -19,158 +19,432 @@ function handleLang(grammar, language) {
|
|||
|
||||
// prettier-ignore
|
||||
export const languages = {
|
||||
'abap': () => import('shiki/languages/abap.tmLanguage.json').then((mod) => handleLang(mod.default, 'abap')),
|
||||
'actionscript-3': () => import('shiki/languages/actionscript-3.tmLanguage.json').then((mod) => handleLang(mod.default, 'actionscript-3')),
|
||||
'ada': () => import('shiki/languages/ada.tmLanguage.json').then((mod) => handleLang(mod.default, 'ada')),
|
||||
'apache': () => import('shiki/languages/apache.tmLanguage.json').then((mod) => handleLang(mod.default, 'apache')),
|
||||
'apex': () => import('shiki/languages/apex.tmLanguage.json').then((mod) => handleLang(mod.default, 'apex')),
|
||||
'apl': () => import('shiki/languages/apl.tmLanguage.json').then((mod) => handleLang(mod.default, 'apl')),
|
||||
'applescript': () => import('shiki/languages/applescript.tmLanguage.json').then((mod) => handleLang(mod.default, 'applescript')),
|
||||
'ara': () => import('shiki/languages/ara.tmLanguage.json').then((mod) => handleLang(mod.default, 'ara')),
|
||||
'asm': () => import('shiki/languages/asm.tmLanguage.json').then((mod) => handleLang(mod.default, 'asm')),
|
||||
'astro': () => import('shiki/languages/astro.tmLanguage.json').then((mod) => handleLang(mod.default, 'astro')),
|
||||
'awk': () => import('shiki/languages/awk.tmLanguage.json').then((mod) => handleLang(mod.default, 'awk')),
|
||||
'ballerina': () => import('shiki/languages/ballerina.tmLanguage.json').then((mod) => handleLang(mod.default, 'ballerina')),
|
||||
'bat': () => import('shiki/languages/bat.tmLanguage.json').then((mod) => handleLang(mod.default, 'bat')),
|
||||
'berry': () => import('shiki/languages/berry.tmLanguage.json').then((mod) => handleLang(mod.default, 'berry')),
|
||||
'bibtex': () => import('shiki/languages/bibtex.tmLanguage.json').then((mod) => handleLang(mod.default, 'bibtex')),
|
||||
'bicep': () => import('shiki/languages/bicep.tmLanguage.json').then((mod) => handleLang(mod.default, 'bicep')),
|
||||
'blade': () => import('shiki/languages/blade.tmLanguage.json').then((mod) => handleLang(mod.default, 'blade')),
|
||||
'c': () => import('shiki/languages/c.tmLanguage.json').then((mod) => handleLang(mod.default, 'c')),
|
||||
'cadence': () => import('shiki/languages/cadence.tmLanguage.json').then((mod) => handleLang(mod.default, 'cadence')),
|
||||
'clarity': () => import('shiki/languages/clarity.tmLanguage.json').then((mod) => handleLang(mod.default, 'clarity')),
|
||||
'clojure': () => import('shiki/languages/clojure.tmLanguage.json').then((mod) => handleLang(mod.default, 'clojure')),
|
||||
'cmake': () => import('shiki/languages/cmake.tmLanguage.json').then((mod) => handleLang(mod.default, 'cmake')),
|
||||
'cobol': () => import('shiki/languages/cobol.tmLanguage.json').then((mod) => handleLang(mod.default, 'cobol')),
|
||||
'codeql': () => import('shiki/languages/codeql.tmLanguage.json').then((mod) => handleLang(mod.default, 'codeql')),
|
||||
'coffee': () => import('shiki/languages/coffee.tmLanguage.json').then((mod) => handleLang(mod.default, 'coffee')),
|
||||
'cpp-macro': () => import('shiki/languages/cpp-macro.tmLanguage.json').then((mod) => handleLang(mod.default, 'cpp-macro')),
|
||||
'cpp': () => import('shiki/languages/cpp.tmLanguage.json').then((mod) => handleLang(mod.default, 'cpp')),
|
||||
'crystal': () => import('shiki/languages/crystal.tmLanguage.json').then((mod) => handleLang(mod.default, 'crystal')),
|
||||
'csharp': () => import('shiki/languages/csharp.tmLanguage.json').then((mod) => handleLang(mod.default, 'csharp')),
|
||||
'css': () => import('shiki/languages/css.tmLanguage.json').then((mod) => handleLang(mod.default, 'css')),
|
||||
'cue': () => import('shiki/languages/cue.tmLanguage.json').then((mod) => handleLang(mod.default, 'cue')),
|
||||
'd': () => import('shiki/languages/d.tmLanguage.json').then((mod) => handleLang(mod.default, 'd')),
|
||||
'dart': () => import('shiki/languages/dart.tmLanguage.json').then((mod) => handleLang(mod.default, 'dart')),
|
||||
'dax': () => import('shiki/languages/dax.tmLanguage.json').then((mod) => handleLang(mod.default, 'dax')),
|
||||
'diff': () => import('shiki/languages/diff.tmLanguage.json').then((mod) => handleLang(mod.default, 'diff')),
|
||||
'docker': () => import('shiki/languages/docker.tmLanguage.json').then((mod) => handleLang(mod.default, 'docker')),
|
||||
'dream-maker': () => import('shiki/languages/dream-maker.tmLanguage.json').then((mod) => handleLang(mod.default, 'dream-maker')),
|
||||
'elixir': () => import('shiki/languages/elixir.tmLanguage.json').then((mod) => handleLang(mod.default, 'elixir')),
|
||||
'elm': () => import('shiki/languages/elm.tmLanguage.json').then((mod) => handleLang(mod.default, 'elm')),
|
||||
'erb': () => import('shiki/languages/erb.tmLanguage.json').then((mod) => handleLang(mod.default, 'erb')),
|
||||
'erlang': () => import('shiki/languages/erlang.tmLanguage.json').then((mod) => handleLang(mod.default, 'erlang')),
|
||||
'fish': () => import('shiki/languages/fish.tmLanguage.json').then((mod) => handleLang(mod.default, 'fish')),
|
||||
'fsharp': () => import('shiki/languages/fsharp.tmLanguage.json').then((mod) => handleLang(mod.default, 'fsharp')),
|
||||
'gherkin': () => import('shiki/languages/gherkin.tmLanguage.json').then((mod) => handleLang(mod.default, 'gherkin')),
|
||||
'git-commit': () => import('shiki/languages/git-commit.tmLanguage.json').then((mod) => handleLang(mod.default, 'git-commit')),
|
||||
'git-rebase': () => import('shiki/languages/git-rebase.tmLanguage.json').then((mod) => handleLang(mod.default, 'git-rebase')),
|
||||
'glsl': () => import('shiki/languages/glsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'glsl')),
|
||||
'gnuplot': () => import('shiki/languages/gnuplot.tmLanguage.json').then((mod) => handleLang(mod.default, 'gnuplot')),
|
||||
'go': () => import('shiki/languages/go.tmLanguage.json').then((mod) => handleLang(mod.default, 'go')),
|
||||
'graphql': () => import('shiki/languages/graphql.tmLanguage.json').then((mod) => handleLang(mod.default, 'graphql')),
|
||||
'groovy': () => import('shiki/languages/groovy.tmLanguage.json').then((mod) => handleLang(mod.default, 'groovy')),
|
||||
'hack': () => import('shiki/languages/hack.tmLanguage.json').then((mod) => handleLang(mod.default, 'hack')),
|
||||
'haml': () => import('shiki/languages/haml.tmLanguage.json').then((mod) => handleLang(mod.default, 'haml')),
|
||||
'handlebars': () => import('shiki/languages/handlebars.tmLanguage.json').then((mod) => handleLang(mod.default, 'handlebars')),
|
||||
'haskell': () => import('shiki/languages/haskell.tmLanguage.json').then((mod) => handleLang(mod.default, 'haskell')),
|
||||
'hcl': () => import('shiki/languages/hcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hcl')),
|
||||
'hlsl': () => import('shiki/languages/hlsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hlsl')),
|
||||
'html': () => import('shiki/languages/html.tmLanguage.json').then((mod) => handleLang(mod.default, 'html')),
|
||||
'http': () => import('shiki/languages/http.tmLanguage.json').then((mod) => handleLang(mod.default, 'http')),
|
||||
'imba': () => import('shiki/languages/imba.tmLanguage.json').then((mod) => handleLang(mod.default, 'imba')),
|
||||
'ini': () => import('shiki/languages/ini.tmLanguage.json').then((mod) => handleLang(mod.default, 'ini')),
|
||||
'java': () => import('shiki/languages/java.tmLanguage.json').then((mod) => handleLang(mod.default, 'java')),
|
||||
'javascript': () => import('shiki/languages/javascript.tmLanguage.json').then((mod) => handleLang(mod.default, 'javascript')),
|
||||
'jinja-html': () => import('shiki/languages/jinja-html.tmLanguage.json').then((mod) => handleLang(mod.default, 'jinja-html')),
|
||||
'jinja': () => import('shiki/languages/jinja.tmLanguage.json').then((mod) => handleLang(mod.default, 'jinja')),
|
||||
'jison': () => import('shiki/languages/jison.tmLanguage.json').then((mod) => handleLang(mod.default, 'jison')),
|
||||
'json': () => import('shiki/languages/json.tmLanguage.json').then((mod) => handleLang(mod.default, 'json')),
|
||||
'json5': () => import('shiki/languages/json5.tmLanguage.json').then((mod) => handleLang(mod.default, 'json5')),
|
||||
'jsonc': () => import('shiki/languages/jsonc.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsonc')),
|
||||
'jsonnet': () => import('shiki/languages/jsonnet.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsonnet')),
|
||||
'jssm': () => import('shiki/languages/jssm.tmLanguage.json').then((mod) => handleLang(mod.default, 'jssm')),
|
||||
'jsx': () => import('shiki/languages/jsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsx')),
|
||||
'julia': () => import('shiki/languages/julia.tmLanguage.json').then((mod) => handleLang(mod.default, 'julia')),
|
||||
'kotlin': () => import('shiki/languages/kotlin.tmLanguage.json').then((mod) => handleLang(mod.default, 'kotlin')),
|
||||
'latex': () => import('shiki/languages/latex.tmLanguage.json').then((mod) => handleLang(mod.default, 'latex')),
|
||||
'less': () => import('shiki/languages/less.tmLanguage.json').then((mod) => handleLang(mod.default, 'less')),
|
||||
'liquid': () => import('shiki/languages/liquid.tmLanguage.json').then((mod) => handleLang(mod.default, 'liquid')),
|
||||
'lisp': () => import('shiki/languages/lisp.tmLanguage.json').then((mod) => handleLang(mod.default, 'lisp')),
|
||||
'logo': () => import('shiki/languages/logo.tmLanguage.json').then((mod) => handleLang(mod.default, 'logo')),
|
||||
'lua': () => import('shiki/languages/lua.tmLanguage.json').then((mod) => handleLang(mod.default, 'lua')),
|
||||
'make': () => import('shiki/languages/make.tmLanguage.json').then((mod) => handleLang(mod.default, 'make')),
|
||||
'markdown': () => import('shiki/languages/markdown.tmLanguage.json').then((mod) => handleLang(mod.default, 'markdown')),
|
||||
'marko': () => import('shiki/languages/marko.tmLanguage.json').then((mod) => handleLang(mod.default, 'marko')),
|
||||
'matlab': () => import('shiki/languages/matlab.tmLanguage.json').then((mod) => handleLang(mod.default, 'matlab')),
|
||||
'mdx': () => import('shiki/languages/mdx.tmLanguage.json').then((mod) => handleLang(mod.default, 'mdx')),
|
||||
'mermaid': () => import('shiki/languages/mermaid.tmLanguage.json').then((mod) => handleLang(mod.default, 'mermaid')),
|
||||
'nginx': () => import('shiki/languages/nginx.tmLanguage.json').then((mod) => handleLang(mod.default, 'nginx')),
|
||||
'nim': () => import('shiki/languages/nim.tmLanguage.json').then((mod) => handleLang(mod.default, 'nim')),
|
||||
'nix': () => import('shiki/languages/nix.tmLanguage.json').then((mod) => handleLang(mod.default, 'nix')),
|
||||
'objective-c': () => import('shiki/languages/objective-c.tmLanguage.json').then((mod) => handleLang(mod.default, 'objective-c')),
|
||||
'objective-cpp': () => import('shiki/languages/objective-cpp.tmLanguage.json').then((mod) => handleLang(mod.default, 'objective-cpp')),
|
||||
'ocaml': () => import('shiki/languages/ocaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'ocaml')),
|
||||
'pascal': () => import('shiki/languages/pascal.tmLanguage.json').then((mod) => handleLang(mod.default, 'pascal')),
|
||||
'perl': () => import('shiki/languages/perl.tmLanguage.json').then((mod) => handleLang(mod.default, 'perl')),
|
||||
'php-html': () => import('shiki/languages/php-html.tmLanguage.json').then((mod) => handleLang(mod.default, 'php-html')),
|
||||
'php': () => import('shiki/languages/php.tmLanguage.json').then((mod) => handleLang(mod.default, 'php')),
|
||||
'plsql': () => import('shiki/languages/plsql.tmLanguage.json').then((mod) => handleLang(mod.default, 'plsql')),
|
||||
'postcss': () => import('shiki/languages/postcss.tmLanguage.json').then((mod) => handleLang(mod.default, 'postcss')),
|
||||
'powerquery': () => import('shiki/languages/powerquery.tmLanguage.json').then((mod) => handleLang(mod.default, 'powerquery')),
|
||||
'powershell': () => import('shiki/languages/powershell.tmLanguage.json').then((mod) => handleLang(mod.default, 'powershell')),
|
||||
'prisma': () => import('shiki/languages/prisma.tmLanguage.json').then((mod) => handleLang(mod.default, 'prisma')),
|
||||
'prolog': () => import('shiki/languages/prolog.tmLanguage.json').then((mod) => handleLang(mod.default, 'prolog')),
|
||||
'proto': () => import('shiki/languages/proto.tmLanguage.json').then((mod) => handleLang(mod.default, 'proto')),
|
||||
'pug': () => import('shiki/languages/pug.tmLanguage.json').then((mod) => handleLang(mod.default, 'pug')),
|
||||
'puppet': () => import('shiki/languages/puppet.tmLanguage.json').then((mod) => handleLang(mod.default, 'puppet')),
|
||||
'purescript': () => import('shiki/languages/purescript.tmLanguage.json').then((mod) => handleLang(mod.default, 'purescript')),
|
||||
'python': () => import('shiki/languages/python.tmLanguage.json').then((mod) => handleLang(mod.default, 'python')),
|
||||
'r': () => import('shiki/languages/r.tmLanguage.json').then((mod) => handleLang(mod.default, 'r')),
|
||||
'raku': () => import('shiki/languages/raku.tmLanguage.json').then((mod) => handleLang(mod.default, 'raku')),
|
||||
'razor': () => import('shiki/languages/razor.tmLanguage.json').then((mod) => handleLang(mod.default, 'razor')),
|
||||
'rel': () => import('shiki/languages/rel.tmLanguage.json').then((mod) => handleLang(mod.default, 'rel')),
|
||||
'riscv': () => import('shiki/languages/riscv.tmLanguage.json').then((mod) => handleLang(mod.default, 'riscv')),
|
||||
'rst': () => import('shiki/languages/rst.tmLanguage.json').then((mod) => handleLang(mod.default, 'rst')),
|
||||
'ruby': () => import('shiki/languages/ruby.tmLanguage.json').then((mod) => handleLang(mod.default, 'ruby')),
|
||||
'rust': () => import('shiki/languages/rust.tmLanguage.json').then((mod) => handleLang(mod.default, 'rust')),
|
||||
'sas': () => import('shiki/languages/sas.tmLanguage.json').then((mod) => handleLang(mod.default, 'sas')),
|
||||
'sass': () => import('shiki/languages/sass.tmLanguage.json').then((mod) => handleLang(mod.default, 'sass')),
|
||||
'scala': () => import('shiki/languages/scala.tmLanguage.json').then((mod) => handleLang(mod.default, 'scala')),
|
||||
'scheme': () => import('shiki/languages/scheme.tmLanguage.json').then((mod) => handleLang(mod.default, 'scheme')),
|
||||
'scss': () => import('shiki/languages/scss.tmLanguage.json').then((mod) => handleLang(mod.default, 'scss')),
|
||||
'shaderlab': () => import('shiki/languages/shaderlab.tmLanguage.json').then((mod) => handleLang(mod.default, 'shaderlab')),
|
||||
'shellscript': () => import('shiki/languages/shellscript.tmLanguage.json').then((mod) => handleLang(mod.default, 'shellscript')),
|
||||
'smalltalk': () => import('shiki/languages/smalltalk.tmLanguage.json').then((mod) => handleLang(mod.default, 'smalltalk')),
|
||||
'solidity': () => import('shiki/languages/solidity.tmLanguage.json').then((mod) => handleLang(mod.default, 'solidity')),
|
||||
'sparql': () => import('shiki/languages/sparql.tmLanguage.json').then((mod) => handleLang(mod.default, 'sparql')),
|
||||
'sql': () => import('shiki/languages/sql.tmLanguage.json').then((mod) => handleLang(mod.default, 'sql')),
|
||||
'ssh-config': () => import('shiki/languages/ssh-config.tmLanguage.json').then((mod) => handleLang(mod.default, 'ssh-config')),
|
||||
'stata': () => import('shiki/languages/stata.tmLanguage.json').then((mod) => handleLang(mod.default, 'stata')),
|
||||
'stylus': () => import('shiki/languages/stylus.tmLanguage.json').then((mod) => handleLang(mod.default, 'stylus')),
|
||||
'svelte': () => import('shiki/languages/svelte.tmLanguage.json').then((mod) => handleLang(mod.default, 'svelte')),
|
||||
'swift': () => import('shiki/languages/swift.tmLanguage.json').then((mod) => handleLang(mod.default, 'swift')),
|
||||
'system-verilog': () => import('shiki/languages/system-verilog.tmLanguage.json').then((mod) => handleLang(mod.default, 'system-verilog')),
|
||||
'tasl': () => import('shiki/languages/tasl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tasl')),
|
||||
'tcl': () => import('shiki/languages/tcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tcl')),
|
||||
'tex': () => import('shiki/languages/tex.tmLanguage.json').then((mod) => handleLang(mod.default, 'tex')),
|
||||
'toml': () => import('shiki/languages/toml.tmLanguage.json').then((mod) => handleLang(mod.default, 'toml')),
|
||||
'tsx': () => import('shiki/languages/tsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'tsx')),
|
||||
'turtle': () => import('shiki/languages/turtle.tmLanguage.json').then((mod) => handleLang(mod.default, 'turtle')),
|
||||
'twig': () => import('shiki/languages/twig.tmLanguage.json').then((mod) => handleLang(mod.default, 'twig')),
|
||||
'typescript': () => import('shiki/languages/typescript.tmLanguage.json').then((mod) => handleLang(mod.default, 'typescript')),
|
||||
'v': () => import('shiki/languages/v.tmLanguage.json').then((mod) => handleLang(mod.default, 'v')),
|
||||
'vb': () => import('shiki/languages/vb.tmLanguage.json').then((mod) => handleLang(mod.default, 'vb')),
|
||||
'verilog': () => import('shiki/languages/verilog.tmLanguage.json').then((mod) => handleLang(mod.default, 'verilog')),
|
||||
'vhdl': () => import('shiki/languages/vhdl.tmLanguage.json').then((mod) => handleLang(mod.default, 'vhdl')),
|
||||
'viml': () => import('shiki/languages/viml.tmLanguage.json').then((mod) => handleLang(mod.default, 'viml')),
|
||||
'vue-html': () => import('shiki/languages/vue-html.tmLanguage.json').then((mod) => handleLang(mod.default, 'vue-html')),
|
||||
'vue': () => import('shiki/languages/vue.tmLanguage.json').then((mod) => handleLang(mod.default, 'vue')),
|
||||
'wasm': () => import('shiki/languages/wasm.tmLanguage.json').then((mod) => handleLang(mod.default, 'wasm')),
|
||||
'wenyan': () => import('shiki/languages/wenyan.tmLanguage.json').then((mod) => handleLang(mod.default, 'wenyan')),
|
||||
'wgsl': () => import('shiki/languages/wgsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'wgsl')),
|
||||
'xml': () => import('shiki/languages/xml.tmLanguage.json').then((mod) => handleLang(mod.default, 'xml')),
|
||||
'xsl': () => import('shiki/languages/xsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'xsl')),
|
||||
'yaml': () => import('shiki/languages/yaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'yaml')),
|
||||
'zenscript': () => import('shiki/languages/zenscript.tmLanguage.json').then((mod) => handleLang(mod.default, 'zenscript')),
|
||||
abap: () =>
|
||||
import('shiki/languages/abap.tmLanguage.json').then((mod) => handleLang(mod.default, 'abap')),
|
||||
'actionscript-3': () =>
|
||||
import('shiki/languages/actionscript-3.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'actionscript-3')
|
||||
),
|
||||
ada: () =>
|
||||
import('shiki/languages/ada.tmLanguage.json').then((mod) => handleLang(mod.default, 'ada')),
|
||||
apache: () =>
|
||||
import('shiki/languages/apache.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'apache')
|
||||
),
|
||||
apex: () =>
|
||||
import('shiki/languages/apex.tmLanguage.json').then((mod) => handleLang(mod.default, 'apex')),
|
||||
apl: () =>
|
||||
import('shiki/languages/apl.tmLanguage.json').then((mod) => handleLang(mod.default, 'apl')),
|
||||
applescript: () =>
|
||||
import('shiki/languages/applescript.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'applescript')
|
||||
),
|
||||
ara: () =>
|
||||
import('shiki/languages/ara.tmLanguage.json').then((mod) => handleLang(mod.default, 'ara')),
|
||||
asm: () =>
|
||||
import('shiki/languages/asm.tmLanguage.json').then((mod) => handleLang(mod.default, 'asm')),
|
||||
astro: () =>
|
||||
import('shiki/languages/astro.tmLanguage.json').then((mod) => handleLang(mod.default, 'astro')),
|
||||
awk: () =>
|
||||
import('shiki/languages/awk.tmLanguage.json').then((mod) => handleLang(mod.default, 'awk')),
|
||||
ballerina: () =>
|
||||
import('shiki/languages/ballerina.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'ballerina')
|
||||
),
|
||||
bat: () =>
|
||||
import('shiki/languages/bat.tmLanguage.json').then((mod) => handleLang(mod.default, 'bat')),
|
||||
berry: () =>
|
||||
import('shiki/languages/berry.tmLanguage.json').then((mod) => handleLang(mod.default, 'berry')),
|
||||
bibtex: () =>
|
||||
import('shiki/languages/bibtex.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'bibtex')
|
||||
),
|
||||
bicep: () =>
|
||||
import('shiki/languages/bicep.tmLanguage.json').then((mod) => handleLang(mod.default, 'bicep')),
|
||||
blade: () =>
|
||||
import('shiki/languages/blade.tmLanguage.json').then((mod) => handleLang(mod.default, 'blade')),
|
||||
c: () => import('shiki/languages/c.tmLanguage.json').then((mod) => handleLang(mod.default, 'c')),
|
||||
cadence: () =>
|
||||
import('shiki/languages/cadence.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'cadence')
|
||||
),
|
||||
clarity: () =>
|
||||
import('shiki/languages/clarity.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'clarity')
|
||||
),
|
||||
clojure: () =>
|
||||
import('shiki/languages/clojure.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'clojure')
|
||||
),
|
||||
cmake: () =>
|
||||
import('shiki/languages/cmake.tmLanguage.json').then((mod) => handleLang(mod.default, 'cmake')),
|
||||
cobol: () =>
|
||||
import('shiki/languages/cobol.tmLanguage.json').then((mod) => handleLang(mod.default, 'cobol')),
|
||||
codeql: () =>
|
||||
import('shiki/languages/codeql.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'codeql')
|
||||
),
|
||||
coffee: () =>
|
||||
import('shiki/languages/coffee.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'coffee')
|
||||
),
|
||||
'cpp-macro': () =>
|
||||
import('shiki/languages/cpp-macro.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'cpp-macro')
|
||||
),
|
||||
cpp: () =>
|
||||
import('shiki/languages/cpp.tmLanguage.json').then((mod) => handleLang(mod.default, 'cpp')),
|
||||
crystal: () =>
|
||||
import('shiki/languages/crystal.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'crystal')
|
||||
),
|
||||
csharp: () =>
|
||||
import('shiki/languages/csharp.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'csharp')
|
||||
),
|
||||
css: () =>
|
||||
import('shiki/languages/css.tmLanguage.json').then((mod) => handleLang(mod.default, 'css')),
|
||||
cue: () =>
|
||||
import('shiki/languages/cue.tmLanguage.json').then((mod) => handleLang(mod.default, 'cue')),
|
||||
d: () => import('shiki/languages/d.tmLanguage.json').then((mod) => handleLang(mod.default, 'd')),
|
||||
dart: () =>
|
||||
import('shiki/languages/dart.tmLanguage.json').then((mod) => handleLang(mod.default, 'dart')),
|
||||
dax: () =>
|
||||
import('shiki/languages/dax.tmLanguage.json').then((mod) => handleLang(mod.default, 'dax')),
|
||||
diff: () =>
|
||||
import('shiki/languages/diff.tmLanguage.json').then((mod) => handleLang(mod.default, 'diff')),
|
||||
docker: () =>
|
||||
import('shiki/languages/docker.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'docker')
|
||||
),
|
||||
'dream-maker': () =>
|
||||
import('shiki/languages/dream-maker.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'dream-maker')
|
||||
),
|
||||
elixir: () =>
|
||||
import('shiki/languages/elixir.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'elixir')
|
||||
),
|
||||
elm: () =>
|
||||
import('shiki/languages/elm.tmLanguage.json').then((mod) => handleLang(mod.default, 'elm')),
|
||||
erb: () =>
|
||||
import('shiki/languages/erb.tmLanguage.json').then((mod) => handleLang(mod.default, 'erb')),
|
||||
erlang: () =>
|
||||
import('shiki/languages/erlang.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'erlang')
|
||||
),
|
||||
fish: () =>
|
||||
import('shiki/languages/fish.tmLanguage.json').then((mod) => handleLang(mod.default, 'fish')),
|
||||
fsharp: () =>
|
||||
import('shiki/languages/fsharp.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'fsharp')
|
||||
),
|
||||
gherkin: () =>
|
||||
import('shiki/languages/gherkin.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'gherkin')
|
||||
),
|
||||
'git-commit': () =>
|
||||
import('shiki/languages/git-commit.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'git-commit')
|
||||
),
|
||||
'git-rebase': () =>
|
||||
import('shiki/languages/git-rebase.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'git-rebase')
|
||||
),
|
||||
glsl: () =>
|
||||
import('shiki/languages/glsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'glsl')),
|
||||
gnuplot: () =>
|
||||
import('shiki/languages/gnuplot.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'gnuplot')
|
||||
),
|
||||
go: () =>
|
||||
import('shiki/languages/go.tmLanguage.json').then((mod) => handleLang(mod.default, 'go')),
|
||||
graphql: () =>
|
||||
import('shiki/languages/graphql.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'graphql')
|
||||
),
|
||||
groovy: () =>
|
||||
import('shiki/languages/groovy.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'groovy')
|
||||
),
|
||||
hack: () =>
|
||||
import('shiki/languages/hack.tmLanguage.json').then((mod) => handleLang(mod.default, 'hack')),
|
||||
haml: () =>
|
||||
import('shiki/languages/haml.tmLanguage.json').then((mod) => handleLang(mod.default, 'haml')),
|
||||
handlebars: () =>
|
||||
import('shiki/languages/handlebars.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'handlebars')
|
||||
),
|
||||
haskell: () =>
|
||||
import('shiki/languages/haskell.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'haskell')
|
||||
),
|
||||
hcl: () =>
|
||||
import('shiki/languages/hcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hcl')),
|
||||
hlsl: () =>
|
||||
import('shiki/languages/hlsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hlsl')),
|
||||
html: () =>
|
||||
import('shiki/languages/html.tmLanguage.json').then((mod) => handleLang(mod.default, 'html')),
|
||||
http: () =>
|
||||
import('shiki/languages/http.tmLanguage.json').then((mod) => handleLang(mod.default, 'http')),
|
||||
imba: () =>
|
||||
import('shiki/languages/imba.tmLanguage.json').then((mod) => handleLang(mod.default, 'imba')),
|
||||
ini: () =>
|
||||
import('shiki/languages/ini.tmLanguage.json').then((mod) => handleLang(mod.default, 'ini')),
|
||||
java: () =>
|
||||
import('shiki/languages/java.tmLanguage.json').then((mod) => handleLang(mod.default, 'java')),
|
||||
javascript: () =>
|
||||
import('shiki/languages/javascript.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'javascript')
|
||||
),
|
||||
'jinja-html': () =>
|
||||
import('shiki/languages/jinja-html.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'jinja-html')
|
||||
),
|
||||
jinja: () =>
|
||||
import('shiki/languages/jinja.tmLanguage.json').then((mod) => handleLang(mod.default, 'jinja')),
|
||||
jison: () =>
|
||||
import('shiki/languages/jison.tmLanguage.json').then((mod) => handleLang(mod.default, 'jison')),
|
||||
json: () =>
|
||||
import('shiki/languages/json.tmLanguage.json').then((mod) => handleLang(mod.default, 'json')),
|
||||
json5: () =>
|
||||
import('shiki/languages/json5.tmLanguage.json').then((mod) => handleLang(mod.default, 'json5')),
|
||||
jsonc: () =>
|
||||
import('shiki/languages/jsonc.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsonc')),
|
||||
jsonnet: () =>
|
||||
import('shiki/languages/jsonnet.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'jsonnet')
|
||||
),
|
||||
jssm: () =>
|
||||
import('shiki/languages/jssm.tmLanguage.json').then((mod) => handleLang(mod.default, 'jssm')),
|
||||
jsx: () =>
|
||||
import('shiki/languages/jsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsx')),
|
||||
julia: () =>
|
||||
import('shiki/languages/julia.tmLanguage.json').then((mod) => handleLang(mod.default, 'julia')),
|
||||
kotlin: () =>
|
||||
import('shiki/languages/kotlin.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'kotlin')
|
||||
),
|
||||
latex: () =>
|
||||
import('shiki/languages/latex.tmLanguage.json').then((mod) => handleLang(mod.default, 'latex')),
|
||||
less: () =>
|
||||
import('shiki/languages/less.tmLanguage.json').then((mod) => handleLang(mod.default, 'less')),
|
||||
liquid: () =>
|
||||
import('shiki/languages/liquid.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'liquid')
|
||||
),
|
||||
lisp: () =>
|
||||
import('shiki/languages/lisp.tmLanguage.json').then((mod) => handleLang(mod.default, 'lisp')),
|
||||
logo: () =>
|
||||
import('shiki/languages/logo.tmLanguage.json').then((mod) => handleLang(mod.default, 'logo')),
|
||||
lua: () =>
|
||||
import('shiki/languages/lua.tmLanguage.json').then((mod) => handleLang(mod.default, 'lua')),
|
||||
make: () =>
|
||||
import('shiki/languages/make.tmLanguage.json').then((mod) => handleLang(mod.default, 'make')),
|
||||
markdown: () =>
|
||||
import('shiki/languages/markdown.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'markdown')
|
||||
),
|
||||
marko: () =>
|
||||
import('shiki/languages/marko.tmLanguage.json').then((mod) => handleLang(mod.default, 'marko')),
|
||||
matlab: () =>
|
||||
import('shiki/languages/matlab.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'matlab')
|
||||
),
|
||||
mdx: () =>
|
||||
import('shiki/languages/mdx.tmLanguage.json').then((mod) => handleLang(mod.default, 'mdx')),
|
||||
mermaid: () =>
|
||||
import('shiki/languages/mermaid.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'mermaid')
|
||||
),
|
||||
nginx: () =>
|
||||
import('shiki/languages/nginx.tmLanguage.json').then((mod) => handleLang(mod.default, 'nginx')),
|
||||
nim: () =>
|
||||
import('shiki/languages/nim.tmLanguage.json').then((mod) => handleLang(mod.default, 'nim')),
|
||||
nix: () =>
|
||||
import('shiki/languages/nix.tmLanguage.json').then((mod) => handleLang(mod.default, 'nix')),
|
||||
'objective-c': () =>
|
||||
import('shiki/languages/objective-c.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'objective-c')
|
||||
),
|
||||
'objective-cpp': () =>
|
||||
import('shiki/languages/objective-cpp.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'objective-cpp')
|
||||
),
|
||||
ocaml: () =>
|
||||
import('shiki/languages/ocaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'ocaml')),
|
||||
pascal: () =>
|
||||
import('shiki/languages/pascal.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'pascal')
|
||||
),
|
||||
perl: () =>
|
||||
import('shiki/languages/perl.tmLanguage.json').then((mod) => handleLang(mod.default, 'perl')),
|
||||
'php-html': () =>
|
||||
import('shiki/languages/php-html.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'php-html')
|
||||
),
|
||||
php: () =>
|
||||
import('shiki/languages/php.tmLanguage.json').then((mod) => handleLang(mod.default, 'php')),
|
||||
plsql: () =>
|
||||
import('shiki/languages/plsql.tmLanguage.json').then((mod) => handleLang(mod.default, 'plsql')),
|
||||
postcss: () =>
|
||||
import('shiki/languages/postcss.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'postcss')
|
||||
),
|
||||
powerquery: () =>
|
||||
import('shiki/languages/powerquery.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'powerquery')
|
||||
),
|
||||
powershell: () =>
|
||||
import('shiki/languages/powershell.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'powershell')
|
||||
),
|
||||
prisma: () =>
|
||||
import('shiki/languages/prisma.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'prisma')
|
||||
),
|
||||
prolog: () =>
|
||||
import('shiki/languages/prolog.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'prolog')
|
||||
),
|
||||
proto: () =>
|
||||
import('shiki/languages/proto.tmLanguage.json').then((mod) => handleLang(mod.default, 'proto')),
|
||||
pug: () =>
|
||||
import('shiki/languages/pug.tmLanguage.json').then((mod) => handleLang(mod.default, 'pug')),
|
||||
puppet: () =>
|
||||
import('shiki/languages/puppet.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'puppet')
|
||||
),
|
||||
purescript: () =>
|
||||
import('shiki/languages/purescript.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'purescript')
|
||||
),
|
||||
python: () =>
|
||||
import('shiki/languages/python.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'python')
|
||||
),
|
||||
r: () => import('shiki/languages/r.tmLanguage.json').then((mod) => handleLang(mod.default, 'r')),
|
||||
raku: () =>
|
||||
import('shiki/languages/raku.tmLanguage.json').then((mod) => handleLang(mod.default, 'raku')),
|
||||
razor: () =>
|
||||
import('shiki/languages/razor.tmLanguage.json').then((mod) => handleLang(mod.default, 'razor')),
|
||||
rel: () =>
|
||||
import('shiki/languages/rel.tmLanguage.json').then((mod) => handleLang(mod.default, 'rel')),
|
||||
riscv: () =>
|
||||
import('shiki/languages/riscv.tmLanguage.json').then((mod) => handleLang(mod.default, 'riscv')),
|
||||
rst: () =>
|
||||
import('shiki/languages/rst.tmLanguage.json').then((mod) => handleLang(mod.default, 'rst')),
|
||||
ruby: () =>
|
||||
import('shiki/languages/ruby.tmLanguage.json').then((mod) => handleLang(mod.default, 'ruby')),
|
||||
rust: () =>
|
||||
import('shiki/languages/rust.tmLanguage.json').then((mod) => handleLang(mod.default, 'rust')),
|
||||
sas: () =>
|
||||
import('shiki/languages/sas.tmLanguage.json').then((mod) => handleLang(mod.default, 'sas')),
|
||||
sass: () =>
|
||||
import('shiki/languages/sass.tmLanguage.json').then((mod) => handleLang(mod.default, 'sass')),
|
||||
scala: () =>
|
||||
import('shiki/languages/scala.tmLanguage.json').then((mod) => handleLang(mod.default, 'scala')),
|
||||
scheme: () =>
|
||||
import('shiki/languages/scheme.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'scheme')
|
||||
),
|
||||
scss: () =>
|
||||
import('shiki/languages/scss.tmLanguage.json').then((mod) => handleLang(mod.default, 'scss')),
|
||||
shaderlab: () =>
|
||||
import('shiki/languages/shaderlab.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'shaderlab')
|
||||
),
|
||||
shellscript: () =>
|
||||
import('shiki/languages/shellscript.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'shellscript')
|
||||
),
|
||||
smalltalk: () =>
|
||||
import('shiki/languages/smalltalk.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'smalltalk')
|
||||
),
|
||||
solidity: () =>
|
||||
import('shiki/languages/solidity.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'solidity')
|
||||
),
|
||||
sparql: () =>
|
||||
import('shiki/languages/sparql.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'sparql')
|
||||
),
|
||||
sql: () =>
|
||||
import('shiki/languages/sql.tmLanguage.json').then((mod) => handleLang(mod.default, 'sql')),
|
||||
'ssh-config': () =>
|
||||
import('shiki/languages/ssh-config.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'ssh-config')
|
||||
),
|
||||
stata: () =>
|
||||
import('shiki/languages/stata.tmLanguage.json').then((mod) => handleLang(mod.default, 'stata')),
|
||||
stylus: () =>
|
||||
import('shiki/languages/stylus.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'stylus')
|
||||
),
|
||||
svelte: () =>
|
||||
import('shiki/languages/svelte.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'svelte')
|
||||
),
|
||||
swift: () =>
|
||||
import('shiki/languages/swift.tmLanguage.json').then((mod) => handleLang(mod.default, 'swift')),
|
||||
'system-verilog': () =>
|
||||
import('shiki/languages/system-verilog.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'system-verilog')
|
||||
),
|
||||
tasl: () =>
|
||||
import('shiki/languages/tasl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tasl')),
|
||||
tcl: () =>
|
||||
import('shiki/languages/tcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tcl')),
|
||||
tex: () =>
|
||||
import('shiki/languages/tex.tmLanguage.json').then((mod) => handleLang(mod.default, 'tex')),
|
||||
toml: () =>
|
||||
import('shiki/languages/toml.tmLanguage.json').then((mod) => handleLang(mod.default, 'toml')),
|
||||
tsx: () =>
|
||||
import('shiki/languages/tsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'tsx')),
|
||||
turtle: () =>
|
||||
import('shiki/languages/turtle.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'turtle')
|
||||
),
|
||||
twig: () =>
|
||||
import('shiki/languages/twig.tmLanguage.json').then((mod) => handleLang(mod.default, 'twig')),
|
||||
typescript: () =>
|
||||
import('shiki/languages/typescript.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'typescript')
|
||||
),
|
||||
v: () => import('shiki/languages/v.tmLanguage.json').then((mod) => handleLang(mod.default, 'v')),
|
||||
vb: () =>
|
||||
import('shiki/languages/vb.tmLanguage.json').then((mod) => handleLang(mod.default, 'vb')),
|
||||
verilog: () =>
|
||||
import('shiki/languages/verilog.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'verilog')
|
||||
),
|
||||
vhdl: () =>
|
||||
import('shiki/languages/vhdl.tmLanguage.json').then((mod) => handleLang(mod.default, 'vhdl')),
|
||||
viml: () =>
|
||||
import('shiki/languages/viml.tmLanguage.json').then((mod) => handleLang(mod.default, 'viml')),
|
||||
'vue-html': () =>
|
||||
import('shiki/languages/vue-html.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'vue-html')
|
||||
),
|
||||
vue: () =>
|
||||
import('shiki/languages/vue.tmLanguage.json').then((mod) => handleLang(mod.default, 'vue')),
|
||||
wasm: () =>
|
||||
import('shiki/languages/wasm.tmLanguage.json').then((mod) => handleLang(mod.default, 'wasm')),
|
||||
wenyan: () =>
|
||||
import('shiki/languages/wenyan.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'wenyan')
|
||||
),
|
||||
wgsl: () =>
|
||||
import('shiki/languages/wgsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'wgsl')),
|
||||
xml: () =>
|
||||
import('shiki/languages/xml.tmLanguage.json').then((mod) => handleLang(mod.default, 'xml')),
|
||||
xsl: () =>
|
||||
import('shiki/languages/xsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'xsl')),
|
||||
yaml: () =>
|
||||
import('shiki/languages/yaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'yaml')),
|
||||
zenscript: () =>
|
||||
import('shiki/languages/zenscript.tmLanguage.json').then((mod) =>
|
||||
handleLang(mod.default, 'zenscript')
|
||||
),
|
||||
};
|
||||
|
|
|
@ -5,33 +5,38 @@
|
|||
|
||||
// prettier-ignore
|
||||
export const themes = {
|
||||
'css-variables': () => import('shiki/themes/css-variables.json').then(mod => mod.default),
|
||||
'dark-plus': () => import('shiki/themes/dark-plus.json').then(mod => mod.default),
|
||||
'dracula-soft': () => import('shiki/themes/dracula-soft.json').then(mod => mod.default),
|
||||
'dracula': () => import('shiki/themes/dracula.json').then(mod => mod.default),
|
||||
'github-dark-dimmed': () => import('shiki/themes/github-dark-dimmed.json').then(mod => mod.default),
|
||||
'github-dark': () => import('shiki/themes/github-dark.json').then(mod => mod.default),
|
||||
'github-light': () => import('shiki/themes/github-light.json').then(mod => mod.default),
|
||||
'hc_light': () => import('shiki/themes/hc_light.json').then(mod => mod.default),
|
||||
'light-plus': () => import('shiki/themes/light-plus.json').then(mod => mod.default),
|
||||
'material-theme-darker': () => import('shiki/themes/material-theme-darker.json').then(mod => mod.default),
|
||||
'material-theme-lighter': () => import('shiki/themes/material-theme-lighter.json').then(mod => mod.default),
|
||||
'material-theme-ocean': () => import('shiki/themes/material-theme-ocean.json').then(mod => mod.default),
|
||||
'material-theme-palenight': () => import('shiki/themes/material-theme-palenight.json').then(mod => mod.default),
|
||||
'material-theme': () => import('shiki/themes/material-theme.json').then(mod => mod.default),
|
||||
'min-dark': () => import('shiki/themes/min-dark.json').then(mod => mod.default),
|
||||
'min-light': () => import('shiki/themes/min-light.json').then(mod => mod.default),
|
||||
'monokai': () => import('shiki/themes/monokai.json').then(mod => mod.default),
|
||||
'nord': () => import('shiki/themes/nord.json').then(mod => mod.default),
|
||||
'one-dark-pro': () => import('shiki/themes/one-dark-pro.json').then(mod => mod.default),
|
||||
'poimandres': () => import('shiki/themes/poimandres.json').then(mod => mod.default),
|
||||
'rose-pine-dawn': () => import('shiki/themes/rose-pine-dawn.json').then(mod => mod.default),
|
||||
'rose-pine-moon': () => import('shiki/themes/rose-pine-moon.json').then(mod => mod.default),
|
||||
'rose-pine': () => import('shiki/themes/rose-pine.json').then(mod => mod.default),
|
||||
'slack-dark': () => import('shiki/themes/slack-dark.json').then(mod => mod.default),
|
||||
'slack-ochin': () => import('shiki/themes/slack-ochin.json').then(mod => mod.default),
|
||||
'solarized-dark': () => import('shiki/themes/solarized-dark.json').then(mod => mod.default),
|
||||
'solarized-light': () => import('shiki/themes/solarized-light.json').then(mod => mod.default),
|
||||
'vitesse-dark': () => import('shiki/themes/vitesse-dark.json').then(mod => mod.default),
|
||||
'vitesse-light': () => import('shiki/themes/vitesse-light.json').then(mod => mod.default),
|
||||
'css-variables': () => import('shiki/themes/css-variables.json').then((mod) => mod.default),
|
||||
'dark-plus': () => import('shiki/themes/dark-plus.json').then((mod) => mod.default),
|
||||
'dracula-soft': () => import('shiki/themes/dracula-soft.json').then((mod) => mod.default),
|
||||
dracula: () => import('shiki/themes/dracula.json').then((mod) => mod.default),
|
||||
'github-dark-dimmed': () =>
|
||||
import('shiki/themes/github-dark-dimmed.json').then((mod) => mod.default),
|
||||
'github-dark': () => import('shiki/themes/github-dark.json').then((mod) => mod.default),
|
||||
'github-light': () => import('shiki/themes/github-light.json').then((mod) => mod.default),
|
||||
hc_light: () => import('shiki/themes/hc_light.json').then((mod) => mod.default),
|
||||
'light-plus': () => import('shiki/themes/light-plus.json').then((mod) => mod.default),
|
||||
'material-theme-darker': () =>
|
||||
import('shiki/themes/material-theme-darker.json').then((mod) => mod.default),
|
||||
'material-theme-lighter': () =>
|
||||
import('shiki/themes/material-theme-lighter.json').then((mod) => mod.default),
|
||||
'material-theme-ocean': () =>
|
||||
import('shiki/themes/material-theme-ocean.json').then((mod) => mod.default),
|
||||
'material-theme-palenight': () =>
|
||||
import('shiki/themes/material-theme-palenight.json').then((mod) => mod.default),
|
||||
'material-theme': () => import('shiki/themes/material-theme.json').then((mod) => mod.default),
|
||||
'min-dark': () => import('shiki/themes/min-dark.json').then((mod) => mod.default),
|
||||
'min-light': () => import('shiki/themes/min-light.json').then((mod) => mod.default),
|
||||
monokai: () => import('shiki/themes/monokai.json').then((mod) => mod.default),
|
||||
nord: () => import('shiki/themes/nord.json').then((mod) => mod.default),
|
||||
'one-dark-pro': () => import('shiki/themes/one-dark-pro.json').then((mod) => mod.default),
|
||||
poimandres: () => import('shiki/themes/poimandres.json').then((mod) => mod.default),
|
||||
'rose-pine-dawn': () => import('shiki/themes/rose-pine-dawn.json').then((mod) => mod.default),
|
||||
'rose-pine-moon': () => import('shiki/themes/rose-pine-moon.json').then((mod) => mod.default),
|
||||
'rose-pine': () => import('shiki/themes/rose-pine.json').then((mod) => mod.default),
|
||||
'slack-dark': () => import('shiki/themes/slack-dark.json').then((mod) => mod.default),
|
||||
'slack-ochin': () => import('shiki/themes/slack-ochin.json').then((mod) => mod.default),
|
||||
'solarized-dark': () => import('shiki/themes/solarized-dark.json').then((mod) => mod.default),
|
||||
'solarized-light': () => import('shiki/themes/solarized-light.json').then((mod) => mod.default),
|
||||
'vitesse-dark': () => import('shiki/themes/vitesse-dark.json').then((mod) => mod.default),
|
||||
'vitesse-light': () => import('shiki/themes/vitesse-light.json').then((mod) => mod.default),
|
||||
};
|
||||
|
|
12
packages/astro/content-types.template.d.ts
vendored
12
packages/astro/content-types.template.d.ts
vendored
|
@ -32,7 +32,7 @@ declare module 'astro:content' {
|
|||
import('astro/zod').ZodLiteral<'tiff'>,
|
||||
import('astro/zod').ZodLiteral<'webp'>,
|
||||
import('astro/zod').ZodLiteral<'gif'>,
|
||||
import('astro/zod').ZodLiteral<'svg'>,
|
||||
import('astro/zod').ZodLiteral<'svg'>
|
||||
]
|
||||
>;
|
||||
}>;
|
||||
|
@ -72,7 +72,7 @@ declare module 'astro:content' {
|
|||
|
||||
export function getEntryBySlug<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
E extends ValidContentEntrySlug<C> | (string & {})
|
||||
>(
|
||||
collection: C,
|
||||
// Note that this has to accept a regular string too, for SSR
|
||||
|
@ -97,7 +97,7 @@ declare module 'astro:content' {
|
|||
|
||||
export function getEntry<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
E extends ValidContentEntrySlug<C> | (string & {})
|
||||
>(entry: {
|
||||
collection: C;
|
||||
slug: E;
|
||||
|
@ -106,7 +106,7 @@ declare module 'astro:content' {
|
|||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof DataEntryMap,
|
||||
E extends keyof DataEntryMap[C] | (string & {}),
|
||||
E extends keyof DataEntryMap[C] | (string & {})
|
||||
>(entry: {
|
||||
collection: C;
|
||||
id: E;
|
||||
|
@ -115,7 +115,7 @@ declare module 'astro:content' {
|
|||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
E extends ValidContentEntrySlug<C> | (string & {})
|
||||
>(
|
||||
collection: C,
|
||||
slug: E
|
||||
|
@ -124,7 +124,7 @@ declare module 'astro:content' {
|
|||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof DataEntryMap,
|
||||
E extends keyof DataEntryMap[C] | (string & {}),
|
||||
E extends keyof DataEntryMap[C] | (string & {})
|
||||
>(
|
||||
collection: C,
|
||||
id: E
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { expect } from '@playwright/test';
|
||||
import { testFactory, waitForHydrate } from './test-utils.js';
|
||||
import testAdapter from '../test/test-adapter.js';
|
||||
import { testFactory, waitForHydrate } from './test-utils.js';
|
||||
|
||||
const test = testFactory({
|
||||
root: './fixtures/custom-client-directives/',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { expect } from '@playwright/test';
|
||||
import { testFactory, getErrorOverlayContent } from './test-utils.js';
|
||||
import { getErrorOverlayContent, testFactory } from './test-utils.js';
|
||||
|
||||
const test = testFactory({
|
||||
root: './fixtures/error-cyclic/',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { expect } from '@playwright/test';
|
||||
import { testFactory, getErrorOverlayContent } from './test-utils.js';
|
||||
import { getErrorOverlayContent, testFactory } from './test-utils.js';
|
||||
|
||||
const test = testFactory({
|
||||
root: './fixtures/error-sass/',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { test as base, expect } from '@playwright/test';
|
||||
import { expect, test as base } from '@playwright/test';
|
||||
import { loadFixture, waitForHydrate } from './test-utils.js';
|
||||
|
||||
const test = base.extend({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { expect, test as testBase } from '@playwright/test';
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { expect, test as testBase } from '@playwright/test';
|
||||
import { loadFixture as baseLoadFixture } from '../test/test-utils.js';
|
||||
|
||||
export const isWindows = process.platform === 'win32';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { prepareTestFactory } from './shared-component-tests.js';
|
||||
import { expect } from '@playwright/test';
|
||||
import { prepareTestFactory } from './shared-component-tests.js';
|
||||
const { test, createTests } = prepareTestFactory({ root: './fixtures/vue-component/' });
|
||||
|
||||
const config = {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* eslint-disable no-console */
|
||||
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { bold, cyan, dim } from 'kleur/colors';
|
||||
import yargs from 'yargs-parser';
|
||||
import { loadFixture } from '../test/test-utils.js';
|
||||
import { generatePosts } from './scripts/generate-posts.mjs';
|
||||
import yargs from 'yargs-parser';
|
||||
import { cyan, bold, dim } from 'kleur/colors';
|
||||
|
||||
// Skip nonessential remark / rehype plugins for a fair comparison.
|
||||
// This includes heading ID generation, syntax highlighting, GFM, and Smartypants.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import type { OutgoingHttpHeaders } from 'node:http';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
import type {
|
||||
MarkdownHeading,
|
||||
MarkdownMetadata,
|
||||
|
@ -8,8 +10,6 @@ import type {
|
|||
ShikiConfig,
|
||||
} from '@astrojs/markdown-remark';
|
||||
import type * as babel from '@babel/core';
|
||||
import type { OutgoingHttpHeaders } from 'node:http';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
import type * as rollup from 'rollup';
|
||||
import type { TsConfigJson } from 'tsconfig-resolver';
|
||||
import type * as vite from 'vite';
|
||||
|
@ -148,7 +148,7 @@ export interface CLIFlags {
|
|||
export interface AstroGlobal<
|
||||
Props extends Record<string, any> = Record<string, any>,
|
||||
Self = AstroComponentFactory,
|
||||
Params extends Record<string, string | undefined> = Record<string, string | undefined>,
|
||||
Params extends Record<string, string | undefined> = Record<string, string | undefined>
|
||||
> extends AstroGlobalPartial,
|
||||
AstroSharedContext<Props, Params> {
|
||||
/**
|
||||
|
@ -281,7 +281,7 @@ export interface AstroGlobal<
|
|||
}
|
||||
|
||||
/** Union type of supported markdown file extensions */
|
||||
type MarkdowFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number];
|
||||
type MarkdowFileExtension = typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS[number];
|
||||
|
||||
export interface AstroGlobalPartial {
|
||||
/**
|
||||
|
@ -1751,7 +1751,7 @@ export interface Page<T = any> {
|
|||
export type PaginateFunction = <
|
||||
PaginateData,
|
||||
AdditionalPaginateProps extends Props,
|
||||
AdditionalPaginateParams extends Params,
|
||||
AdditionalPaginateParams extends Params
|
||||
>(
|
||||
data: PaginateData[],
|
||||
args?: PaginateOptions<AdditionalPaginateProps, AdditionalPaginateParams>
|
||||
|
@ -1825,7 +1825,7 @@ export type ValidRedirectStatus = 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|||
// Shared types between `Astro` global and API context object
|
||||
interface AstroSharedContext<
|
||||
Props extends Record<string, any> = Record<string, any>,
|
||||
RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>,
|
||||
RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>
|
||||
> {
|
||||
/**
|
||||
* The address (usually IP address) of the user. Used with SSR only.
|
||||
|
@ -1864,7 +1864,7 @@ interface AstroSharedContext<
|
|||
|
||||
export interface APIContext<
|
||||
Props extends Record<string, any> = Record<string, any>,
|
||||
APIParams extends Record<string, string | undefined> = Record<string, string | undefined>,
|
||||
APIParams extends Record<string, string | undefined> = Record<string, string | undefined>
|
||||
> extends AstroSharedContext<Props, Params> {
|
||||
site: URL | undefined;
|
||||
generator: string;
|
||||
|
@ -2009,7 +2009,7 @@ export interface SSRLoadedRenderer extends AstroRenderer {
|
|||
|
||||
export type HookParameters<
|
||||
Hook extends keyof AstroIntegration['hooks'],
|
||||
Fn = AstroIntegration['hooks'][Hook],
|
||||
Fn = AstroIntegration['hooks'][Hook]
|
||||
> = Fn extends (...args: any) => any ? Parameters<Fn>[0] : never;
|
||||
|
||||
export interface AstroIntegration {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { isServerLikeOutput } from '../../prerender/utils.js';
|
|||
import { getConfiguredImageService, isESMImportedImage } from '../internal.js';
|
||||
import type { LocalImageService } from '../services/service.js';
|
||||
import type { ImageMetadata, ImageTransform } from '../types.js';
|
||||
import { loadRemoteImage, type RemoteCacheEntry } from './remote.js';
|
||||
import { type RemoteCacheEntry, loadRemoteImage } from './remote.js';
|
||||
|
||||
interface GenerationDataUncached {
|
||||
cached: false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { isRemotePath } from '@astrojs/internal-helpers/path';
|
||||
import type { AstroConfig, AstroSettings } from '../@types/astro.js';
|
||||
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
||||
import { isLocalService, type ImageService } from './services/service.js';
|
||||
import { type ImageService, isLocalService } from './services/service.js';
|
||||
import type {
|
||||
GetImageResult,
|
||||
ImageMetadata,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { baseService, type LocalImageService } from './service.js';
|
||||
import { type LocalImageService, baseService } from './service.js';
|
||||
|
||||
// Empty service used for platforms that neither support Squoosh or Sharp.
|
||||
const noopService: LocalImageService = {
|
||||
|
|
|
@ -2,10 +2,10 @@ import type { FormatEnum } from 'sharp';
|
|||
import { AstroError, AstroErrorData } from '../../core/errors/index.js';
|
||||
import type { ImageOutputFormat, ImageQualityPreset } from '../types.js';
|
||||
import {
|
||||
baseService,
|
||||
parseQuality,
|
||||
type BaseServiceTransform,
|
||||
type LocalImageService,
|
||||
baseService,
|
||||
parseQuality,
|
||||
} from './service.js';
|
||||
|
||||
let sharp: typeof import('sharp');
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
import type { ImageOutputFormat, ImageQualityPreset } from '../types.js';
|
||||
import { imageMetadata } from '../utils/metadata.js';
|
||||
import {
|
||||
baseService,
|
||||
parseQuality,
|
||||
type BaseServiceTransform,
|
||||
type LocalImageService,
|
||||
baseService,
|
||||
parseQuality,
|
||||
} from './service.js';
|
||||
import { processBuffer } from './vendor/squoosh/image-pool.js';
|
||||
import type { Operation } from './vendor/squoosh/image.js';
|
||||
|
|
|
@ -5,8 +5,8 @@ import type { ImageService } from './services/service.js';
|
|||
|
||||
export type ImageQualityPreset = 'low' | 'mid' | 'high' | 'max' | (string & {});
|
||||
export type ImageQuality = ImageQualityPreset | number;
|
||||
export type ImageInputFormat = (typeof VALID_INPUT_FORMATS)[number];
|
||||
export type ImageOutputFormat = (typeof VALID_OUTPUT_FORMATS)[number] | (string & {});
|
||||
export type ImageInputFormat = typeof VALID_INPUT_FORMATS[number];
|
||||
export type ImageOutputFormat = typeof VALID_OUTPUT_FORMATS[number] | (string & {});
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import fsMod, { existsSync, promises as fs } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import boxen from 'boxen';
|
||||
import { diffWords } from 'diff';
|
||||
import { execa } from 'execa';
|
||||
import { bold, cyan, dim, green, magenta, red, yellow } from 'kleur/colors';
|
||||
import fsMod, { existsSync, promises as fs } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import ora from 'ora';
|
||||
import preferredPM from 'preferred-pm';
|
||||
import prompts from 'prompts';
|
||||
|
@ -12,9 +12,9 @@ import type yargs from 'yargs-parser';
|
|||
import { loadTSConfig, resolveConfigPath, resolveRoot } from '../../core/config/index.js';
|
||||
import {
|
||||
defaultTSConfig,
|
||||
type frameworkWithTSSettings,
|
||||
presets,
|
||||
updateTSConfigForFramework,
|
||||
type frameworkWithTSSettings,
|
||||
} from '../../core/config/tsconfig.js';
|
||||
import type { Logger } from '../../core/logger/core.js';
|
||||
import * as msg from '../../core/messages.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Arguments as Flags } from 'yargs-parser';
|
||||
import type { AstroInlineConfig } from '../@types/astro.js';
|
||||
import { Logger, type LogOptions } from '../core/logger/core.js';
|
||||
import { type LogOptions, Logger } from '../core/logger/core.js';
|
||||
import { nodeLogDestination } from '../core/logger/node.js';
|
||||
|
||||
export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable no-console */
|
||||
import * as colors from 'kleur/colors';
|
||||
import { execSync } from 'node:child_process';
|
||||
import { arch, platform } from 'node:os';
|
||||
/* eslint-disable no-console */
|
||||
import * as colors from 'kleur/colors';
|
||||
import prompts from 'prompts';
|
||||
import type yargs from 'yargs-parser';
|
||||
import { resolveConfig } from '../../core/config/index.js';
|
||||
|
|
|
@ -3,6 +3,7 @@ import { ZodIssueCode, string as zodString } from 'zod';
|
|||
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
||||
import { prependForwardSlash } from '../core/path.js';
|
||||
import {
|
||||
type AstroComponentFactory,
|
||||
createComponent,
|
||||
createHeadAndContent,
|
||||
renderComponent,
|
||||
|
@ -10,7 +11,6 @@ import {
|
|||
renderTemplate,
|
||||
renderUniqueStylesheet,
|
||||
unescapeHTML,
|
||||
type AstroComponentFactory,
|
||||
} from '../runtime/server/index.js';
|
||||
import type { ContentLookupMap } from './utils.js';
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { bold, cyan } from 'kleur/colors';
|
||||
import type fsMod from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { bold, cyan } from 'kleur/colors';
|
||||
import type { ViteDevServer } from 'vite';
|
||||
import type { AstroSettings } from '../@types/astro.js';
|
||||
import { loadTSConfig } from '../core/config/tsconfig.js';
|
||||
import type { Logger } from '../core/logger/core.js';
|
||||
import { appendForwardSlash } from '../core/path.js';
|
||||
import { createContentTypesGenerator } from './types-generator.js';
|
||||
import { getContentPaths, globalContentConfigObserver, type ContentPaths } from './utils.js';
|
||||
import { type ContentPaths, getContentPaths, globalContentConfigObserver } from './utils.js';
|
||||
|
||||
interface ContentServerListenerParams {
|
||||
fs: typeof fsMod;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import glob from 'fast-glob';
|
||||
import { cyan } from 'kleur/colors';
|
||||
import type fsMod from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { normalizePath, type ViteDevServer } from 'vite';
|
||||
import glob from 'fast-glob';
|
||||
import { cyan } from 'kleur/colors';
|
||||
import { type ViteDevServer, normalizePath } from 'vite';
|
||||
import type { AstroSettings, ContentEntryType } from '../@types/astro.js';
|
||||
import { AstroError } from '../core/errors/errors.js';
|
||||
import { AstroErrorData } from '../core/errors/index.js';
|
||||
|
@ -11,6 +11,9 @@ import type { Logger } from '../core/logger/core.js';
|
|||
import { isRelativePath } from '../core/path.js';
|
||||
import { CONTENT_TYPES_FILE, VIRTUAL_MODULE_ID } from './consts.js';
|
||||
import {
|
||||
type ContentConfig,
|
||||
type ContentObservable,
|
||||
type ContentPaths,
|
||||
getContentEntryIdAndSlug,
|
||||
getContentPaths,
|
||||
getDataEntryExts,
|
||||
|
@ -20,9 +23,6 @@ import {
|
|||
getEntrySlug,
|
||||
getEntryType,
|
||||
reloadContentConfigObserver,
|
||||
type ContentConfig,
|
||||
type ContentObservable,
|
||||
type ContentPaths,
|
||||
} from './utils.js';
|
||||
|
||||
type ChokidarEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { slug as githubSlug } from 'github-slugger';
|
||||
import matter from 'gray-matter';
|
||||
import fsMod from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { slug as githubSlug } from 'github-slugger';
|
||||
import matter from 'gray-matter';
|
||||
import type { PluginContext } from 'rollup';
|
||||
import { normalizePath, type ViteDevServer } from 'vite';
|
||||
import { type ViteDevServer, normalizePath } from 'vite';
|
||||
import { z } from 'zod';
|
||||
import type {
|
||||
AstroConfig,
|
||||
|
@ -326,7 +326,7 @@ export function parseFrontmatter(fileContents: string) {
|
|||
*/
|
||||
export const globalContentConfigObserver = contentObservable({ status: 'init' });
|
||||
|
||||
export function hasContentFlag(viteId: string, flag: (typeof CONTENT_FLAGS)[number]): boolean {
|
||||
export function hasContentFlag(viteId: string, flag: typeof CONTENT_FLAGS[number]): boolean {
|
||||
const flags = new URLSearchParams(viteId.split('?')[1] ?? '');
|
||||
return flags.has(flag);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { pathToFileURL } from 'node:url';
|
|||
import type { Plugin } from 'vite';
|
||||
import type { AstroSettings } from '../@types/astro.js';
|
||||
import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js';
|
||||
import { getPageDataByViteID, type BuildInternals } from '../core/build/internal.js';
|
||||
import { type BuildInternals, getPageDataByViteID } from '../core/build/internal.js';
|
||||
import type { AstroBuildPlugin } from '../core/build/plugin.js';
|
||||
import type { StaticBuildOptions } from '../core/build/types.js';
|
||||
import type { ModuleLoader } from '../core/module-loader/loader.js';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as devalue from 'devalue';
|
||||
import type fsMod from 'node:fs';
|
||||
import { extname } from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import * as devalue from 'devalue';
|
||||
import type { PluginContext } from 'rollup';
|
||||
import type { Plugin } from 'vite';
|
||||
import type {
|
||||
|
@ -17,6 +17,7 @@ import { AstroErrorData } from '../core/errors/index.js';
|
|||
import { escapeViteEnvReferences } from '../vite-plugin-utils/index.js';
|
||||
import { CONTENT_FLAG, DATA_FLAG } from './consts.js';
|
||||
import {
|
||||
type ContentConfig,
|
||||
getContentEntryExts,
|
||||
getContentEntryIdAndSlug,
|
||||
getContentPaths,
|
||||
|
@ -30,7 +31,6 @@ import {
|
|||
hasContentFlag,
|
||||
parseEntrySlug,
|
||||
reloadContentConfigObserver,
|
||||
type ContentConfig,
|
||||
} from './utils.js';
|
||||
|
||||
function getContentRendererByViteId(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import glob from 'fast-glob';
|
||||
import fsMod from 'node:fs';
|
||||
import { extname } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import glob from 'fast-glob';
|
||||
import pLimit from 'p-limit';
|
||||
import type { Plugin } from 'vite';
|
||||
import type { AstroSettings, ContentEntryType } from '../@types/astro.js';
|
||||
|
@ -10,6 +10,8 @@ import { appendForwardSlash } from '../core/path.js';
|
|||
import { rootRelativePath } from '../core/util.js';
|
||||
import { VIRTUAL_MODULE_ID } from './consts.js';
|
||||
import {
|
||||
type ContentLookupMap,
|
||||
type ContentPaths,
|
||||
getContentEntryIdAndSlug,
|
||||
getContentPaths,
|
||||
getDataEntryExts,
|
||||
|
@ -19,8 +21,6 @@ import {
|
|||
getEntrySlug,
|
||||
getEntryType,
|
||||
getExtGlob,
|
||||
type ContentLookupMap,
|
||||
type ContentPaths,
|
||||
} from './utils.js';
|
||||
|
||||
interface AstroContentVirtualModPluginParams {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { deserializeRouteData } from '../routing/manifest/serialization.js';
|
||||
import type { RouteInfo, SerializedSSRManifest, SSRManifest } from './types.js';
|
||||
import type { RouteInfo, SSRManifest, SerializedSSRManifest } from './types.js';
|
||||
|
||||
export function deserializeManifest(serializedManifest: SerializedSSRManifest): SSRManifest {
|
||||
const routes: RouteInfo[] = [];
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
removeTrailingForwardSlash,
|
||||
} from '../path.js';
|
||||
import { RedirectSinglePageBuiltModule } from '../redirects/index.js';
|
||||
import { createEnvironment, createRenderContext, type RenderContext } from '../render/index.js';
|
||||
import { type RenderContext, createEnvironment, createRenderContext } from '../render/index.js';
|
||||
import { RouteCache } from '../render/route-cache.js';
|
||||
import {
|
||||
createAssetLink,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { RouteData } from '../../@types/astro.js';
|
||||
import type { SerializedSSRManifest, SSRManifest } from './types.js';
|
||||
import type { SSRManifest, SerializedSSRManifest } from './types.js';
|
||||
|
||||
import * as fs from 'node:fs';
|
||||
import { IncomingMessage } from 'node:http';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import type {
|
||||
RouteData,
|
||||
SerializedRouteData,
|
||||
SSRComponentMetadata,
|
||||
SSRLoadedRenderer,
|
||||
SSRResult,
|
||||
SerializedRouteData,
|
||||
} from '../../@types/astro.js';
|
||||
import type { SinglePageBuiltModule } from '../build/types.js';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as colors from 'kleur/colors';
|
||||
import { bgGreen, black, cyan, dim, green, magenta } from 'kleur/colors';
|
||||
import fs from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as colors from 'kleur/colors';
|
||||
import { bgGreen, black, cyan, dim, green, magenta } from 'kleur/colors';
|
||||
import type { OutputAsset, OutputChunk } from 'rollup';
|
||||
import type { BufferEncoding } from 'vfile';
|
||||
import type {
|
||||
|
@ -21,7 +21,7 @@ import {
|
|||
generateImage as generateImageInternal,
|
||||
getStaticImageList,
|
||||
} from '../../assets/build/generate.js';
|
||||
import { hasPrerenderedPages, type BuildInternals } from '../../core/build/internal.js';
|
||||
import { type BuildInternals, hasPrerenderedPages } from '../../core/build/internal.js';
|
||||
import {
|
||||
isRelativePath,
|
||||
joinPaths,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as colors from 'kleur/colors';
|
||||
import fs from 'node:fs';
|
||||
import { performance } from 'node:perf_hooks';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as colors from 'kleur/colors';
|
||||
import type * as vite from 'vite';
|
||||
import type {
|
||||
AstroConfig,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as crypto from 'node:crypto';
|
||||
import * as npath from 'node:path';
|
||||
import type { GetModuleInfo } from 'rollup';
|
||||
import { type ResolvedConfig, type Plugin as VitePlugin } from 'vite';
|
||||
import { type Plugin as VitePlugin, type ResolvedConfig } from 'vite';
|
||||
import { isBuildableCSSRequest } from '../../../vite-plugin-astro-server/util.js';
|
||||
import type { BuildInternals } from '../internal.js';
|
||||
import type { AstroBuildPlugin } from '../plugin.js';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import glob from 'fast-glob';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import glob from 'fast-glob';
|
||||
import type { OutputChunk } from 'rollup';
|
||||
import { type Plugin as VitePlugin } from 'vite';
|
||||
import { runHookBuildSsr } from '../../../integrations/index.js';
|
||||
|
@ -9,7 +9,7 @@ import { joinPaths, prependForwardSlash } from '../../path.js';
|
|||
import { serializeRouteData } from '../../routing/index.js';
|
||||
import { addRollupInput } from '../add-rollup-input.js';
|
||||
import { getOutFile, getOutFolder } from '../common.js';
|
||||
import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js';
|
||||
import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js';
|
||||
import type { AstroBuildPlugin } from '../plugin.js';
|
||||
import type { StaticBuildOptions } from '../types.js';
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import fs from 'node:fs';
|
||||
import path, { extname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { teardown } from '@astrojs/compiler';
|
||||
import * as eslexer from 'es-module-lexer';
|
||||
import glob from 'fast-glob';
|
||||
import { bgGreen, bgMagenta, black, dim } from 'kleur/colors';
|
||||
import fs from 'node:fs';
|
||||
import path, { extname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as vite from 'vite';
|
||||
import type { RouteData } from '../../@types/astro.js';
|
||||
import {
|
||||
type BuildInternals,
|
||||
createBuildInternals,
|
||||
eachPageData,
|
||||
type BuildInternals,
|
||||
} from '../../core/build/internal.js';
|
||||
import { emptyDir, removeEmptyDirs } from '../../core/fs/index.js';
|
||||
import { appendForwardSlash, prependForwardSlash } from '../../core/path.js';
|
||||
|
@ -23,7 +23,7 @@ import { routeIsRedirect } from '../redirects/index.js';
|
|||
import { getOutDirWithinCwd } from './common.js';
|
||||
import { generatePages } from './generate.js';
|
||||
import { trackPageData } from './internal.js';
|
||||
import { createPluginContainer, type AstroBuildPluginContainer } from './plugin.js';
|
||||
import { type AstroBuildPluginContainer, createPluginContainer } from './plugin.js';
|
||||
import { registerAllPlugins } from './plugins/index.js';
|
||||
import { RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugins/plugin-manifest.js';
|
||||
import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { AstroConfig } from '../../@types/astro.js';
|
||||
import { compile, type CompileProps, type CompileResult } from './compile.js';
|
||||
import { type CompileProps, type CompileResult, compile } from './compile.js';
|
||||
|
||||
type CompilationCache = Map<string, CompileResult>;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ import type { TransformResult } from '@astrojs/compiler';
|
|||
import type { ResolvedConfig } from 'vite';
|
||||
import type { AstroConfig } from '../../@types/astro.js';
|
||||
|
||||
import { transform } from '@astrojs/compiler';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { transform } from '@astrojs/compiler';
|
||||
import { normalizePath } from 'vite';
|
||||
import { AggregateError, AstroError, CompilerError } from '../errors/errors.js';
|
||||
import { AstroErrorData } from '../errors/index.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { TransformOptions } from '@astrojs/compiler';
|
||||
import fs from 'node:fs';
|
||||
import { preprocessCSS, type ResolvedConfig } from 'vite';
|
||||
import type { TransformOptions } from '@astrojs/compiler';
|
||||
import { type ResolvedConfig, preprocessCSS } from 'vite';
|
||||
import { AstroErrorData, CSSError, positionAt } from '../errors/index.js';
|
||||
|
||||
export function createStylePreprocessor({
|
||||
|
|
|
@ -7,10 +7,10 @@ import type {
|
|||
CLIFlags,
|
||||
} from '../../@types/astro.js';
|
||||
|
||||
import * as colors from 'kleur/colors';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as colors from 'kleur/colors';
|
||||
import { ZodError } from 'zod';
|
||||
import { eventConfigError, telemetry } from '../../events/index.js';
|
||||
import { trackAstroConfigZodError } from '../errors/errors.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import yaml from 'js-yaml';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import yaml from 'js-yaml';
|
||||
import type { AstroConfig, AstroSettings } from '../../@types/astro.js';
|
||||
import { getContentPaths } from '../../content/index.js';
|
||||
import { markdownContentEntryType } from '../../vite-plugin-markdown/content-entry-type.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type fsType from 'node:fs';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import { createServer, type ViteDevServer } from 'vite';
|
||||
import { type ViteDevServer, createServer } from 'vite';
|
||||
import loadFallbackPlugin from '../../vite-plugin-load-fallback/index.js';
|
||||
import { debug } from '../logger/core.js';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { EndpointHandler } from '../../../@types/astro.js';
|
||||
import { createRenderContext, type SSROptions } from '../../render/index.js';
|
||||
import { type SSROptions, createRenderContext } from '../../render/index.js';
|
||||
import { callEndpoint } from '../index.js';
|
||||
|
||||
export async function call(options: SSROptions) {
|
||||
|
|
|
@ -204,7 +204,9 @@ export async function callEndpoint<MiddlewareResult = Response | EndpointOutput>
|
|||
? // Try the static route `pathname`
|
||||
ctx.route.pathname ??
|
||||
// Dynamic routes don't include `pathname`, so synthesize a path for these (e.g. 'src/pages/[slug].svg')
|
||||
ctx.route.segments.map((s) => s.map((p) => p.content).join('')).join('/')
|
||||
ctx.route.segments
|
||||
.map((s) => s.map((p) => p.content).join(''))
|
||||
.join('/')
|
||||
: // Fallback to pathname of the request
|
||||
ctx.pathname;
|
||||
const mimeType = mime.getType(pathname) || 'text/plain';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { escape } from 'html-escaper';
|
||||
import { bold, underline } from 'kleur/colors';
|
||||
import * as fs from 'node:fs';
|
||||
import { isAbsolute, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { escape } from 'html-escaper';
|
||||
import { bold, underline } from 'kleur/colors';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import type { ESBuildTransformResult } from 'vite';
|
||||
import { normalizePath } from 'vite';
|
||||
|
@ -165,7 +165,9 @@ function collectInfoFromStacktrace(error: SSRError & { stack: string }): StackIn
|
|||
error.pluginCode ||
|
||||
error.id ||
|
||||
// TODO: this could be better, `src` might be something else
|
||||
stackText.split('\n').find((ln) => ln.includes('src') || ln.includes('node_modules'));
|
||||
stackText
|
||||
.split('\n')
|
||||
.find((ln) => ln.includes('src') || ln.includes('node_modules'));
|
||||
const source = possibleFilePath?.replace(/^[^(]+\(([^)]+).*$/, '$1').replace(/^\s+at\s+/, '');
|
||||
|
||||
let file = source?.replace(/(:[0-9]+)/g, '');
|
||||
|
|
|
@ -167,9 +167,7 @@ export const NoMatchingRenderer = {
|
|||
|
||||
${
|
||||
validRenderersCount > 0
|
||||
? `There ${plural ? 'are' : 'is'} ${validRenderersCount} renderer${
|
||||
plural ? 's' : ''
|
||||
} configured in your \`astro.config.mjs\` file,
|
||||
? `There ${plural ? 'are' : 'is'} ${validRenderersCount} renderer${plural ? 's' : ''} configured in your \`astro.config.mjs\` file,
|
||||
but ${plural ? 'none were' : 'it was not'} able to server-side render \`${componentName}\`.`
|
||||
: `No valid renderer was found ${
|
||||
componentExtension
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import debugPackage from 'debug';
|
||||
import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors';
|
||||
import * as readline from 'node:readline';
|
||||
import { Writable } from 'node:stream';
|
||||
import debugPackage from 'debug';
|
||||
import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors';
|
||||
import stringWidth from 'string-width';
|
||||
import { dateTimeFormat, error, info, warn } from './core.js';
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import type http from 'node:http';
|
|||
import { fileURLToPath } from 'node:url';
|
||||
import { performance } from 'perf_hooks';
|
||||
import enableDestroy from 'server-destroy';
|
||||
import { preview, type PreviewServer as VitePreviewServer } from 'vite';
|
||||
import { type PreviewServer as VitePreviewServer, preview } from 'vite';
|
||||
import type { AstroSettings } from '../../@types/astro.js';
|
||||
import type { Logger } from '../logger/core.js';
|
||||
import * as msg from '../messages.js';
|
||||
|
|
|
@ -6,7 +6,7 @@ import type {
|
|||
SSRLoadedRenderer,
|
||||
SSRResult,
|
||||
} from '../../@types/astro.js';
|
||||
import { renderSlotToString, type ComponentSlots } from '../../runtime/server/index.js';
|
||||
import { type ComponentSlots, renderSlotToString } from '../../runtime/server/index.js';
|
||||
import { renderJSX } from '../../runtime/server/jsx.js';
|
||||
import { chunkToString } from '../../runtime/server/render/index.js';
|
||||
import { AstroCookies } from '../cookies/index.js';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { dim } from 'kleur/colors';
|
||||
import fsMod from 'node:fs';
|
||||
import { performance } from 'node:perf_hooks';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { createServer, type HMRPayload } from 'vite';
|
||||
import { dim } from 'kleur/colors';
|
||||
import { type HMRPayload, createServer } from 'vite';
|
||||
import type { AstroInlineConfig, AstroSettings } from '../../@types/astro.js';
|
||||
import { createContentTypesGenerator } from '../../content/index.js';
|
||||
import { globalContentConfigObserver } from '../../content/utils.js';
|
||||
|
|
|
@ -101,11 +101,7 @@ function getSafeErrorMessage(message: string | Function): string {
|
|||
.slice(1, -1)
|
||||
.replace(
|
||||
/\${([^}]+)}/gm,
|
||||
(str, match1) =>
|
||||
`${match1
|
||||
.split(/\.?(?=[A-Z])/)
|
||||
.join('_')
|
||||
.toUpperCase()}`
|
||||
(str, match1) => `${match1.split(/\.?(?=[A-Z])/).join('_').toUpperCase()}`
|
||||
)
|
||||
.replace(/\\`/g, '`');
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { bold } from 'kleur/colors';
|
||||
import fs from 'node:fs';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { bold } from 'kleur/colors';
|
||||
import type { InlineConfig, ViteDevServer } from 'vite';
|
||||
import type {
|
||||
AstroAdapter,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Fragment, markHTMLString, Renderer } from '../runtime/server/index.js';
|
||||
import { Fragment, Renderer, markHTMLString } from '../runtime/server/index.js';
|
||||
|
||||
const AstroJSX = 'astro:jsx';
|
||||
const Empty = Symbol('empty');
|
||||
|
|
|
@ -41,7 +41,7 @@ export type {
|
|||
export { createTransitionScope, renderTransition } from './transition.js';
|
||||
|
||||
import { markHTMLString } from './escape.js';
|
||||
import { addAttribute, Renderer } from './render/index.js';
|
||||
import { Renderer, addAttribute } from './render/index.js';
|
||||
|
||||
export function mergeSlots(...slotted: unknown[]) {
|
||||
const slots: Record<string, () => any> = {};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable no-console */
|
||||
import type { SSRResult } from '../../@types/astro.js';
|
||||
import { AstroJSX, isVNode, type AstroVNode } from '../../jsx-runtime/index.js';
|
||||
import { AstroJSX, type AstroVNode, isVNode } from '../../jsx-runtime/index.js';
|
||||
import {
|
||||
HTMLString,
|
||||
escapeHTML,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { escapeHTML, isHTMLString, markHTMLString } from '../escape.js';
|
||||
import { isAstroComponentInstance, isRenderTemplateResult } from './astro/index.js';
|
||||
import { isRenderInstance, type RenderDestination } from './common.js';
|
||||
import { type RenderDestination, isRenderInstance } from './common.js';
|
||||
import { SlotString } from './slot.js';
|
||||
import { renderToBufferDestination } from './util.js';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { RouteData, SSRResult } from '../../../../@types/astro.js';
|
||||
import { AstroError, AstroErrorData } from '../../../../core/errors/index.js';
|
||||
import { chunkToByteArray, chunkToString, encoder, type RenderDestination } from '../common.js';
|
||||
import { type RenderDestination, chunkToByteArray, chunkToString, encoder } from '../common.js';
|
||||
import type { AstroComponentFactory } from './factory.js';
|
||||
import { isHeadAndContent } from './head-and-content.js';
|
||||
import { isRenderTemplateResult } from './render-template.js';
|
||||
|
|
|
@ -3,14 +3,14 @@ import type { RenderInstruction } from './instruction.js';
|
|||
|
||||
import { HTMLBytes, HTMLString, markHTMLString } from '../escape.js';
|
||||
import {
|
||||
type PrescriptType,
|
||||
determineIfNeedsHydrationScript,
|
||||
determinesIfNeedsDirectiveScript,
|
||||
getPrescripts,
|
||||
type PrescriptType,
|
||||
} from '../scripts.js';
|
||||
import { renderAllHeadContent } from './head.js';
|
||||
import { isRenderInstruction } from './instruction.js';
|
||||
import { isSlotString, type SlotString } from './slot.js';
|
||||
import { type SlotString, isSlotString } from './slot.js';
|
||||
|
||||
/**
|
||||
* Possible chunk types to be written to the destination, and it'll
|
||||
|
|
|
@ -4,7 +4,7 @@ import type {
|
|||
SSRLoadedRenderer,
|
||||
SSRResult,
|
||||
} from '../../../@types/astro.js';
|
||||
import { createRenderInstruction, type RenderInstruction } from './instruction.js';
|
||||
import { type RenderInstruction, createRenderInstruction } from './instruction.js';
|
||||
|
||||
import { clsx } from 'clsx';
|
||||
import { AstroError, AstroErrorData } from '../../../core/errors/index.js';
|
||||
|
@ -14,21 +14,21 @@ import { serializeProps } from '../serialize.js';
|
|||
import { shorthash } from '../shorthash.js';
|
||||
import { isPromise } from '../util.js';
|
||||
import {
|
||||
type AstroComponentFactory,
|
||||
createAstroComponentInstance,
|
||||
isAstroComponentFactory,
|
||||
renderTemplate,
|
||||
type AstroComponentFactory,
|
||||
} from './astro/index.js';
|
||||
import {
|
||||
Fragment,
|
||||
Renderer,
|
||||
chunkToString,
|
||||
type RenderDestination,
|
||||
type RenderInstance,
|
||||
Renderer,
|
||||
chunkToString,
|
||||
} from './common.js';
|
||||
import { componentIsHTMLElement, renderHTMLElement } from './dom.js';
|
||||
import { maybeRenderHead } from './head.js';
|
||||
import { renderSlotToString, renderSlots, type ComponentSlots } from './slot.js';
|
||||
import { type ComponentSlots, renderSlotToString, renderSlots } from './slot.js';
|
||||
import { formatList, internalSpreadAttributes, renderElement, voidElementNames } from './util.js';
|
||||
|
||||
const needsHeadRenderingSymbol = Symbol.for('astro.needsHeadRendering');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { RouteData, SSRResult } from '../../../@types/astro.js';
|
||||
import { renderComponentToString, type NonAstroPageComponent } from './component.js';
|
||||
import { type NonAstroPageComponent, renderComponentToString } from './component.js';
|
||||
import type { AstroComponentFactory } from './index.js';
|
||||
|
||||
import { isAstroComponentFactory } from './astro/index.js';
|
||||
|
|
|
@ -4,7 +4,7 @@ import type { RenderInstruction } from './instruction.js';
|
|||
|
||||
import { HTMLString, markHTMLString } from '../escape.js';
|
||||
import { renderChild } from './any.js';
|
||||
import { chunkToString, type RenderDestination, type RenderInstance } from './common.js';
|
||||
import { type RenderDestination, type RenderInstance, chunkToString } from './common.js';
|
||||
|
||||
type RenderTemplateResult = ReturnType<typeof renderTemplate>;
|
||||
export type ComponentSlots = Record<string, ComponentSlotValue>;
|
||||
|
|
|
@ -50,7 +50,7 @@ export function renderTransition(
|
|||
if (animations) {
|
||||
for (const [direction, images] of Object.entries(animations) as Entries<typeof animations>) {
|
||||
for (const [image, rules] of Object.entries(images) as Entries<
|
||||
(typeof animations)[typeof direction]
|
||||
typeof animations[typeof direction]
|
||||
>) {
|
||||
sheet.addAnimationPair(direction, image, rules);
|
||||
}
|
||||
|
@ -69,10 +69,7 @@ class ViewTransitionStyleSheet {
|
|||
private modern: string[] = [];
|
||||
private fallback: string[] = [];
|
||||
|
||||
constructor(
|
||||
private scope: string,
|
||||
private name: string
|
||||
) {}
|
||||
constructor(private scope: string, private name: string) {}
|
||||
|
||||
toString() {
|
||||
const { scope, name } = this;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue