Merge branch 'main' into feat/vercel-adapter

This commit is contained in:
JuanM04 2022-03-28 19:44:29 -03:00
commit d6f0d5cf3c
No known key found for this signature in database
GPG key ID: 0171B712E406271A
47 changed files with 217 additions and 3619 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix typing of `integrations` array in user config

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/preact": "^0.0.2",
"astro": "^0.25.2",
"astro": "^0.25.3",
"sass": "^1.49.9"
},
"dependencies": {

View file

@ -9,7 +9,7 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2",
"astro": "^0.25.3",
"@astrojs/preact": "^0.0.2"
},
"dependencies": {

View file

@ -10,6 +10,6 @@
},
"devDependencies": {
"@example/my-component": "workspace:*",
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -8,6 +8,6 @@
"serve": "astro --project-root demo preview"
},
"devDependencies": {
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -20,6 +20,6 @@
"devDependencies": {
"@astrojs/preact": "^0.0.2",
"@astrojs/react": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -9,6 +9,6 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -9,6 +9,6 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/lit": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"@webcomponents/template-shadowroot": "^0.1.0",

View file

@ -15,7 +15,7 @@
"@astrojs/solid-js": "^0.0.3",
"@astrojs/svelte": "^0.0.2",
"@astrojs/vue": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"@webcomponents/template-shadowroot": "^0.1.0",

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/preact": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"preact": "^10.6.6"

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/react": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"react": "^17.0.2",

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/solid-js": "^0.0.3",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"solid-js": "^1.3.13"

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/svelte": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"svelte": "^3.46.4"

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/vue": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"vue": "^3.2.31"

View file

@ -15,7 +15,7 @@
"@astrojs/sitemap": "^0.0.2",
"@astrojs/tailwind": "^0.0.2",
"@astrojs/turbolinks": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"@webcomponents/template-shadowroot": "^0.1.0",

View file

@ -9,6 +9,6 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -9,6 +9,6 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/preact": "^0.0.2",
"astro": "^0.25.2",
"astro": "^0.25.3",
"sass": "^1.49.9"
},
"dependencies": {

View file

@ -13,7 +13,7 @@
"devDependencies": {
"@astrojs/svelte": "^0.0.2",
"@astrojs/node": "^0.0.2",
"astro": "^0.25.2",
"astro": "^0.25.3",
"concurrently": "^7.0.0",
"lightcookie": "^1.0.25",
"unocss": "^0.15.6",

View file

@ -9,6 +9,6 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/react": "^0.0.2",
"astro": "^0.25.2",
"astro": "^0.25.3",
"sass": "^1.49.9"
},
"dependencies": {

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/markdown-remark": "^0.7.0",
"astro": "^0.25.2",
"astro": "^0.25.3",
"hast-util-select": "5.0.1",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.0.1",

View file

@ -10,6 +10,6 @@
},
"devDependencies": {
"@astrojs/markdown-remark": "^0.7.0",
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -14,7 +14,7 @@
"@astrojs/react": "^0.0.2",
"@astrojs/svelte": "^0.0.2",
"@astrojs/vue": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
},
"dependencies": {
"preact": "^10.6.6",

View file

@ -25,6 +25,6 @@
"@astrojs/solid-js": "^0.0.3",
"@astrojs/svelte": "^0.0.2",
"@astrojs/vue": "^0.0.2",
"astro": "^0.25.2"
"astro": "^0.25.3"
}
}

View file

@ -10,7 +10,7 @@
},
"devDependencies": {
"@astrojs/tailwind": "^0.0.2",
"astro": "^0.25.2",
"astro": "^0.25.3",
"autoprefixer": "^10.4.4",
"canvas-confetti": "^1.5.1",
"postcss": "^8.4.12",

View file

@ -9,7 +9,7 @@
"preview": "astro preview"
},
"devDependencies": {
"astro": "^0.25.2",
"astro": "^0.25.3",
"vite-plugin-pwa": "0.11.11",
"workbox-window": "^6.5.2"
}

View file

@ -1,5 +1,11 @@
# astro
## 0.25.3
### Patch Changes
- [#2918](https://github.com/withastro/astro/pull/2918) [`77354c89`](https://github.com/withastro/astro/commit/77354c89bd606beba71231cce6ce935905de68a7) Thanks [@matthewp](https://github.com/matthewp)! - Prevent CSS from being added to the wrong pages
## 0.25.2
### Patch Changes

View file

@ -1,6 +1,6 @@
{
"name": "astro",
"version": "0.25.2",
"version": "0.25.3",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",

View file

@ -161,7 +161,7 @@ export interface AstroUserConfig {
* }
* ```
*/
integrations?: AstroIntegration[];
integrations?: Array<AstroIntegration | AstroIntegration[]>;
/**
* @docs

View file

@ -105,6 +105,10 @@ export function getPageDataByViteID(internals: BuildInternals, viteid: ViteID):
return undefined;
}
export function hasPageDataByViteID(internals: BuildInternals, viteid: ViteID): boolean {
return internals.pagesByViteID.has(viteid);
}
export function* eachPageData(internals: BuildInternals) {
yield* internals.pagesByComponent.values();
}

View file

@ -76,6 +76,7 @@ export async function build(opts: ScanBasedBuildOptions): Promise<RollupOutput |
}),
rollupPluginAstroBuildCSS({
internals,
legacy: true,
}),
...(viteConfig.plugins || []),
],

View file

@ -132,7 +132,6 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
entryFileNames: opts.buildConfig.serverEntry,
chunkFileNames: 'chunks/chunk.[hash].mjs',
assetFileNames: 'assets/asset.[hash][extname]',
inlineDynamicImports: true,
},
},
// must match an esbuild target
@ -147,6 +146,7 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
vitePluginPages(opts, internals),
rollupPluginAstroBuildCSS({
internals,
legacy: false,
}),
...(viteConfig.plugins || []),
// SSR needs to be last
@ -200,6 +200,7 @@ async function clientBuild(opts: StaticBuildOptions, internals: BuildInternals,
vitePluginHoistedScripts(astroConfig, internals),
rollupPluginAstroBuildCSS({
internals,
legacy: false,
}),
...(viteConfig.plugins || []),
],

View file

@ -6,7 +6,7 @@ import { eachPageData } from './internal.js';
import { isBuildingToSSR } from '../util.js';
export const virtualModuleId = '@astrojs-pages-virtual-entry';
const resolvedVirtualModuleId = '\0' + virtualModuleId;
export const resolvedVirtualModuleId = '\0' + virtualModuleId;
export function vitePluginPages(opts: StaticBuildOptions, internals: BuildInternals): VitePlugin {
return {

View file

@ -140,7 +140,7 @@ export async function validateConfig(userConfig: any, root: string): Promise<Ast
console.error('Update your configuration and install new dependencies:');
try {
const rendererKeywords = userConfig.renderers.map((r: string) => r.replace('@astrojs/renderer-', ''));
const rendererImports = rendererKeywords.map((r: string) => ` import ${r} from '@astrojs/${r}';`).join('\n');
const rendererImports = rendererKeywords.map((r: string) => ` import ${r} from '@astrojs/${r === 'solid' ? 'solid-js' : r}';`).join('\n');
const rendererIntegrations = rendererKeywords.map((r: string) => ` ${r}(),`).join('\n');
console.error('');
console.error(colors.dim(' // astro.config.js'));

View file

@ -1,10 +1,12 @@
import type { BuildInternals } from '../core/build/internal';
import { BuildInternals } from '../core/build/internal';
import type { ModuleInfo, PluginContext } from 'rollup';
import * as path from 'path';
import esbuild from 'esbuild';
import { Plugin as VitePlugin } from 'vite';
import { isCSSRequest } from '../core/render/dev/css.js';
import { getPageDatasByChunk } from '../core/build/internal.js';
import { getPageDatasByChunk, getPageDataByViteID, hasPageDataByViteID } from '../core/build/internal.js';
import { resolvedVirtualModuleId as virtualPagesModuleId } from '../core/build/vite-plugin-pages.js';
const PLUGIN_NAME = '@astrojs/rollup-plugin-build-css';
@ -44,12 +46,64 @@ function isPageStyleVirtualModule(id: string) {
interface PluginOptions {
internals: BuildInternals;
legacy: boolean;
}
export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
const { internals } = options;
const { internals, legacy } = options;
const styleSourceMap = new Map<string, string>();
function* walkStyles(ctx: PluginContext, id: string, seen = new Set<string>()): Generator<[string, string], void, unknown> {
seen.add(id);
if (styleSourceMap.has(id)) {
yield [id, styleSourceMap.get(id)!];
}
const info = ctx.getModuleInfo(id);
if (info) {
for (const importedId of info.importedIds) {
if (!seen.has(importedId)) {
yield* walkStyles(ctx, importedId, seen);
}
}
}
}
/**
* This walks the dependency graph looking for styles that are imported
* by a page and then creates a chunking containing all of the styles for that page.
* Since there is only 1 entrypoint for the entire app, we do this in order
* to prevent adding all styles to all pages.
*/
async function addStyles(this: PluginContext) {
for (const id of this.getModuleIds()) {
if (hasPageDataByViteID(internals, id)) {
let pageStyles = '';
for (const [_styleId, styles] of walkStyles(this, id)) {
pageStyles += styles;
}
// Pages with no styles, nothing more to do
if (!pageStyles) continue;
const { code: minifiedCSS } = await esbuild.transform(pageStyles, {
loader: 'css',
minify: true,
});
const referenceId = this.emitFile({
name: 'entry' + '.css',
type: 'asset',
source: minifiedCSS,
});
const fileName = this.getFileName(referenceId);
// Add CSS file to the page's pageData, so that it will be rendered with
// the correct links.
getPageDataByViteID(internals, id)?.css.add(fileName);
}
}
}
return {
name: PLUGIN_NAME,
@ -76,7 +130,6 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
plugins.splice(viteCSSPostIndex - 1, 0, ourPlugin);
}
},
async resolveId(id) {
if (isPageStyleVirtualModule(id)) {
return id;
@ -108,6 +161,8 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
},
async renderChunk(_code, chunk) {
if (!legacy) return null;
let chunkCSS = '';
let isPureCSS = true;
for (const [id] of Object.entries(chunk.modules)) {
@ -147,7 +202,7 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
},
// Delete CSS chunks so JS is not produced for them.
generateBundle(opts, bundle) {
async generateBundle(opts, bundle) {
const hasPureCSSChunks = internals.pureCSSChunks.size;
const pureChunkFilenames = new Set([...internals.pureCSSChunks].map((chunk) => chunk.fileName));
const emptyChunkFiles = [...pureChunkFilenames]
@ -156,6 +211,11 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin {
.replace(/\./g, '\\.');
const emptyChunkRE = new RegExp(opts.format === 'es' ? `\\bimport\\s*"[^"]*(?:${emptyChunkFiles})";\n?` : `\\brequire\\(\\s*"[^"]*(?:${emptyChunkFiles})"\\);\n?`, 'g');
// Crawl the module graph to find CSS chunks to create
if (!legacy) {
await addStyles.call(this);
}
for (const [chunkId, chunk] of Object.entries(bundle)) {
if (chunk.type === 'chunk') {
// This find shared chunks of CSS and adds them to the main CSS chunks,

View file

@ -0,0 +1,13 @@
---
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Astro</title>
</head>
<body>
<slot />
</body>
</html>

View file

@ -0,0 +1,13 @@
---
import "../styles/main.css";
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Astro</title>
</head>
<body>
<slot />
</body>
</html>

View file

@ -0,0 +1,9 @@
---
import Layout from '../layouts/Styled.astro'
---
<Layout>
<h1>Astro (with main.css)</h1>
<p>This should have custom styles (white text on black background)</p>
<a href="/">Home (without main.css)</a>
</Layout>

View file

@ -0,0 +1,9 @@
---
import Layout from '../layouts/Base.astro'
---
<Layout>
<h1>Astro (without main.css)</h1>
<p>This should have default styles (white text on black background)</p>
<a href="/blog">Blog (with main.css)</a>
</Layout>

View file

@ -0,0 +1,4 @@
body {
background-color: black;
color: white;
}

View file

@ -0,0 +1,27 @@
import { expect } from 'chai';
import { load as cheerioLoad } from 'cheerio';
import { loadFixture } from './test-utils.js';
// Asset bundling
describe('Page-level styles', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
projectRoot: './fixtures/page-level-styles/',
});
await fixture.build();
});
it("Doesn't add page styles for a page without style imports", async () => {
let html = await fixture.readFile('/index.html');
let $ = await cheerioLoad(html);
expect($('link').length).to.equal(0);
});
it('Does add page styles for pages with style imports (or deps)', async () => {
let html = await fixture.readFile('/blog/index.html');
let $ = await cheerioLoad(html);
expect($('link').length).to.equal(1);
});
});

View file

@ -44,7 +44,7 @@ importers:
examples/blog:
specifiers:
'@astrojs/preact': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
preact: ^10.6.6
dependencies:
preact: 10.6.6
@ -55,7 +55,7 @@ importers:
examples/blog-multiple-authors:
specifiers:
'@astrojs/preact': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
preact: ^10.6.6
sass: ^1.49.9
dependencies:
@ -67,14 +67,14 @@ importers:
examples/component:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
astro: link:../../packages/astro
examples/component/demo:
specifiers:
'@example/my-component': workspace:*
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
'@example/my-component': link:../packages/my-component
astro: link:../../../packages/astro
@ -90,7 +90,7 @@ importers:
'@docsearch/css': ^3.0.0
'@docsearch/react': ^3.0.0
'@types/react': ^17.0.43
astro: ^0.25.2
astro: ^0.25.3
preact: ^10.6.6
react: ^17.0.2
react-dom: ^17.0.2
@ -109,13 +109,13 @@ importers:
examples/env-vars:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
astro: link:../../packages/astro
examples/framework-alpine:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
astro: link:../../packages/astro
@ -123,7 +123,7 @@ importers:
specifiers:
'@astrojs/lit': ^0.0.2
'@webcomponents/template-shadowroot': ^0.1.0
astro: ^0.25.2
astro: ^0.25.3
lit: ^2.2.1
dependencies:
'@webcomponents/template-shadowroot': 0.1.0
@ -141,7 +141,7 @@ importers:
'@astrojs/svelte': ^0.0.2
'@astrojs/vue': ^0.0.2
'@webcomponents/template-shadowroot': ^0.1.0
astro: ^0.25.2
astro: ^0.25.3
lit: ^2.2.1
preact: ^10.6.6
react: ^17.0.2
@ -170,7 +170,7 @@ importers:
examples/framework-preact:
specifiers:
'@astrojs/preact': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
preact: ^10.6.6
dependencies:
preact: 10.6.6
@ -181,7 +181,7 @@ importers:
examples/framework-react:
specifiers:
'@astrojs/react': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
react: ^17.0.2
react-dom: ^17.0.2
dependencies:
@ -194,7 +194,7 @@ importers:
examples/framework-solid:
specifiers:
'@astrojs/solid-js': ^0.0.3
astro: ^0.25.2
astro: ^0.25.3
solid-js: ^1.3.13
dependencies:
solid-js: 1.3.13
@ -205,7 +205,7 @@ importers:
examples/framework-svelte:
specifiers:
'@astrojs/svelte': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
svelte: ^3.46.4
dependencies:
svelte: 3.46.4
@ -216,7 +216,7 @@ importers:
examples/framework-vue:
specifiers:
'@astrojs/vue': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
vue: ^3.2.31
dependencies:
vue: 3.2.31
@ -233,7 +233,7 @@ importers:
'@astrojs/tailwind': ^0.0.2
'@astrojs/turbolinks': ^0.0.2
'@webcomponents/template-shadowroot': ^0.1.0
astro: ^0.25.2
astro: ^0.25.3
lit: ^2.2.1
preact: ^10.6.6
react: ^17.0.2
@ -261,20 +261,20 @@ importers:
examples/minimal:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
astro: link:../../packages/astro
examples/non-html-pages:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
astro: link:../../packages/astro
examples/portfolio:
specifiers:
'@astrojs/preact': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
preact: ^10.6.6
sass: ^1.49.9
dependencies:
@ -288,7 +288,7 @@ importers:
specifiers:
'@astrojs/node': ^0.0.2
'@astrojs/svelte': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
concurrently: ^7.0.0
lightcookie: ^1.0.25
svelte: ^3.46.4
@ -307,14 +307,14 @@ importers:
examples/starter:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
astro: link:../../packages/astro
examples/subpath:
specifiers:
'@astrojs/react': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
react: ^17.0.2
react-dom: ^17.0.2
sass: ^1.49.9
@ -333,7 +333,7 @@ importers:
'@astrojs/react': ^0.0.2
'@astrojs/svelte': ^0.0.2
'@astrojs/vue': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
preact: ^10.6.6
react: ^17.0.2
react-dom: ^17.0.2
@ -356,7 +356,7 @@ importers:
examples/with-markdown-plugins:
specifiers:
'@astrojs/markdown-remark': ^0.7.0
astro: ^0.25.2
astro: ^0.25.3
hast-util-select: 5.0.1
rehype-autolink-headings: ^6.1.1
rehype-slug: ^5.0.1
@ -374,7 +374,7 @@ importers:
examples/with-markdown-shiki:
specifiers:
'@astrojs/markdown-remark': ^0.7.0
astro: ^0.25.2
astro: ^0.25.3
devDependencies:
'@astrojs/markdown-remark': link:../../packages/markdown/remark
astro: link:../../packages/astro
@ -389,7 +389,7 @@ importers:
'@nanostores/preact': ^0.1.3
'@nanostores/react': ^0.1.5
'@nanostores/vue': ^0.4.1
astro: ^0.25.2
astro: ^0.25.3
nanostores: ^0.5.12
preact: ^10.6.6
react: ^17.0.2
@ -417,7 +417,7 @@ importers:
examples/with-tailwindcss:
specifiers:
'@astrojs/tailwind': ^0.0.2
astro: ^0.25.2
astro: ^0.25.3
autoprefixer: ^10.4.4
canvas-confetti: ^1.5.1
postcss: ^8.4.12
@ -432,7 +432,7 @@ importers:
examples/with-vite-plugin-pwa:
specifiers:
astro: ^0.25.2
astro: ^0.25.3
vite-plugin-pwa: 0.11.11
workbox-window: ^6.5.2
devDependencies:

View file

@ -1,4 +1,5 @@
Date,Commits (24hr),Issues (24hr),Issues:BUG (24hr),Issues:RFC (24hr),Issues:DOC (24hr),PRs (24hr),Open PRs,Open Issues,Bugs: Needs Triage,Bugs: Accepted,RFC: In Progress,RFC: Accepted,Date (ISO)
"Monday, March 28, 2022",1,7,7,0,0,2,8,83,36,41,0,0,"2022-03-28T12:02:00.954Z"
"Sunday, March 27, 2022",1,2,2,0,0,2,6,77,29,41,0,0,"2022-03-27T12:01:52.463Z"
"Saturday, March 26, 2022",22,5,5,0,0,12,5,75,27,41,0,0,"2022-03-26T12:03:34.243Z"
"Friday, March 25, 2022",18,2,2,0,0,7,6,73,25,40,0,0,"2022-03-25T12:02:05.476Z"

1 Date Commits (24hr) Issues (24hr) Issues:BUG (24hr) Issues:RFC (24hr) Issues:DOC (24hr) PRs (24hr) Open PRs Open Issues Bugs: Needs Triage Bugs: Accepted RFC: In Progress RFC: Accepted Date (ISO)
2 Monday, March 28, 2022 1 7 7 0 0 2 8 83 36 41 0 0 2022-03-28T12:02:00.954Z
3 Sunday, March 27, 2022 1 2 2 0 0 2 6 77 29 41 0 0 2022-03-27T12:01:52.463Z
4 Saturday, March 26, 2022 22 5 5 0 0 12 5 75 27 41 0 0 2022-03-26T12:03:34.243Z
5 Friday, March 25, 2022 18 2 2 0 0 7 6 73 25 40 0 0 2022-03-25T12:02:05.476Z

File diff suppressed because it is too large Load diff

View file

@ -1,774 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"fileTypes": ["astro"],
"foldingStartMarker": "(?x)\n(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\\b.*?>\n|<!--(?!.*--\\s*>)\n|^<!--\\ \\#tminclude\\ (?>.*?-->)$\n|<\\?(?:php)?.*\\b(if|for(each)?|while)\\b.+:\n|\\{\\{?(if|foreach|capture|literal|foreach|php|section|strip)\n|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))\n)",
"foldingStopMarker": "(?x)\n(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)>\n|^(?!.*?<!--).*?--\\s*>\n|^<!--\\ end\\ tminclude\\ -->$\n|<\\?(?:php)?.*\\bend(if|for(each)?|while)\\b\n|\\{\\{?/(if|foreach|capture|literal|foreach|php|section|strip)\n|^[^{]*\\}\n)",
"keyEquivalent": "^~H",
"name": "Astro",
"scopeName": "text.html.astro",
"patterns": [
{
"include": "#astro-markdown"
},
{
"include": "#astro-expressions"
},
{
"begin": "(<)([a-zA-Z0-9:-]++)(?=[^>]*></\\2>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
}
},
"end": "(>)(<)(/)(\\2)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
},
"2": {
"name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html"
},
"3": {
"name": "punctuation.definition.tag.begin.html"
},
"4": {
"name": "entity.name.tag.html"
},
"5": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(<\\?)(xml)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.xml.html"
}
},
"end": "(\\?>)",
"name": "meta.tag.preprocessor.xml.html",
"patterns": [
{
"include": "#tag-generic-attribute"
},
{
"include": "#string-double-quoted"
},
{
"include": "#string-single-quoted"
}
]
},
{
"begin": "<!--",
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"end": "--\\s*>",
"name": "comment.block.html",
"patterns": [
{
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "<!",
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"begin": "(?i:DOCTYPE|doctype)",
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?=[^>]*lang=(['\"])css\\1?)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.css.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "source.css"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?=[^>]*lang=(['\"])sass\\1?)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.sass.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "source.sass"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?=[^>]*lang=(['\"])scss\\1?)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.scss.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "source.css.scss"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"__DEFAULT_STYLE_NAME_START__": null,
"name": "source.css.embedded.html",
"__DEFAULT_STYLE_NAME_END__": null,
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"__DEFAULT_STYLE_INCLUDE_START__": null,
"include": "source.css",
"__DEFAULT_STYLE_INCLUDE_END__": null
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?=[^>]*lang=(['\"])tsx\\1?)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.tsx.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"include": "source.tsx"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?=[^>]*lang=(['\"])ts\\1?)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.tsx.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"include": "source.tsx"
}
]
}
]
},
{
"begin": "(<)((?i:script))\\b(?![^>]*/>)(?![^>]*(?i:type.?=.?text/((?!javascript|babel|ecmascript).*)))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.tsx.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"match": "(//).*?((?=</script)|$\\n?)",
"name": "comment.line.double-slash.js"
},
{
"begin": "/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.js"
}
},
"end": "\\*/|(?=</script)",
"name": "comment.block.js"
},
{
"include": "source.tsx"
}
]
}
]
},
{
"begin": "(</?)((?i:body|head|html)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.structure.any.html"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.structure.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.block.any.html"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.block.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.inline.any.html"
}
},
"end": "((?: ?/)?>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.inline.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)([A-Z][a-zA-Z0-9-\\.]*|[a-z]+\\.[a-zA-Z0-9-]+)(\\:(load|idle|visible))?",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.component.astro"
},
"3": {
"name": "keyword.control.loading.astro"
}
},
"end": "(/?>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.component.astro",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)([a-zA-Z0-9:-]+)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.other.html"
}
},
"end": "(/?>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.other.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"include": "#entities"
},
{
"include": "#frontmatter"
},
{
"match": "<>",
"name": "invalid.illegal.incomplete.html"
},
{
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
],
"repository": {
"frontmatter": {
"begin": "\\A(-{3})\\s*$",
"beginCaptures": {
"1": {
"name": "comment.block.html"
}
},
"contentName": "meta.embedded.block.frontmatter",
"patterns": [
{
"include": "source.tsx"
}
],
"end": "(^|\\G)(-{3})|\\.{3}\\s*$",
"endCaptures": {
"2": {
"name": "comment.block.html"
}
}
},
"entities": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.entity.html"
},
"3": {
"name": "punctuation.definition.entity.html"
}
},
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"name": "constant.character.entity.html"
},
{
"match": "&",
"name": "invalid.illegal.bad-ampersand.html"
}
]
},
"string-double-quoted": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.double.html",
"patterns": [
{
"include": "#entities"
}
]
},
"string-single-quoted": {
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.single.html",
"patterns": [
{
"include": "#entities"
}
]
},
"tag-generic-attribute": {
"match": "\\b([a-zA-Z\\-:]+)",
"name": "entity.other.attribute-name.html"
},
"tag-id-attribute": {
"begin": "\\b(id)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.id.html"
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
"end": "(?<='|\")",
"name": "meta.attribute-with-value.id.html",
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"contentName": "meta.toc-list.id.html",
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.double.html",
"patterns": [
{
"include": "#astro-expressions"
},
{
"include": "#entities"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"contentName": "meta.toc-list.id.html",
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.single.html",
"patterns": [
{
"include": "#astro-expressions"
},
{
"include": "#entities"
}
]
}
]
},
"tag-stuff": {
"patterns": [
{
"include": "#tag-id-attribute"
},
{
"include": "#tag-generic-attribute"
},
{
"include": "#string-double-quoted"
},
{
"include": "#string-single-quoted"
},
{
"include": "#astro-load-directive"
},
{
"include": "#astro-expressions"
},
{
"include": "#astro-markdown"
}
]
},
"astro-markdown": {
"name": "text.html.astro.markdown",
"begin": "(<)(Markdown)(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(</)(Markdown)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "text.html.markdown.astro"
}
]
},
"astro-expressions": {
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.generic.begin.html"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.generic.end.html"
}
},
"name": "expression.embbeded.astro",
"patterns": [
{
"include": "source.tsx"
}
]
}
]
}
}
}