diff --git a/.changeset/chatty-cows-attack.md b/.changeset/chatty-cows-attack.md deleted file mode 100644 index 7fe9fb8c2..000000000 --- a/.changeset/chatty-cows-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Allow components to return a Response diff --git a/.changeset/flat-radios-cheer.md b/.changeset/flat-radios-cheer.md deleted file mode 100644 index ab01d34dd..000000000 --- a/.changeset/flat-radios-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -`--experimental-ssr` now is only required when using a 3rd-party adapter diff --git a/.changeset/forty-coins-attend.md b/.changeset/forty-coins-attend.md deleted file mode 100644 index 467e520fd..000000000 --- a/.changeset/forty-coins-attend.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"astro": minor ---- - -Implement RFC [#0017](https://github.com/withastro/rfcs/blob/main/proposals/0017-markdown-content-redesign.md) - -- New Markdown API -- New `Astro.glob()` API -- **BREAKING CHANGE:** Removed `Astro.fetchContent()` (replaced by `Astro.glob()`) - -```diff -// v0.25 -- let allPosts = Astro.fetchContent('./posts/*.md'); -// v0.26+ -+ let allPosts = await Astro.glob('./posts/*.md'); -``` diff --git a/.changeset/light-apricots-sort.md b/.changeset/light-apricots-sort.md deleted file mode 100644 index 26a182a40..000000000 --- a/.changeset/light-apricots-sort.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'astro': patch ---- - -Improve `Astro.slots` API to support passing arguments to function-based slots. - -This allows for more ergonomic utility components that accept a callback function as a child. diff --git a/.changeset/ninety-jars-swim.md b/.changeset/ninety-jars-swim.md deleted file mode 100644 index dd7c79c13..000000000 --- a/.changeset/ninety-jars-swim.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/react': minor ---- - -Add support for React v18 diff --git a/.changeset/odd-swans-walk.md b/.changeset/odd-swans-walk.md deleted file mode 100644 index 0c406d7e0..000000000 --- a/.changeset/odd-swans-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes non-GET API routes in dev with Node 14 diff --git a/.changeset/perfect-dogs-turn.md b/.changeset/perfect-dogs-turn.md deleted file mode 100644 index 61517d560..000000000 --- a/.changeset/perfect-dogs-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': minor ---- - -Implements the Astro.request RFC diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 5b9fb8f21..000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "mode": "pre", - "tag": "next", - "initialVersions": { - "@example/blog": "0.0.1", - "@example/blog-multiple-authors": "0.0.1", - "@example/component": "0.0.1", - "@example/my-component-demo": "0.0.1", - "@example/my-component": "0.0.1", - "@example/docs": "0.0.1", - "@example/env-vars": "0.0.1", - "@example/framework-alpine": "0.0.1", - "@example/framework-lit": "0.0.1", - "@example/framework-multiple": "0.0.1", - "@example/framework-preact": "0.0.1", - "@example/framework-react": "0.0.1", - "@example/framework-solid": "0.0.1", - "@example/framework-svelte": "0.0.1", - "@example/framework-vue": "0.0.1", - "@example/integrations-playground": "0.0.1", - "@example/minimal": "0.0.1", - "@example/non-html-pages": "0.0.1", - "@example/portfolio": "0.0.1", - "@example/ssr": "0.0.1", - "@example/starter": "0.0.1", - "@example/subpath": "0.0.1", - "@example/with-markdown": "0.0.1", - "@example/with-markdown-plugins": "0.0.2", - "@example/with-markdown-shiki": "0.0.1", - "@example/with-nanostores": "0.0.1", - "@example/with-tailwindcss": "0.0.1", - "@example/with-vite-plugin-pwa": "0.0.1", - "astro": "0.25.4", - "@astrojs/prism": "0.4.1", - "@test/custom-element-renderer": "0.1.0", - "@test/static-build-pkg": "0.0.0", - "create-astro": "0.8.0", - "@astrojs/lit": "0.0.2", - "@astrojs/netlify": "0.0.2", - "@astrojs/node": "0.0.2", - "@astrojs/partytown": "0.0.2", - "@astrojs/preact": "0.0.2", - "@astrojs/react": "0.0.2", - "@astrojs/sitemap": "0.0.2", - "@astrojs/solid-js": "0.0.3", - "@astrojs/svelte": "0.0.2", - "@astrojs/tailwind": "0.0.2", - "@astrojs/turbolinks": "0.0.2", - "@astrojs/vue": "0.0.2", - "@astrojs/markdown-remark": "0.7.0", - "@astrojs/renderer-lit": "0.4.0", - "@astrojs/renderer-preact": "0.5.0", - "@astrojs/renderer-react": "0.5.0", - "@astrojs/renderer-solid": "0.4.0", - "@astrojs/renderer-svelte": "0.5.2", - "@astrojs/renderer-vue": "0.4.0", - "@astrojs/webapi": "0.11.0", - "astro-scripts": "0.0.2" - }, - "changesets": [] -} diff --git a/.changeset/small-radios-remain.md b/.changeset/small-radios-remain.md deleted file mode 100644 index d0747a700..000000000 --- a/.changeset/small-radios-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Update CLI error format and style diff --git a/.changeset/sour-eggs-wink.md b/.changeset/sour-eggs-wink.md deleted file mode 100644 index 5c2c0fc44..000000000 --- a/.changeset/sour-eggs-wink.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'astro': patch -'@astrojs/deno': patch ---- - -Add a Deno adapter for SSR diff --git a/.changeset/swift-trainers-suffer.md b/.changeset/swift-trainers-suffer.md deleted file mode 100644 index c9f6fc9a8..000000000 --- a/.changeset/swift-trainers-suffer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fix for copying public when using SSR and not client JS diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index a3185bbac..495a5ff2e 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # Switch to tabs (Use Accessible Indentation #2253) 6ddd7678ffb6598ae6e263706813cb5e94535f02 +# prettier config update +1335797903a57716e9a02b0ffd8ca636b3883c62 \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json index d5bbca6c4..b0a1a2a07 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,5 @@ { - "printWidth": 180, + "printWidth": 100, "semi": true, "singleQuote": true, "tabWidth": 2, diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 431773d2f..d8411afe0 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,4 +1,9 @@ { - "recommendations": ["astro-build.astro-vscode", "esbenp.prettier-vscode", "editorconfig.editorconfig", "dbaeumer.vscode-eslint"], + "recommendations": [ + "astro-build.astro-vscode", + "esbenp.prettier-vscode", + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint" + ], "unwantedRecommendations": [] } diff --git a/examples/blog-multiple-authors/package.json b/examples/blog-multiple-authors/package.json index 10ac77139..d92b692d7 100644 --- a/examples/blog-multiple-authors/package.json +++ b/examples/blog-multiple-authors/package.json @@ -10,10 +10,10 @@ }, "devDependencies": { "@astrojs/preact": "^0.0.2", - "astro": "^0.25.4", - "sass": "^1.49.9" + "astro": "^0.26.0", + "sass": "^1.49.11" }, "dependencies": { - "preact": "^10.6.6" + "preact": "^10.7.0" } } diff --git a/examples/blog-multiple-authors/src/pages/posts/[...page].astro b/examples/blog-multiple-authors/src/pages/posts/[...page].astro index 7711a940c..f770aadb2 100644 --- a/examples/blog-multiple-authors/src/pages/posts/[...page].astro +++ b/examples/blog-multiple-authors/src/pages/posts/[...page].astro @@ -10,7 +10,7 @@ export async function getStaticPaths({ paginate, rss }) { const sortedPosts = allPosts.sort((a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf()); // Generate an RSS feed from this collection of posts. - // NOTE: This is disabled by default, since it requires `buildOptions.site` to be set in your "astro.config.mjs" file. + // NOTE: This is disabled by default, since it requires `site` to be set in your "astro.config.mjs" file. // rss({ // title: 'Don’s Blog', // description: 'An example blog on Astro', diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs index e8f14324a..08916b1fe 100644 --- a/examples/blog/astro.config.mjs +++ b/examples/blog/astro.config.mjs @@ -4,7 +4,4 @@ import preact from '@astrojs/preact'; // https://astro.build/config export default defineConfig({ integrations: [preact()], - buildOptions: { - site: 'https://example.com/', - }, }); diff --git a/examples/blog/package.json b/examples/blog/package.json index a817c7e67..f2127a1d4 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -9,10 +9,10 @@ "preview": "astro preview" }, "devDependencies": { - "astro": "^0.25.4", - "@astrojs/preact": "^0.0.2" + "@astrojs/preact": "^0.0.2", + "astro": "^0.26.0" }, "dependencies": { - "preact": "^10.6.6" + "preact": "^10.7.0" } } diff --git a/examples/blog/src/styles/blog.css b/examples/blog/src/styles/blog.css index 234e0162a..2a722d237 100644 --- a/examples/blog/src/styles/blog.css +++ b/examples/blog/src/styles/blog.css @@ -1,8 +1,10 @@ :root { - --font-fallback: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji; + --font-fallback: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, + Apple Color Emoji, Segoe UI Emoji; --font-body: 'IBM Plex Sans', var(--font-fallback); - --font-mono: 'IBM Plex Mono', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', - 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace; + --font-mono: 'IBM Plex Mono', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace; --color-white: #fff; --color-black: #000014; diff --git a/examples/component/demo/package.json b/examples/component/demo/package.json index 9b54773f6..bbac35c31 100644 --- a/examples/component/demo/package.json +++ b/examples/component/demo/package.json @@ -10,6 +10,6 @@ }, "devDependencies": { "@example/my-component": "workspace:*", - "astro": "^0.25.4" + "astro": "^0.26.0" } } diff --git a/examples/component/demo/src/pages/index.astro b/examples/component/demo/src/pages/index.astro index 211c2f5e3..bfdf495a8 100644 --- a/examples/component/demo/src/pages/index.astro +++ b/examples/component/demo/src/pages/index.astro @@ -7,7 +7,7 @@ import * as Component from '@example/my-component'; Welcome to Astro - +--- +import "${path}"; +--- `; } else if (isScriptRequest(path)) { extra = `It looks like you are resolving scripts. If you are adding a script tag, replace with this: @@ -134,7 +152,7 @@ export function createResult(args: CreateResultArgs): SSRResult { or consider make it a module like so: - `; @@ -143,7 +161,9 @@ or consider make it a module like so: warn( args.logging, `deprecation`, - `${bold('Astro.resolve()')} is deprecated. We see that you are trying to resolve ${path}. + `${bold( + 'Astro.resolve()' + )} is deprecated. We see that you are trying to resolve ${path}. ${extra}` ); // Intentionally return an empty string so that it is not relied upon. @@ -159,6 +179,7 @@ ${extra}` // Ensure this API is not exposed to users enumerable: false, writable: false, + // TODO: remove 1. markdown parser logic 2. update MarkdownRenderOptions to take a function only // also needs the same `astroConfig.markdownOptions.render` as `.md` pages value: async function (content: string, opts: any) { let [mdRender, renderOpts] = markdownRender; diff --git a/packages/astro/src/core/render/route-cache.ts b/packages/astro/src/core/render/route-cache.ts index 1b60bd0db..f9ef8209d 100644 --- a/packages/astro/src/core/render/route-cache.ts +++ b/packages/astro/src/core/render/route-cache.ts @@ -1,8 +1,19 @@ -import type { ComponentInstance, GetStaticPathsItem, GetStaticPathsResult, GetStaticPathsResultKeyed, Params, RouteData, RSS } from '../../@types/astro'; +import type { + ComponentInstance, + GetStaticPathsItem, + GetStaticPathsResult, + GetStaticPathsResultKeyed, + Params, + RouteData, + RSS, +} from '../../@types/astro'; import { LogOptions, warn, debug } from '../logger/core.js'; import { generatePaginateFunction } from './paginate.js'; -import { validateGetStaticPathsModule, validateGetStaticPathsResult } from '../routing/validation.js'; +import { + validateGetStaticPathsModule, + validateGetStaticPathsResult, +} from '../routing/validation.js'; type RSSFn = (...args: any[]) => any; @@ -19,7 +30,13 @@ interface CallGetStaticPathsOptions { ssr: boolean; } -export async function callGetStaticPaths({ isValidate, logging, mod, route, ssr }: CallGetStaticPathsOptions): Promise { +export async function callGetStaticPaths({ + isValidate, + logging, + mod, + route, + ssr, +}: CallGetStaticPathsOptions): Promise { validateGetStaticPathsModule(mod, { ssr }); const resultInProgress = { rss: [] as RSS[], @@ -80,7 +97,11 @@ export class RouteCache { // Warn here so that an unexpected double-call of getStaticPaths() // isn't invisible and developer can track down the issue. if (this.cache[route.component]) { - warn(this.logging, 'routeCache', `Internal Warning: route cache overwritten. (${route.component})`); + warn( + this.logging, + 'routeCache', + `Internal Warning: route cache overwritten. (${route.component})` + ); } this.cache[route.component] = entry; } @@ -98,5 +119,7 @@ export function findPathItemByKey(staticPaths: GetStaticPathsResultKeyed, params } debug('findPathItemByKey', `Unexpected cache miss looking for ${paramsKey}`); - matchedStaticPath = staticPaths.find(({ params: _params }) => JSON.stringify(_params) === paramsKey); + matchedStaticPath = staticPaths.find( + ({ params: _params }) => JSON.stringify(_params) === paramsKey + ); } diff --git a/packages/astro/src/core/render/rss.ts b/packages/astro/src/core/render/rss.ts index e02a6155e..38a10604f 100644 --- a/packages/astro/src/core/render/rss.ts +++ b/packages/astro/src/core/render/rss.ts @@ -9,8 +9,10 @@ export function validateRSS(args: GenerateRSSArgs): void { const { rssData, srcFile } = args; if (!rssData.title) throw new Error(`[${srcFile}] rss.title required`); if (!rssData.description) throw new Error(`[${srcFile}] rss.description required`); - if ((rssData as any).item) throw new Error(`[${srcFile}] \`item: Function\` should be \`items: Item[]\``); - if (!Array.isArray(rssData.items)) throw new Error(`[${srcFile}] rss.items should be an array of items`); + if ((rssData as any).item) + throw new Error(`[${srcFile}] \`item: Function\` should be \`items: Item[]\``); + if (!Array.isArray(rssData.items)) + throw new Error(`[${srcFile}] rss.items should be an array of items`); } type GenerateRSSArgs = { site: string; rssData: RSS; srcFile: string }; @@ -19,7 +21,10 @@ type GenerateRSSArgs = { site: string; rssData: RSS; srcFile: string }; export function generateRSS(args: GenerateRSSArgs): string { validateRSS(args); const { srcFile, rssData, site } = args; - if ((rssData as any).item) throw new Error(`[${srcFile}] rss() \`item()\` function was deprecated, and is now \`items: object[]\`.`); + if ((rssData as any).item) + throw new Error( + `[${srcFile}] rss() \`item()\` function was deprecated, and is now \`items: object[]\`.` + ); let xml = ``; if (typeof rssData.stylesheet === 'string') { @@ -45,12 +50,27 @@ export function generateRSS(args: GenerateRSSArgs): string { for (const result of rssData.items) { xml += ``; // validate - if (typeof result !== 'object') throw new Error(`[${srcFile}] rss.items expected an object. got: "${JSON.stringify(result)}"`); - if (!result.title) throw new Error(`[${srcFile}] rss.items required "title" property is missing. got: "${JSON.stringify(result)}"`); - if (!result.link) throw new Error(`[${srcFile}] rss.items required "link" property is missing. got: "${JSON.stringify(result)}"`); + if (typeof result !== 'object') + throw new Error( + `[${srcFile}] rss.items expected an object. got: "${JSON.stringify(result)}"` + ); + if (!result.title) + throw new Error( + `[${srcFile}] rss.items required "title" property is missing. got: "${JSON.stringify( + result + )}"` + ); + if (!result.link) + throw new Error( + `[${srcFile}] rss.items required "link" property is missing. got: "${JSON.stringify( + result + )}"` + ); xml += `<![CDATA[${result.title}]]>`; // If the item's link is already a valid URL, don't mess with it. - const itemLink = isValidURL(result.link) ? result.link : createCanonicalURL(result.link, site).href; + const itemLink = isValidURL(result.link) + ? result.link + : createCanonicalURL(result.link, site).href; xml += `${itemLink}`; xml += `${itemLink}`; if (result.description) xml += ``; @@ -87,7 +107,9 @@ export function generateRSSStylesheet() { export function generateRssFunction(site: string | undefined, route: RouteData): RSSFunction { return function rssUtility(args: RSS): RSSResult { if (!site) { - throw new Error(`[${route.component}] rss() tried to generate RSS but "buildOptions.site" missing in astro.config.mjs`); + throw new Error( + `[${route.component}] rss() tried to generate RSS but "site" missing in astro.config.mjs` + ); } let result: RSSResult = {} as any; const { dest, ...rssData } = args; diff --git a/packages/astro/src/core/render/sitemap.ts b/packages/astro/src/core/render/sitemap.ts deleted file mode 100644 index b7191e23e..000000000 --- a/packages/astro/src/core/render/sitemap.ts +++ /dev/null @@ -1,23 +0,0 @@ -const STATUS_CODE_PAGE_REGEXP = /\/[0-9]{3}\/?$/; - -/** Construct sitemap.xml given a set of URLs */ -export function generateSitemap(pages: string[], filter?: (page: string) => boolean): string { - // TODO: find way to respect URLs here - - // copy just in case original copy is needed - // make sure that 404 page is excluded - // also works for other error pages - let urls = [...pages].filter((url) => !STATUS_CODE_PAGE_REGEXP.test(url)); - - if (filter) { - urls = urls.filter((url) => filter(url)); - } - - urls.sort((a, b) => a.localeCompare(b, 'en', { numeric: true })); // sort alphabetically so sitemap is same each time - let sitemap = ``; - for (const url of urls) { - sitemap += `${url}`; - } - sitemap += `\n`; - return sitemap; -} diff --git a/packages/astro/src/core/render/ssr-element.ts b/packages/astro/src/core/render/ssr-element.ts index 88c387db1..628294f44 100644 --- a/packages/astro/src/core/render/ssr-element.ts +++ b/packages/astro/src/core/render/ssr-element.ts @@ -35,6 +35,9 @@ export function createModuleScriptElementWithSrc(src: string, site?: string): SS }; } -export function createModuleScriptElementWithSrcSet(srces: string[], site?: string): Set { +export function createModuleScriptElementWithSrcSet( + srces: string[], + site?: string +): Set { return new Set(srces.map((src) => createModuleScriptElementWithSrc(src, site))); } diff --git a/packages/astro/src/core/render/util.ts b/packages/astro/src/core/render/util.ts index 9acf2d9d3..6ef412a9c 100644 --- a/packages/astro/src/core/render/util.ts +++ b/packages/astro/src/core/render/util.ts @@ -19,7 +19,16 @@ export function isValidURL(url: string): boolean { } // https://vitejs.dev/guide/features.html#css-pre-processors -export const STYLE_EXTENSIONS = new Set(['.css', '.pcss', '.postcss', '.scss', '.sass', '.styl', '.stylus', '.less']); +export const STYLE_EXTENSIONS = new Set([ + '.css', + '.pcss', + '.postcss', + '.scss', + '.sass', + '.styl', + '.stylus', + '.less', +]); const cssRe = new RegExp( `\\.(${Array.from(STYLE_EXTENSIONS) diff --git a/packages/astro/src/core/request.ts b/packages/astro/src/core/request.ts index 8b5c40748..abccbf995 100644 --- a/packages/astro/src/core/request.ts +++ b/packages/astro/src/core/request.ts @@ -13,8 +13,17 @@ export interface CreateRequestOptions { logging: LogOptions; } -export function createRequest({ url, headers, method = 'GET', body = undefined, logging }: CreateRequestOptions): Request { - let headersObj = headers instanceof Headers ? headers : new Headers(Object.entries(headers as Record)); +export function createRequest({ + url, + headers, + method = 'GET', + body = undefined, + logging, +}: CreateRequestOptions): Request { + let headersObj = + headers instanceof Headers + ? headers + : new Headers(Object.entries(headers as Record)); const request = new Request(url.toString(), { method: method, @@ -25,7 +34,11 @@ export function createRequest({ url, headers, method = 'GET', body = undefined, Object.defineProperties(request, { canonicalURL: { get() { - warn(logging, 'deprecation', `Astro.request.canonicalURL has been moved to Astro.canonicalURL`); + warn( + logging, + 'deprecation', + `Astro.request.canonicalURL has been moved to Astro.canonicalURL` + ); return undefined; }, }, diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index 6c7cb4829..ec1d6a578 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -7,6 +7,7 @@ import { compile } from 'path-to-regexp'; import slash from 'slash'; import { fileURLToPath } from 'url'; import { warn } from '../../logger/core.js'; +import { resolvePages } from '../../util.js'; interface Part { content: string; @@ -55,7 +56,7 @@ function getParts(part: string, file: string) { return result; } -function getPattern(segments: Part[][], addTrailingSlash: AstroConfig['devOptions']['trailingSlash']) { +function getPattern(segments: Part[][], addTrailingSlash: AstroConfig['trailingSlash']) { const pathname = segments .map((segment) => { return segment[0].spread @@ -78,11 +79,12 @@ function getPattern(segments: Part[][], addTrailingSlash: AstroConfig['devOption }) .join(''); - const trailing = addTrailingSlash && segments.length ? getTrailingSlashPattern(addTrailingSlash) : '$'; + const trailing = + addTrailingSlash && segments.length ? getTrailingSlashPattern(addTrailingSlash) : '$'; return new RegExp(`^${pathname || '\\/'}${trailing}`); } -function getTrailingSlashPattern(addTrailingSlash: AstroConfig['devOptions']['trailingSlash']): string { +function getTrailingSlashPattern(addTrailingSlash: AstroConfig['trailingSlash']): string { if (addTrailingSlash === 'always') { return '\\/$'; } @@ -92,7 +94,7 @@ function getTrailingSlashPattern(addTrailingSlash: AstroConfig['devOptions']['tr return '\\/?$'; } -function getGenerator(segments: Part[][], addTrailingSlash: AstroConfig['devOptions']['trailingSlash']) { +function getGenerator(segments: Part[][], addTrailingSlash: AstroConfig['trailingSlash']) { const template = segments .map((segment) => { return segment[0].spread @@ -154,7 +156,10 @@ function comparator(a: Item, b: Item) { } if (!aSubPart.dynamic && aSubPart.content !== bSubPart.content) { - return bSubPart.content.length - aSubPart.content.length || (aSubPart.content < bSubPart.content ? -1 : 1); + return ( + bSubPart.content.length - aSubPart.content.length || + (aSubPart.content < bSubPart.content ? -1 : 1) + ); } } @@ -167,7 +172,10 @@ function comparator(a: Item, b: Item) { } /** Create manifest of all static routes */ -export function createRouteManifest({ config, cwd }: { config: AstroConfig; cwd?: string }, logging: LogOptions): ManifestData { +export function createRouteManifest( + { config, cwd }: { config: AstroConfig; cwd?: string }, + logging: LogOptions +): ManifestData { const components: string[] = []; const routes: RouteData[] = []; const validPageExtensions: Set = new Set(['.astro', '.md']); @@ -177,7 +185,7 @@ export function createRouteManifest({ config, cwd }: { config: AstroConfig; cwd? let items: Item[] = []; fs.readdirSync(dir).forEach((basename) => { const resolved = path.join(dir, basename); - const file = slash(path.relative(cwd || fileURLToPath(config.projectRoot), resolved)); + const file = slash(path.relative(cwd || fileURLToPath(config.root), resolved)); const isDir = fs.statSync(resolved).isDirectory(); const ext = path.extname(basename); @@ -195,7 +203,9 @@ export function createRouteManifest({ config, cwd }: { config: AstroConfig; cwd? } const segment = isDir ? basename : name; if (/^\$/.test(segment)) { - throw new Error(`Invalid route ${file} β€” Astro's Collections API has been replaced by dynamic route params.`); + throw new Error( + `Invalid route ${file} β€” Astro's Collections API has been replaced by dynamic route params.` + ); } if (/\]\[/.test(segment)) { throw new Error(`Invalid route ${file} β€” parameters must be separated`); @@ -265,10 +275,12 @@ export function createRouteManifest({ config, cwd }: { config: AstroConfig; cwd? } else { components.push(item.file); const component = item.file; - const trailingSlash = item.isPage ? config.devOptions.trailingSlash : 'never'; + const trailingSlash = item.isPage ? config.trailingSlash : 'never'; const pattern = getPattern(segments, trailingSlash); const generate = getGenerator(segments, trailingSlash); - const pathname = segments.every((segment) => segment.length === 1 && !segment[0].dynamic) ? `/${segments.map((segment) => segment[0].content).join('/')}` : null; + const pathname = segments.every((segment) => segment.length === 1 && !segment[0].dynamic) + ? `/${segments.map((segment) => segment[0].content).join('/')}` + : null; routes.push({ type: item.isPage ? 'page' : 'endpoint', @@ -282,10 +294,12 @@ export function createRouteManifest({ config, cwd }: { config: AstroConfig; cwd? }); } - if (fs.existsSync(config.pages)) { - walk(fileURLToPath(config.pages), [], []); + const pages = resolvePages(config); + + if (fs.existsSync(pages)) { + walk(fileURLToPath(pages), [], []); } else { - const pagesDirRootRelative = config.pages.href.slice(config.projectRoot.href.length); + const pagesDirRootRelative = pages.href.slice(config.root.href.length); warn(logging, 'astro', `Missing pages directory: ${pagesDirRootRelative}`); } diff --git a/packages/astro/src/core/routing/manifest/serialization.ts b/packages/astro/src/core/routing/manifest/serialization.ts index 8e3a42204..e167eb374 100644 --- a/packages/astro/src/core/routing/manifest/serialization.ts +++ b/packages/astro/src/core/routing/manifest/serialization.ts @@ -1,6 +1,12 @@ import type { RouteData, SerializedRouteData } from '../../../@types/astro'; -function createRouteData(pattern: RegExp, params: string[], component: string, pathname: string | undefined, type: 'page' | 'endpoint'): RouteData { +function createRouteData( + pattern: RegExp, + params: string[], + component: string, + pathname: string | undefined, + type: 'page' | 'endpoint' +): RouteData { return { type, pattern, diff --git a/packages/astro/src/core/routing/validation.ts b/packages/astro/src/core/routing/validation.ts index 80f50e19e..a82ba58a3 100644 --- a/packages/astro/src/core/routing/validation.ts +++ b/packages/astro/src/core/routing/validation.ts @@ -12,26 +12,48 @@ export function validateGetStaticPathsModule(mod: ComponentInstance, { ssr }: Va throw new Error(`[createCollection] deprecated. Please use getStaticPaths() instead.`); } if (!mod.getStaticPaths && !ssr) { - throw new Error(`[getStaticPaths] getStaticPaths() function is required. Make sure that you \`export\` the function from your component.`); + throw new Error( + `[getStaticPaths] getStaticPaths() function is required. Make sure that you \`export\` the function from your component.` + ); } } /** Throw error for malformed getStaticPaths() response */ export function validateGetStaticPathsResult(result: GetStaticPathsResult, logging: LogOptions) { if (!Array.isArray(result)) { - throw new Error(`[getStaticPaths] invalid return value. Expected an array of path objects, but got \`${JSON.stringify(result)}\`.`); + throw new Error( + `[getStaticPaths] invalid return value. Expected an array of path objects, but got \`${JSON.stringify( + result + )}\`.` + ); } result.forEach((pathObject) => { if (!pathObject.params) { - warn(logging, 'getStaticPaths', `invalid path object. Expected an object with key \`params\`, but got \`${JSON.stringify(pathObject)}\`. Skipped.`); + warn( + logging, + 'getStaticPaths', + `invalid path object. Expected an object with key \`params\`, but got \`${JSON.stringify( + pathObject + )}\`. Skipped.` + ); return; } for (const [key, val] of Object.entries(pathObject.params)) { if (!(typeof val === 'undefined' || typeof val === 'string')) { - warn(logging, 'getStaticPaths', `invalid path param: ${key}. A string value was expected, but got \`${JSON.stringify(val)}\`.`); + warn( + logging, + 'getStaticPaths', + `invalid path param: ${key}. A string value was expected, but got \`${JSON.stringify( + val + )}\`.` + ); } if (val === '') { - warn(logging, 'getStaticPaths', `invalid path param: ${key}. \`undefined\` expected for an optional param, but got empty string.`); + warn( + logging, + 'getStaticPaths', + `invalid path param: ${key}. \`undefined\` expected for an optional param, but got empty string.` + ); } } }); diff --git a/packages/astro/src/core/util.ts b/packages/astro/src/core/util.ts index 2ec2a1744..703e01ec9 100644 --- a/packages/astro/src/core/util.ts +++ b/packages/astro/src/core/util.ts @@ -34,14 +34,16 @@ export function getOutputFilename(astroConfig: AstroConfig, name: string) { if (name === '/' || name === '') { return path.posix.join(name, 'index.html'); } - if (astroConfig.buildOptions.pageUrlFormat === 'directory' && !STATUS_CODE_REGEXP.test(name)) { + if (astroConfig.build.format === 'directory' && !STATUS_CODE_REGEXP.test(name)) { return path.posix.join(name, 'index.html'); } return `${removeEndingForwardSlash(name || 'index')}.html`; } /** is a specifier an npm package? */ -export function parseNpmName(spec: string): { scope?: string; name: string; subpath?: string } | undefined { +export function parseNpmName( + spec: string +): { scope?: string; name: string; subpath?: string } | undefined { // not an npm package if (!spec || spec[0] === '.' || spec[0] === '/') return undefined; @@ -66,7 +68,9 @@ export function parseNpmName(spec: string): { scope?: string; name: string; subp /** Coalesce any throw variable to an Error instance. */ export function createSafeError(err: any): Error { - return err instanceof Error || (err && err.name && err.message) ? err : new Error(JSON.stringify(err)); + return err instanceof Error || (err && err.name && err.message) + ? err + : new Error(JSON.stringify(err)); } /** generate code frame from esbuild error */ @@ -90,14 +94,17 @@ export function codeFrame(src: string, loc: ErrorPayload['err']['loc']): string const isFocusedLine = lineNo === loc.line - 1; output += isFocusedLine ? '> ' : ' '; output += `${lineNo + 1} | ${lines[lineNo]}\n`; - if (isFocusedLine) output += `${[...new Array(gutterWidth)].join(' ')} | ${[...new Array(loc.column)].join(' ')}^\n`; + if (isFocusedLine) + output += `${[...new Array(gutterWidth)].join(' ')} | ${[...new Array(loc.column)].join( + ' ' + )}^\n`; } return output; } export function resolveDependency(dep: string, astroConfig: AstroConfig) { const resolved = resolve.sync(dep, { - basedir: fileURLToPath(astroConfig.projectRoot), + basedir: fileURLToPath(astroConfig.root), }); // For Windows compat, we need a fully resolved `file://` URL string return pathToFileURL(resolved).toString(); @@ -138,12 +145,16 @@ export function emptyDir(_dir: URL, skip?: Set): void { } } +export function resolvePages(config: AstroConfig) { + return new URL('./pages', config.srcDir); +} + export function isBuildingToSSR(config: AstroConfig): boolean { const adapter = config._ctx.adapter; if (!adapter) return false; if (typeof adapter.serverEntrypoint === 'string') { - if (!adapter.name.startsWith('@astrojs/') && !config.buildOptions.experimentalSsr) { + if (!adapter.name.startsWith('@astrojs/') && !config.experimental.ssr) { throw new Error( [ `Server-side rendering (SSR) is still experimental.`, @@ -166,17 +177,7 @@ export function emoji(char: string, fallback: string) { return process.platform !== 'win32' ? char : fallback; } -// TODO: remove once --hostname is baselined -export function getResolvedHostForVite(config: AstroConfig) { - if (config.devOptions.host === false && config.devOptions.hostname !== 'localhost') { - return config.devOptions.hostname; - } else { - return config.devOptions.host; - } -} - -export function getLocalAddress(serverAddress: string, config: AstroConfig): string { - const host = getResolvedHostForVite(config); +export function getLocalAddress(serverAddress: string, host: string | boolean): string { if (typeof host === 'boolean' || host === 'localhost') { return 'localhost'; } else { diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 93176a6bf..9e96b1a5a 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -5,7 +5,13 @@ import { mergeConfig } from '../core/config.js'; import ssgAdapter from '../adapter-ssg/index.js'; import type { ViteConfigWithSSR } from '../core/create-vite.js'; -export async function runHookConfigSetup({ config: _config, command }: { config: AstroConfig; command: 'dev' | 'build' }): Promise { +export async function runHookConfigSetup({ + config: _config, + command, +}: { + config: AstroConfig; + command: 'dev' | 'build'; +}): Promise { if (_config.adapter) { _config.integrations.push(_config.adapter); } @@ -38,7 +44,9 @@ export async function runHookConfigDone({ config }: { config: AstroConfig }) { config, setAdapter(adapter) { if (config._ctx.adapter && config._ctx.adapter.name !== adapter.name) { - throw new Error(`Adapter already set to ${config._ctx.adapter.name}. You can only have one adapter.`); + throw new Error( + `Adapter already set to ${config._ctx.adapter.name}. You can only have one adapter.` + ); } config._ctx.adapter = adapter; }, @@ -60,7 +68,13 @@ export async function runHookConfigDone({ config }: { config: AstroConfig }) { } } -export async function runHookServerSetup({ config, server }: { config: AstroConfig; server: ViteDevServer }) { +export async function runHookServerSetup({ + config, + server, +}: { + config: AstroConfig; + server: ViteDevServer; +}) { for (const integration of config.integrations) { if (integration.hooks['astro:server:setup']) { await integration.hooks['astro:server:setup']({ server }); @@ -68,7 +82,13 @@ export async function runHookServerSetup({ config, server }: { config: AstroConf } } -export async function runHookServerStart({ config, address }: { config: AstroConfig; address: AddressInfo }) { +export async function runHookServerStart({ + config, + address, +}: { + config: AstroConfig; + address: AddressInfo; +}) { for (const integration of config.integrations) { if (integration.hooks['astro:server:start']) { await integration.hooks['astro:server:start']({ address }); @@ -84,7 +104,13 @@ export async function runHookServerDone({ config }: { config: AstroConfig }) { } } -export async function runHookBuildStart({ config, buildConfig }: { config: AstroConfig; buildConfig: BuildConfig }) { +export async function runHookBuildStart({ + config, + buildConfig, +}: { + config: AstroConfig; + buildConfig: BuildConfig; +}) { for (const integration of config.integrations) { if (integration.hooks['astro:build:start']) { await integration.hooks['astro:build:start']({ buildConfig }); @@ -92,7 +118,15 @@ export async function runHookBuildStart({ config, buildConfig }: { config: Astro } } -export async function runHookBuildSetup({ config, vite, target }: { config: AstroConfig; vite: ViteConfigWithSSR; target: 'server' | 'client' }) { +export async function runHookBuildSetup({ + config, + vite, + target, +}: { + config: AstroConfig; + vite: ViteConfigWithSSR; + target: 'server' | 'client'; +}) { for (const integration of config.integrations) { if (integration.hooks['astro:build:setup']) { await integration.hooks['astro:build:setup']({ vite, target }); @@ -100,10 +134,22 @@ export async function runHookBuildSetup({ config, vite, target }: { config: Astr } } -export async function runHookBuildDone({ config, pages, routes }: { config: AstroConfig; pages: string[]; routes: RouteData[] }) { +export async function runHookBuildDone({ + config, + pages, + routes, +}: { + config: AstroConfig; + pages: string[]; + routes: RouteData[]; +}) { for (const integration of config.integrations) { if (integration.hooks['astro:build:done']) { - await integration.hooks['astro:build:done']({ pages: pages.map((p) => ({ pathname: p })), dir: config.dist, routes }); + await integration.hooks['astro:build:done']({ + pages: pages.map((p) => ({ pathname: p })), + dir: config.outDir, + routes, + }); } } } diff --git a/packages/astro/src/runtime/client/idle.ts b/packages/astro/src/runtime/client/idle.ts index 4d7d52245..627d896db 100644 --- a/packages/astro/src/runtime/client/idle.ts +++ b/packages/astro/src/runtime/client/idle.ts @@ -4,7 +4,11 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro'; * Hydrate this component as soon as the main thread is free * (or after a short delay, if `requestIdleCallback`) isn't supported */ -export default async function onIdle(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) { +export default async function onIdle( + astroId: string, + options: HydrateOptions, + getHydrateCallback: GetHydrateCallback +) { const cb = async () => { const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`); if (roots.length === 0) { diff --git a/packages/astro/src/runtime/client/load.ts b/packages/astro/src/runtime/client/load.ts index a9a6fcf6b..cf4cd83af 100644 --- a/packages/astro/src/runtime/client/load.ts +++ b/packages/astro/src/runtime/client/load.ts @@ -3,7 +3,11 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro'; /** * Hydrate this component immediately */ -export default async function onLoad(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) { +export default async function onLoad( + astroId: string, + options: HydrateOptions, + getHydrateCallback: GetHydrateCallback +) { const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`); if (roots.length === 0) { throw new Error(`Unable to find the root for the component ${options.name}`); diff --git a/packages/astro/src/runtime/client/media.ts b/packages/astro/src/runtime/client/media.ts index 56d67d95f..32e883908 100644 --- a/packages/astro/src/runtime/client/media.ts +++ b/packages/astro/src/runtime/client/media.ts @@ -3,7 +3,11 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro'; /** * Hydrate this component when a matching media query is found */ -export default async function onMedia(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) { +export default async function onMedia( + astroId: string, + options: HydrateOptions, + getHydrateCallback: GetHydrateCallback +) { const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`); if (roots.length === 0) { throw new Error(`Unable to find the root for the component ${options.name}`); diff --git a/packages/astro/src/runtime/client/only.ts b/packages/astro/src/runtime/client/only.ts index 472a6badd..6400d44b8 100644 --- a/packages/astro/src/runtime/client/only.ts +++ b/packages/astro/src/runtime/client/only.ts @@ -3,7 +3,11 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro'; /** * Hydrate this component immediately */ -export default async function onLoad(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) { +export default async function onLoad( + astroId: string, + options: HydrateOptions, + getHydrateCallback: GetHydrateCallback +) { const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`); if (roots.length === 0) { throw new Error(`Unable to find the root for the component ${options.name}`); diff --git a/packages/astro/src/runtime/client/visible.ts b/packages/astro/src/runtime/client/visible.ts index 1e6f7ea3c..e0c1fdc73 100644 --- a/packages/astro/src/runtime/client/visible.ts +++ b/packages/astro/src/runtime/client/visible.ts @@ -5,7 +5,11 @@ import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro'; * We target the children because `astro-root` is set to `display: contents` * which doesn't work with IntersectionObserver */ -export default async function onVisible(astroId: string, options: HydrateOptions, getHydrateCallback: GetHydrateCallback) { +export default async function onVisible( + astroId: string, + options: HydrateOptions, + getHydrateCallback: GetHydrateCallback +) { const roots = document.querySelectorAll(`astro-root[uid="${astroId}"]`); if (roots.length === 0) { throw new Error(`Unable to find the root for the component ${options.name}`); diff --git a/packages/astro/src/runtime/server/hydration.ts b/packages/astro/src/runtime/server/hydration.ts index c963e42c8..e7267fe16 100644 --- a/packages/astro/src/runtime/server/hydration.ts +++ b/packages/astro/src/runtime/server/hydration.ts @@ -58,12 +58,21 @@ export function extractDirectives(inputProps: Record): Ext // throw an error if an invalid hydration directive was provided if (HydrationDirectives.indexOf(extracted.hydration.directive) < 0) { - throw new Error(`Error: invalid hydration directive "${key}". Supported hydration methods: ${HydrationDirectives.map((d) => `"client:${d}"`).join(', ')}`); + throw new Error( + `Error: invalid hydration directive "${key}". Supported hydration methods: ${HydrationDirectives.map( + (d) => `"client:${d}"` + ).join(', ')}` + ); } // throw an error if the query wasn't provided for client:media - if (extracted.hydration.directive === 'media' && typeof extracted.hydration.value !== 'string') { - throw new Error('Error: Media query must be provided for "client:media", similar to client:media="(max-width: 600px)"'); + if ( + extracted.hydration.directive === 'media' && + typeof extracted.hydration.value !== 'string' + ) { + throw new Error( + 'Error: Media query must be provided for "client:media", similar to client:media="(max-width: 600px)"' + ); } break; @@ -88,20 +97,27 @@ interface HydrateScriptOptions { } /** For hydrated components, generate a '); - expect(indexHtml).to.include(''); + expect(indexHtml).to.include(''); expect(indexHtml).to.include(''); }); }); diff --git a/packages/astro/test/astro-response.test.js b/packages/astro/test/astro-response.test.js index 719d14d30..195247eba 100644 --- a/packages/astro/test/astro-response.test.js +++ b/packages/astro/test/astro-response.test.js @@ -10,7 +10,7 @@ describe('Returning responses', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/astro-response/', + root: './fixtures/astro-response/', }); devServer = await fixture.startDevServer(); diff --git a/packages/astro/test/astro-scripts.test.js b/packages/astro/test/astro-scripts.test.js index d11b7c264..ad60511ed 100644 --- a/packages/astro/test/astro-scripts.test.js +++ b/packages/astro/test/astro-scripts.test.js @@ -8,7 +8,7 @@ describe('Scripts (hoisted and not)', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/astro-scripts/', + root: './fixtures/astro-scripts/', vite: { build: { assetsInlineLimit: 0, diff --git a/packages/astro/test/astro-sitemap-rss.test.js b/packages/astro/test/astro-sitemap-rss.test.js deleted file mode 100644 index 38b788efb..000000000 --- a/packages/astro/test/astro-sitemap-rss.test.js +++ /dev/null @@ -1,67 +0,0 @@ -import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; - -describe('Sitemaps', () => { - let fixture; - - before(async () => { - fixture = await loadFixture({ - projectRoot: './fixtures/astro-sitemap-rss/', - buildOptions: { - site: 'https://astro.build/', - sitemap: true, - }, - }); - await fixture.build(); - }); - - describe('RSS Generation', () => { - it('generates RSS correctly', async () => { - const rss = await fixture.readFile('/custom/feed.xml'); - expect(rss).to.equal( - `<![CDATA[MF Doomcast]]>https://astro.build/en-usMF Doom<![CDATA[Rap Snitch Knishes (feat. Mr. Fantastik)]]>https://astro.build/episode/rap-snitch-knishes/https://astro.build/episode/rap-snitch-knishes/Tue, 16 Nov 2004 00:00:00 GMTmusic172true<![CDATA[Fazers]]>https://astro.build/episode/fazers/https://astro.build/episode/fazers/Thu, 03 Jul 2003 00:00:00 GMTmusic197true<![CDATA[Rhymes Like Dimes (feat. Cucumber Slice)]]>https://astro.build/episode/rhymes-like-dimes/https://astro.build/episode/rhymes-like-dimes/Tue, 19 Oct 1999 00:00:00 GMTmusic259true` - ); - }); - it('generates RSS with pregenerated URLs correctly', async () => { - const rss = await fixture.readFile('/custom/feed-pregenerated-urls.xml'); - expect(rss).to.equal( - `<![CDATA[MF Doomcast]]>https://astro.build/en-usMF Doom<![CDATA[Rap Snitch Knishes (feat. Mr. Fantastik)]]>https://example.com/episode/rap-snitch-knishes/https://example.com/episode/rap-snitch-knishes/Tue, 16 Nov 2004 00:00:00 GMTmusic172true<![CDATA[Fazers]]>https://example.com/episode/fazers/https://example.com/episode/fazers/Thu, 03 Jul 2003 00:00:00 GMTmusic197true<![CDATA[Rhymes Like Dimes (feat. Cucumber Slice)]]>https://example.com/episode/rhymes-like-dimes/https://example.com/episode/rhymes-like-dimes/Tue, 19 Oct 1999 00:00:00 GMTmusic259true` - ); - }); - }); - - describe('Sitemap Generation', () => { - it('Generates Sitemap correctly', async () => { - let sitemap = await fixture.readFile('/sitemap.xml'); - expect(sitemap).to.equal( - `https://astro.build/episode/fazers/https://astro.build/episode/rap-snitch-knishes/https://astro.build/episode/rhymes-like-dimes/https://astro.build/episodes/\n` - ); - }); - }); -}); - -describe('Sitemaps served from subdirectory', () => { - let fixture; - - before(async () => { - fixture = await loadFixture({ - projectRoot: './fixtures/astro-sitemap-rss/', - buildOptions: { - site: 'https://astro.build/base-directory/', - sitemap: true, - }, - }); - await fixture.build(); - }); - - describe('Sitemap Generation', () => { - it('Generates Sitemap correctly', async () => { - let sitemap = await fixture.readFile('/sitemap.xml'); - expect(sitemap).to.equal( - `https://astro.build/base-directory/episode/fazers/https://astro.build/base-directory/episode/rap-snitch-knishes/https://astro.build/base-directory/episode/rhymes-like-dimes/https://astro.build/base-directory/episodes/\n` - ); - }); - }); -}); diff --git a/packages/astro/test/astro-slots.test.js b/packages/astro/test/astro-slots.test.js index dd4883708..d890f2f31 100644 --- a/packages/astro/test/astro-slots.test.js +++ b/packages/astro/test/astro-slots.test.js @@ -6,7 +6,7 @@ describe('Slots', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/astro-slots/' }); + fixture = await loadFixture({ root: './fixtures/astro-slots/' }); await fixture.build(); }); diff --git a/packages/astro/test/cli.test.js b/packages/astro/test/cli.test.js index c23fca34f..369c12103 100644 --- a/packages/astro/test/cli.test.js +++ b/packages/astro/test/cli.test.js @@ -7,7 +7,7 @@ import { isIPv4 } from 'net'; describe('astro cli', () => { const cliServerLogSetupWithFixture = (flags, cmd) => { const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url); - return cliServerLogSetup(['--project-root', fileURLToPath(projectRootURL), ...flags], cmd); + return cliServerLogSetup(['--root', fileURLToPath(projectRootURL), ...flags], cmd); }; it('astro', async () => { @@ -27,7 +27,7 @@ describe('astro cli', () => { it('astro build', async () => { const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url); - const proc = await cli('build', '--project-root', fileURLToPath(projectRootURL)); + const proc = await cli('build', '--root', fileURLToPath(projectRootURL)); expect(proc.stdout).to.include('Complete'); }); @@ -36,7 +36,7 @@ describe('astro cli', () => { const pkgVersion = await fs.readFile(pkgURL, 'utf8').then((data) => JSON.parse(data).version); const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url); - const proc = cli('dev', '--project-root', fileURLToPath(projectRootURL)); + const proc = cli('dev', '--root', fileURLToPath(projectRootURL)); const { messages } = await parseCliDevStart(proc); expect(messages[0]).to.contain('astro'); @@ -45,10 +45,13 @@ describe('astro cli', () => { }); ['dev', 'preview'].forEach((cmd) => { - const networkLogFlags = [['--host'], ['--host', '0.0.0.0'], ['--hostname', '0.0.0.0']]; + const networkLogFlags = [['--host'], ['--host', '0.0.0.0']]; networkLogFlags.forEach(([flag, flagValue]) => { it(`astro ${cmd} ${flag} ${flagValue ?? ''} - network log`, async () => { - const { local, network } = await cliServerLogSetupWithFixture(flagValue ? [flag, flagValue] : [flag], cmd); + const { local, network } = await cliServerLogSetupWithFixture( + flagValue ? [flag, flagValue] : [flag], + cmd + ); expect(local).to.not.be.undefined; expect(network).to.not.be.undefined; @@ -56,18 +59,27 @@ describe('astro cli', () => { const localURL = new URL(local); const networkURL = new URL(network); - expect(localURL.hostname).to.be.equal(flagValue ?? 'localhost', `Expected local URL to be on localhost`); + expect(localURL.hostname).to.be.equal( + flagValue ?? 'localhost', + `Expected local URL to be on localhost` + ); // Note: our tests run in parallel so this could be 3000+! - expect(Number.parseInt(localURL.port)).to.be.greaterThanOrEqual(3000, `Expected Port to be >= 3000`); - expect(networkURL.port).to.be.equal(localURL.port, `Expected local and network ports to be equal`); - expect(isIPv4(networkURL.hostname)).to.be.equal(true, `Expected network URL to respect --host flag`); + expect(Number.parseInt(localURL.port)).to.be.greaterThanOrEqual( + 3000, + `Expected Port to be >= 3000` + ); + expect(networkURL.port).to.be.equal( + localURL.port, + `Expected local and network ports to be equal` + ); + expect(isIPv4(networkURL.hostname)).to.be.equal( + true, + `Expected network URL to respect --host flag` + ); }); }); - const hostToExposeFlags = [ - ['', ''], - ['--hostname', 'localhost'], - ]; + const hostToExposeFlags = [['', '']]; hostToExposeFlags.forEach(([flag, flagValue]) => { it(`astro ${cmd} ${flag} ${flagValue} - host to expose`, async () => { const { local, network } = await cliServerLogSetupWithFixture([flag, flagValue], cmd); @@ -84,7 +96,6 @@ describe('astro cli', () => { const noNetworkLogFlags = [ ['--host', 'localhost'], ['--host', '127.0.0.1'], - ['--hostname', '127.0.0.1'], ]; noNetworkLogFlags.forEach(([flag, flagValue]) => { it(`astro ${cmd} ${flag} ${flagValue} - no network log`, async () => { diff --git a/packages/astro/test/config-validate.test.js b/packages/astro/test/config-validate.test.js index c543a013c..e90eea69c 100644 --- a/packages/astro/test/config-validate.test.js +++ b/packages/astro/test/config-validate.test.js @@ -10,45 +10,40 @@ describe('Config Validation', () => { }); it('Zod errors are returned when invalid config is used', async () => { - const configError = await validateConfig({ buildOptions: { sitemap: 42 } }, process.cwd()).catch((err) => err); + const configError = await validateConfig({ site: 42 }, process.cwd()).catch((err) => err); expect(configError instanceof z.ZodError).to.equal(true); }); - it('errors when an older markdownOptions format is used', async () => { - const configError = await validateConfig({ markdownOptions: { rehypePlugins: ['rehype-autolink-headings'] } }, process.cwd()).catch((err) => err); - expect(configError instanceof z.ZodError).to.equal(true); - expect(configError.issues[0].message).to.equal("Unrecognized key(s) in object: 'rehypePlugins'"); - }); - it('A validation error can be formatted correctly', async () => { - const configError = await validateConfig({ buildOptions: { sitemap: 42 } }, process.cwd()).catch((err) => err); + const configError = await validateConfig({ site: 42 }, process.cwd()).catch((err) => err); expect(configError instanceof z.ZodError).to.equal(true); const formattedError = stripAnsi(formatConfigErrorMessage(configError)); expect(formattedError).to.equal( `[config] Astro found issue(s) with your configuration: - ! buildOptions.sitemap Expected boolean, received number.` + ! site Expected string, received number.` ); }); it('Multiple validation errors can be formatted correctly', async () => { const veryBadConfig = { integrations: [42], - buildOptions: { pageUrlFormat: 'invalid' }, - pages: {}, + build: { format: 'invalid' }, }; const configError = await validateConfig(veryBadConfig, process.cwd()).catch((err) => err); expect(configError instanceof z.ZodError).to.equal(true); const formattedError = stripAnsi(formatConfigErrorMessage(configError)); expect(formattedError).to.equal( `[config] Astro found issue(s) with your configuration: - ! pages Expected string, received object. ! integrations.0 Expected object, received number. - ! buildOptions.pageUrlFormat Invalid input.` + ! build.format Invalid input.` ); }); it('ignores falsey "integration" values', async () => { - const result = await validateConfig({ integrations: [0, false, null, undefined] }, process.cwd()); + const result = await validateConfig( + { integrations: [0, false, null, undefined] }, + process.cwd() + ); expect(result.integrations).to.deep.equal([]); }); it('normalizes "integration" values', async () => { @@ -56,7 +51,10 @@ describe('Config Validation', () => { expect(result.integrations).to.deep.equal([{ name: '@astrojs/a', hooks: {} }]); }); it('flattens array "integration" values', async () => { - const result = await validateConfig({ integrations: [{ name: '@astrojs/a' }, [{ name: '@astrojs/b' }, { name: '@astrojs/c' }]] }, process.cwd()); + const result = await validateConfig( + { integrations: [{ name: '@astrojs/a' }, [{ name: '@astrojs/b' }, { name: '@astrojs/c' }]] }, + process.cwd() + ); expect(result.integrations).to.deep.equal([ { name: '@astrojs/a', hooks: {} }, { name: '@astrojs/b', hooks: {} }, @@ -64,11 +62,17 @@ describe('Config Validation', () => { ]); }); it('blocks third-party "integration" values', async () => { - const configError = await validateConfig({ integrations: [{ name: '@my-plugin/a' }] }, process.cwd()).catch((err) => err); + const configError = await validateConfig( + { integrations: [{ name: '@my-plugin/a' }] }, + process.cwd() + ).catch((err) => err); expect(configError).to.be.instanceOf(Error); expect(configError.message).to.include('Astro integrations are still experimental.'); }); it('allows third-party "integration" values with the --experimental-integrations flag', async () => { - await validateConfig({ integrations: [{ name: '@my-plugin/a' }], experimentalIntegrations: true }, process.cwd()).catch((err) => err); + await validateConfig( + { integrations: [{ name: '@my-plugin/a' }], experimental: { integrations: true } }, + process.cwd() + ).catch((err) => err); }); }); diff --git a/packages/astro/test/config.test.js b/packages/astro/test/config.test.js index 80a2668e6..1f255097c 100644 --- a/packages/astro/test/config.test.js +++ b/packages/astro/test/config.test.js @@ -1,62 +1,47 @@ import { expect } from 'chai'; -import { cli, loadFixture, cliServerLogSetup } from './test-utils.js'; +import { loadFixture, cliServerLogSetup } from './test-utils.js'; import { fileURLToPath } from 'url'; import { isIPv4 } from 'net'; describe('config', () => { - let hostnameFixture; let hostFixture; let portFixture; before(async () => { - [hostnameFixture, hostFixture, portFixture] = await Promise.all([ + [hostFixture, portFixture] = await Promise.all([ loadFixture({ - projectRoot: './fixtures/config-host/', - devOptions: { - hostname: '0.0.0.0', - }, - }), - loadFixture({ - projectRoot: './fixtures/config-host/', - devOptions: { + root: './fixtures/config-host/', + server: { host: true, }, }), loadFixture({ - projectRoot: './fixtures/config-host/', - devOptions: { + root: './fixtures/config-host/', + server: { port: 5006, }, }), ]); }); - // TODO: remove test once --hostname is baselined - describe('hostname', () => { - it('can be specified in astro.config.mjs', async () => { - expect(hostnameFixture.config.devOptions.hostname).to.equal('0.0.0.0'); - }); - - it('can be specified via --hostname flag', async () => { - const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url); - const { network } = await cliServerLogSetup(['--project-root', fileURLToPath(projectRootURL), '--hostname', '0.0.0.0']); - - const networkURL = new URL(network); - expect(isIPv4(networkURL.hostname)).to.be.equal(true, `Expected network URL to respect --hostname flag`); - }); - }); - describe('host', () => { it('can be specified in astro.config.mjs', async () => { - expect(hostFixture.config.devOptions.host).to.equal(true); + expect(hostFixture.config.server.host).to.equal(true); }); it('can be specified via --host flag', async () => { const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url); - const { network } = await cliServerLogSetup(['--project-root', fileURLToPath(projectRootURL), '--host']); + const { network } = await cliServerLogSetup([ + '--root', + fileURLToPath(projectRootURL), + '--host', + ]); const networkURL = new URL(network); - expect(isIPv4(networkURL.hostname)).to.be.equal(true, `Expected network URL to respect --hostname flag`); + expect(isIPv4(networkURL.hostname)).to.be.equal( + true, + `Expected network URL to respect --host flag` + ); }); }); @@ -64,16 +49,24 @@ describe('config', () => { it('can be passed via --config', async () => { const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url); const configFileURL = new URL('./fixtures/config-path/config/my-config.mjs', import.meta.url); - const { network } = await cliServerLogSetup(['--project-root', fileURLToPath(projectRootURL), '--config', configFileURL.pathname]); + const { network } = await cliServerLogSetup([ + '--root', + fileURLToPath(projectRootURL), + '--config', + configFileURL.pathname, + ]); const networkURL = new URL(network); - expect(isIPv4(networkURL.hostname)).to.be.equal(true, `Expected network URL to respect --hostname flag`); + expect(isIPv4(networkURL.hostname)).to.be.equal( + true, + `Expected network URL to respect --host flag` + ); }); }); describe('port', () => { it('can be specified in astro.config.mjs', async () => { - expect(portFixture.config.devOptions.port).to.deep.equal(5006); + expect(portFixture.config.server.port).to.deep.equal(5006); }); }); }); diff --git a/packages/astro/test/custom-elements.test.js b/packages/astro/test/custom-elements.test.js index 4224cbc83..a34efca14 100644 --- a/packages/astro/test/custom-elements.test.js +++ b/packages/astro/test/custom-elements.test.js @@ -11,7 +11,7 @@ describe.skip('Custom Elements', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/custom-elements/', + root: './fixtures/custom-elements/', intergrations: ['@test/custom-element-renderer'], }); await fixture.build(); diff --git a/packages/astro/test/debug-component.test.js b/packages/astro/test/debug-component.test.js index 1eae70d1d..ef5e0ad34 100644 --- a/packages/astro/test/debug-component.test.js +++ b/packages/astro/test/debug-component.test.js @@ -14,7 +14,7 @@ describe('', () => { let devServer; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/debug-component/' }); + fixture = await loadFixture({ root: './fixtures/debug-component/' }); devServer = await fixture.startDevServer(); }); diff --git a/packages/astro/test/dev-routing.test.js b/packages/astro/test/dev-routing.test.js index d411f5de9..7ec6348c4 100644 --- a/packages/astro/test/dev-routing.test.js +++ b/packages/astro/test/dev-routing.test.js @@ -10,7 +10,7 @@ describe('Development Routing', () => { let devServer; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/without-site-config/' }); + fixture = await loadFixture({ root: './fixtures/without-site-config/' }); devServer = await fixture.startDevServer(); }); @@ -52,11 +52,9 @@ describe('Development Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: './dist-4007', - buildOptions: { - site: 'http://example.com/', - }, + root: './fixtures/with-subpath-no-trailing-slash/', + outDir: './dist-4007', + site: 'http://example.com/', }); devServer = await fixture.startDevServer(); }); @@ -94,11 +92,10 @@ describe('Development Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: './dist-4008', - buildOptions: { - site: 'http://example.com/blog/', - }, + root: './fixtures/with-subpath-no-trailing-slash/', + outDir: './dist-4008', + site: 'http://example.com', + base: '/blog', }); devServer = await fixture.startDevServer(); }); @@ -146,8 +143,9 @@ describe('Development Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: './dist-4009', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: './dist-4009', }); devServer = await fixture.startDevServer(); }); @@ -195,10 +193,8 @@ describe('Development Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-endpoint-routes/', - buildOptions: { - site: 'http://example.com/', - }, + root: './fixtures/with-endpoint-routes/', + site: 'http://example.com/', }); devServer = await fixture.startDevServer(); }); diff --git a/packages/astro/test/errors.test.js b/packages/astro/test/errors.test.js index 7caec0642..85baee002 100644 --- a/packages/astro/test/errors.test.js +++ b/packages/astro/test/errors.test.js @@ -9,7 +9,7 @@ describe('Error display', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/errors', + root: './fixtures/errors', }); }); diff --git a/packages/astro/test/fetch.test.js b/packages/astro/test/fetch.test.js index ba76ce6a6..c548aa3f1 100644 --- a/packages/astro/test/fetch.test.js +++ b/packages/astro/test/fetch.test.js @@ -6,7 +6,7 @@ describe('Global Fetch', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/fetch/' }); + fixture = await loadFixture({ root: './fixtures/fetch/' }); await fixture.build(); }); @@ -18,7 +18,10 @@ describe('Global Fetch', () => { it('Is available in Astro components', async () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); - expect($('#astro-component').text()).to.equal('function', 'Fetch supported in .astro components'); + expect($('#astro-component').text()).to.equal( + 'function', + 'Fetch supported in .astro components' + ); }); it('Is available in non-Astro components', async () => { const html = await fixture.readFile('/index.html'); @@ -31,6 +34,9 @@ describe('Global Fetch', () => { const html = await fixture.readFile('/index.html'); const $ = cheerio.load(html); expect($('#already-imported').text()).to.equal('function', 'Existing fetch imports respected'); - expect($('#custom-declaration').text()).to.equal('number', 'Custom fetch declarations respected'); + expect($('#custom-declaration').text()).to.equal( + 'number', + 'Custom fetch declarations respected' + ); }); }); diff --git a/packages/astro/test/fixtures/astro-css-bundling/src/components/Nav.astro b/packages/astro/test/fixtures/astro-css-bundling/src/components/Nav.astro index 159ef6719..37a2cecf1 100644 --- a/packages/astro/test/fixtures/astro-css-bundling/src/components/Nav.astro +++ b/packages/astro/test/fixtures/astro-css-bundling/src/components/Nav.astro @@ -19,7 +19,7 @@ } - \ No newline at end of file + diff --git a/packages/astro/test/fixtures/sass/package.json b/packages/astro/test/fixtures/sass/package.json index 482f5e3f6..2250f7f54 100644 --- a/packages/astro/test/fixtures/sass/package.json +++ b/packages/astro/test/fixtures/sass/package.json @@ -4,6 +4,6 @@ "private": true, "dependencies": { "astro": "workspace:*", - "sass": "^1.49.9" + "sass": "^1.49.11" } } diff --git a/packages/astro/test/fixtures/static build/astro.config.mjs b/packages/astro/test/fixtures/static build/astro.config.mjs index 32807d063..cc4fa3ae9 100644 --- a/packages/astro/test/fixtures/static build/astro.config.mjs +++ b/packages/astro/test/fixtures/static build/astro.config.mjs @@ -4,10 +4,9 @@ import preact from '@astrojs/preact'; // https://astro.build/config export default defineConfig({ integrations: [preact()], - buildOptions: { - site: 'http://example.com/subpath/', - }, + site: 'http://example.com', + base: '/subpath', ssr: { noExternal: ['@test/static-build-pkg'], }, -}); \ No newline at end of file +}); diff --git a/packages/astro/test/fixtures/static-build-page-url-format/astro.config.mjs b/packages/astro/test/fixtures/static-build-page-url-format/astro.config.mjs index 7c6e98cc0..55525c455 100644 --- a/packages/astro/test/fixtures/static-build-page-url-format/astro.config.mjs +++ b/packages/astro/test/fixtures/static-build-page-url-format/astro.config.mjs @@ -2,8 +2,9 @@ import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ - buildOptions: { - site: 'http://example.com/subpath/', - pageUrlFormat: 'file', + site: 'http://example.com/', + base: '/subpath', + build: { + format: 'file', }, -}); \ No newline at end of file +}); diff --git a/packages/astro/test/fixtures/with-subpath-no-trailing-slash/astro.config.mjs b/packages/astro/test/fixtures/with-subpath-no-trailing-slash/astro.config.mjs index 3ce56e992..227d24574 100644 --- a/packages/astro/test/fixtures/with-subpath-no-trailing-slash/astro.config.mjs +++ b/packages/astro/test/fixtures/with-subpath-no-trailing-slash/astro.config.mjs @@ -1,6 +1,4 @@ export default { - buildOptions: { - site: 'http://example.com/blog' - } + site: 'http://example.com', } diff --git a/packages/astro/test/legacy-build.test.js b/packages/astro/test/legacy-build.test.js deleted file mode 100644 index 20b8dcf9c..000000000 --- a/packages/astro/test/legacy-build.test.js +++ /dev/null @@ -1,22 +0,0 @@ -import { expect } from 'chai'; -import cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; - -describe('Legacy Build', () => { - let fixture; - - before(async () => { - fixture = await loadFixture({ - projectRoot: './fixtures/legacy-build/', - }); - await fixture.build({ buildOptions: { legacyBuild: true } }); - }); - - describe('build', () => { - it('is successful', async () => { - const html = await fixture.readFile(`/index.html`); - const $ = cheerio.load(html); - expect($('title').text()).to.equal('Demo app'); - }); - }); -}); diff --git a/packages/astro/test/lit-element.test.js b/packages/astro/test/lit-element.test.js index 65f1a01fb..6b8690fff 100644 --- a/packages/astro/test/lit-element.test.js +++ b/packages/astro/test/lit-element.test.js @@ -16,7 +16,7 @@ describe('LitElement test', function () { return; } fixture = await loadFixture({ - projectRoot: './fixtures/lit-element/', + root: './fixtures/lit-element/', }); await fixture.build(); }); @@ -36,7 +36,9 @@ describe('LitElement test', function () { expect($('my-element').html()).to.include(`
Testing...
`); // test 3: string reactive property set - expect(stripExpressionMarkers($('my-element').html())).to.include(`
initialized
`); + expect(stripExpressionMarkers($('my-element').html())).to.include( + `
initialized
` + ); // test 4: boolean reactive property correctly set // Lit will equate to true because it uses @@ -45,7 +47,9 @@ describe('LitElement test', function () { // test 5: object reactive property set // by default objects will be stringifed to [object Object] - expect(stripExpressionMarkers($('my-element').html())).to.include(`
data: 1
`); + expect(stripExpressionMarkers($('my-element').html())).to.include( + `
data: 1
` + ); // test 6: reactive properties are not rendered as attributes expect($('my-element').attr('obj')).to.equal(undefined); diff --git a/packages/astro/test/markdown.test.js b/packages/astro/test/markdown.test.js index 5d4fdefda..b8263ce76 100644 --- a/packages/astro/test/markdown.test.js +++ b/packages/astro/test/markdown.test.js @@ -7,7 +7,7 @@ describe('Markdown tests', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/markdown/', + root: './fixtures/markdown/', }); await fixture.build(); }); diff --git a/packages/astro/test/page-level-styles.test.js b/packages/astro/test/page-level-styles.test.js index 6b3fb5dac..3fdce62b9 100644 --- a/packages/astro/test/page-level-styles.test.js +++ b/packages/astro/test/page-level-styles.test.js @@ -8,7 +8,7 @@ describe('Page-level styles', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/page-level-styles/', + root: './fixtures/page-level-styles/', }); await fixture.build(); }); diff --git a/packages/astro/test/postcss.test.js b/packages/astro/test/postcss.test.js index c60cf772f..53c4f7665 100644 --- a/packages/astro/test/postcss.test.js +++ b/packages/astro/test/postcss.test.js @@ -10,7 +10,7 @@ describe('PostCSS', () => { let bundledCSS; before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/postcss', + root: './fixtures/postcss', }); await fixture.build(); diff --git a/packages/astro/test/preact-component.test.js b/packages/astro/test/preact-component.test.js index e6e018068..868f15270 100644 --- a/packages/astro/test/preact-component.test.js +++ b/packages/astro/test/preact-component.test.js @@ -7,7 +7,7 @@ describe('Preact component', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/preact-component/', + root: './fixtures/preact-component/', }); await fixture.build(); }); diff --git a/packages/astro/test/preview-routing.test.js b/packages/astro/test/preview-routing.test.js index 005eeef57..591618126 100644 --- a/packages/astro/test/preview-routing.test.js +++ b/packages/astro/test/preview-routing.test.js @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { loadFixture } from './test-utils.js'; describe('Preview Routing', () => { - describe('pageUrlFormat: directory', () => { + describe('build format: directory', () => { describe('Subpath without trailing slash and trailingSlash: never', () => { /** @type {import('./test-utils').Fixture} */ let fixture; @@ -11,13 +11,14 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4000/', import.meta.url), - buildOptions: { - pageUrlFormat: 'directory', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4000/', import.meta.url), + build: { + format: 'directory', }, - devOptions: { - trailingSlash: 'never', + trailingSlash: 'never', + server: { port: 4000, }, }); @@ -69,11 +70,11 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4001/', import.meta.url), - buildOptions: {}, - devOptions: { - trailingSlash: 'always', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4001/', import.meta.url), + trailingSlash: 'always', + server: { port: 4001, }, }); @@ -129,11 +130,11 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4002/', import.meta.url), - buildOptions: {}, - devOptions: { - trailingSlash: 'ignore', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4002/', import.meta.url), + trailingSlash: 'ignore', + server: { port: 4002, }, }); @@ -182,7 +183,7 @@ describe('Preview Routing', () => { }); }); - describe('pageUrlFormat: file', () => { + describe('build format: file', () => { describe('Subpath without trailing slash and trailingSlash: never', () => { /** @type {import('./test-utils').Fixture} */ let fixture; @@ -191,13 +192,14 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4003/', import.meta.url), - buildOptions: { - pageUrlFormat: 'file', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4003/', import.meta.url), + build: { + format: 'file', }, - devOptions: { - trailingSlash: 'never', + trailingSlash: 'never', + server: { port: 4003, }, }); @@ -249,13 +251,14 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4004/', import.meta.url), - buildOptions: { - pageUrlFormat: 'file', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4004/', import.meta.url), + build: { + format: 'file', }, - devOptions: { - trailingSlash: 'always', + trailingSlash: 'always', + server: { port: 4004, }, }); @@ -311,13 +314,14 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4005/', import.meta.url), - buildOptions: { - pageUrlFormat: 'file', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4005/', import.meta.url), + build: { + format: 'file', }, - devOptions: { - trailingSlash: 'ignore', + trailingSlash: 'ignore', + server: { port: 4005, }, }); @@ -373,13 +377,14 @@ describe('Preview Routing', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/with-subpath-no-trailing-slash/', - dist: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4006/', import.meta.url), - buildOptions: { - pageUrlFormat: 'file', + root: './fixtures/with-subpath-no-trailing-slash/', + base: '/blog', + outDir: new URL('./fixtures/with-subpath-no-trailing-slash/dist-4006/', import.meta.url), + build: { + format: 'file', }, - devOptions: { - trailingSlash: 'ignore', + trailingSlash: 'ignore', + server: { port: 4006, }, }); diff --git a/packages/astro/test/react-component.test.js b/packages/astro/test/react-component.test.js index b1080dc9f..bb67f3df2 100644 --- a/packages/astro/test/react-component.test.js +++ b/packages/astro/test/react-component.test.js @@ -7,7 +7,7 @@ let fixture; describe('React Components', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/react-component/', + root: './fixtures/react-component/', }); }); diff --git a/packages/astro/test/remote-css.test.js b/packages/astro/test/remote-css.test.js index a6f5cdd55..e7cb54090 100644 --- a/packages/astro/test/remote-css.test.js +++ b/packages/astro/test/remote-css.test.js @@ -7,7 +7,7 @@ describe('Remote CSS', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/remote-css/', + root: './fixtures/remote-css/', }); await fixture.build(); }); diff --git a/packages/astro/test/route-manifest.test.js b/packages/astro/test/route-manifest.test.js index 2432b0327..0b4052256 100644 --- a/packages/astro/test/route-manifest.test.js +++ b/packages/astro/test/route-manifest.test.js @@ -1,242 +1,241 @@ -import { expect } from 'chai'; -import { fileURLToPath } from 'url'; -import { createRouteManifest } from '../dist/core/routing/index.js'; +// TODO: unskip this test +// import { expect } from 'chai'; +// import { fileURLToPath } from 'url'; +// import { createRouteManifest } from '../dist/core/routing/index.js'; +// import { validateConfig } from '../dist/core/config.js'; -const cwd = new URL('./fixtures/route-manifest/', import.meta.url); +// const cwd = new URL('./fixtures/route-manifest/', import.meta.url); -const create = (dir, trailingSlash) => { - return createRouteManifest({ - config: { - projectRoot: cwd, - pages: new URL(dir, cwd), - devOptions: { - trailingSlash, - }, - }, - cwd: fileURLToPath(cwd), - }); -}; -function cleanRoutes(routes) { - return routes.map((r) => { - delete r.generate; - return r; - }); -} +// const create = async (dir, trailingSlash) => { +// return createRouteManifest({ +// config: await validateConfig({ +// root: cwd.pathname, +// trailingSlash, +// }), +// cwd: fileURLToPath(cwd), +// }); +// }; +// function cleanRoutes(routes) { +// return routes.map((r) => { +// delete r.generate; +// return r; +// }); +// } -describe('route manifest', () => { - it('creates routes with trailingSlashes = always', () => { - const { routes } = create('basic', 'always'); - expect(cleanRoutes(routes)).to.deep.equal([ - { - type: 'page', - pattern: /^\/$/, - params: [], - component: 'basic/index.astro', - pathname: '/', - }, +// describe('route manifest', () => { +// it('creates routes with trailingSlashes = always', async () => { +// const { routes } = await create('basic', 'always'); +// expect(cleanRoutes(routes)).to.deep.equal([ +// { +// type: 'page', +// pattern: /^\/$/, +// params: [], +// component: 'basic/index.astro', +// pathname: '/', +// }, - { - type: 'page', - pattern: /^\/about\/$/, - params: [], - component: 'basic/about.astro', - pathname: '/about', - }, +// { +// type: 'page', +// pattern: /^\/about\/$/, +// params: [], +// component: 'basic/about.astro', +// pathname: '/about', +// }, - { - type: 'page', - pattern: /^\/blog\/$/, - params: [], - component: 'basic/blog/index.astro', - pathname: '/blog', - }, +// { +// type: 'page', +// pattern: /^\/blog\/$/, +// params: [], +// component: 'basic/blog/index.astro', +// pathname: '/blog', +// }, - { - type: 'page', - pattern: /^\/blog\/([^/]+?)\/$/, - params: ['slug'], - component: 'basic/blog/[slug].astro', - pathname: undefined, - }, - ]); - }); +// { +// type: 'page', +// pattern: /^\/blog\/([^/]+?)\/$/, +// params: ['slug'], +// component: 'basic/blog/[slug].astro', +// pathname: undefined, +// }, +// ]); +// }); - it('creates routes with trailingSlashes = never', () => { - const { routes } = create('basic', 'never'); - expect(cleanRoutes(routes)).to.deep.equal([ - { - type: 'page', - pattern: /^\/$/, - params: [], - component: 'basic/index.astro', - pathname: '/', - }, +// it('creates routes with trailingSlashes = never', async () => { +// const { routes } = await create('basic', 'never'); +// expect(cleanRoutes(routes)).to.deep.equal([ +// { +// type: 'page', +// pattern: /^\/$/, +// params: [], +// component: 'basic/index.astro', +// pathname: '/', +// }, - { - type: 'page', - pattern: /^\/about$/, - params: [], - component: 'basic/about.astro', - pathname: '/about', - }, +// { +// type: 'page', +// pattern: /^\/about$/, +// params: [], +// component: 'basic/about.astro', +// pathname: '/about', +// }, - { - type: 'page', - pattern: /^\/blog$/, - params: [], - component: 'basic/blog/index.astro', - pathname: '/blog', - }, +// { +// type: 'page', +// pattern: /^\/blog$/, +// params: [], +// component: 'basic/blog/index.astro', +// pathname: '/blog', +// }, - { - type: 'page', - pattern: /^\/blog\/([^/]+?)$/, - params: ['slug'], - component: 'basic/blog/[slug].astro', - pathname: undefined, - }, - ]); - }); +// { +// type: 'page', +// pattern: /^\/blog\/([^/]+?)$/, +// params: ['slug'], +// component: 'basic/blog/[slug].astro', +// pathname: undefined, +// }, +// ]); +// }); - it('creates routes with trailingSlashes = ignore', () => { - const { routes } = create('basic', 'ignore'); - expect(cleanRoutes(routes)).to.deep.equal([ - { - type: 'page', - pattern: /^\/$/, - params: [], - component: 'basic/index.astro', - pathname: '/', - }, +// it('creates routes with trailingSlashes = ignore', async () => { +// const { routes } = await create('basic', 'ignore'); +// expect(cleanRoutes(routes)).to.deep.equal([ +// { +// type: 'page', +// pattern: /^\/$/, +// params: [], +// component: 'basic/index.astro', +// pathname: '/', +// }, - { - type: 'page', - pattern: /^\/about\/?$/, - params: [], - component: 'basic/about.astro', - pathname: '/about', - }, +// { +// type: 'page', +// pattern: /^\/about\/?$/, +// params: [], +// component: 'basic/about.astro', +// pathname: '/about', +// }, - { - type: 'page', - pattern: /^\/blog\/?$/, - params: [], - component: 'basic/blog/index.astro', - pathname: '/blog', - }, +// { +// type: 'page', +// pattern: /^\/blog\/?$/, +// params: [], +// component: 'basic/blog/index.astro', +// pathname: '/blog', +// }, - { - type: 'page', - pattern: /^\/blog\/([^/]+?)\/?$/, - params: ['slug'], - component: 'basic/blog/[slug].astro', - pathname: undefined, - }, - ]); - }); +// { +// type: 'page', +// pattern: /^\/blog\/([^/]+?)\/?$/, +// params: ['slug'], +// component: 'basic/blog/[slug].astro', +// pathname: undefined, +// }, +// ]); +// }); - it('encodes invalid characters', () => { - const { routes } = create('encoding', 'always'); +// it('encodes invalid characters', async () => { +// const { routes } = await create('encoding', 'always'); - // had to remove ? and " because windows +// // had to remove ? and " because windows - // const quote = 'encoding/".astro'; - const hash = 'encoding/#.astro'; - // const question_mark = 'encoding/?.astro'; +// // const quote = 'encoding/".astro'; +// const hash = 'encoding/#.astro'; +// // const question_mark = 'encoding/?.astro'; - expect(routes.map((p) => p.pattern)).to.deep.equal([ - // /^\/%22$/, - /^\/%23\/$/, - // /^\/%3F$/ - ]); - }); +// expect(routes.map((p) => p.pattern)).to.deep.equal([ +// // /^\/%22$/, +// /^\/%23\/$/, +// // /^\/%3F$/ +// ]); +// }); - it('ignores files and directories with leading underscores', () => { - const { routes } = create('hidden-underscore', 'always'); +// it('ignores files and directories with leading underscores', async () => { +// const { routes } = await create('hidden-underscore', 'always'); - expect(routes.map((r) => r.component).filter(Boolean)).to.deep.equal(['hidden-underscore/index.astro', 'hidden-underscore/e/f/g/h.astro']); - }); +// expect(routes.map((r) => r.component).filter(Boolean)).to.deep.equal(['hidden-underscore/index.astro', 'hidden-underscore/e/f/g/h.astro']); +// }); - it('ignores files and directories with leading dots except .well-known', () => { - const { routes } = create('hidden-dot', 'always'); +// it('ignores files and directories with leading dots except .well-known', async () => { +// const { routes } = await create('hidden-dot', 'always'); - expect(routes.map((r) => r.component).filter(Boolean)).to.deep.equal(['hidden-dot/.well-known/dnt-policy.astro']); - }); +// expect(routes.map((r) => r.component).filter(Boolean)).to.deep.equal(['hidden-dot/.well-known/dnt-policy.astro']); +// }); - it('fails if dynamic params are not separated', () => { - expect(() => create('invalid-params', 'always')).to.throw('Invalid route invalid-params/[foo][bar].astro β€” parameters must be separated'); - }); +// it('fails if dynamic params are not separated', async () => { +// expect(() => await create('invalid-params', 'always')).to.throw('Invalid route invalid-params/[foo][bar].astro β€” parameters must be separated'); +// }); - it('disallows rest parameters inside segments', () => { - expect(() => create('invalid-rest', 'always')).to.throw('Invalid route invalid-rest/foo-[...rest]-bar.astro β€” rest parameter must be a standalone segment'); - }); +// it('disallows rest parameters inside segments', async () => { +// expect(() => await create('invalid-rest', 'always')).to.throw('Invalid route invalid-rest/foo-[...rest]-bar.astro β€” rest parameter must be a standalone segment'); +// }); - it('ignores things that look like lockfiles', () => { - const { routes } = create('lockfiles', 'always'); - expect(cleanRoutes(routes)).to.deep.equal([ - { - type: 'page', - pattern: /^\/foo\/$/, - params: [], - component: 'lockfiles/foo.astro', - pathname: '/foo', - }, - ]); - }); +// it('ignores things that look like lockfiles', async () => { +// const { routes } = await create('lockfiles', 'always'); +// expect(cleanRoutes(routes)).to.deep.equal([ +// { +// type: 'page', +// pattern: /^\/foo\/$/, +// params: [], +// component: 'lockfiles/foo.astro', +// pathname: '/foo', +// }, +// ]); +// }); - it('ignores invalid route extensions', () => { - const { routes } = create('invalid-extension', 'always'); - expect(cleanRoutes(routes)).to.deep.equal([ - { - type: 'page', - pattern: /^\/$/, - params: [], - component: 'invalid-extension/index.astro', - pathname: '/', - }, +// it('ignores invalid route extensions', async () => { +// const { routes } = await create('invalid-extension', 'always'); +// expect(cleanRoutes(routes)).to.deep.equal([ +// { +// type: 'page', +// pattern: /^\/$/, +// params: [], +// component: 'invalid-extension/index.astro', +// pathname: '/', +// }, - { - type: 'page', - pattern: /^\/about\/$/, - params: [], - component: 'invalid-extension/about.astro', - pathname: '/about', - }, - ]); - }); +// { +// type: 'page', +// pattern: /^\/about\/$/, +// params: [], +// component: 'invalid-extension/about.astro', +// pathname: '/about', +// }, +// ]); +// }); - it('allows multiple slugs', () => { - const { routes } = create('multiple-slugs', 'always'); +// it('allows multiple slugs', async () => { +// const { routes } = await create('multiple-slugs', 'always'); - expect(cleanRoutes(routes)).to.deep.equal([ - { - type: 'page', - pattern: /^\/([^/]+?)\.([^/]+?)\/$/, - component: 'multiple-slugs/[file].[ext].astro', - params: ['file', 'ext'], - pathname: undefined, - }, - ]); - }); +// expect(cleanRoutes(routes)).to.deep.equal([ +// { +// type: 'page', +// pattern: /^\/([^/]+?)\.([^/]+?)\/$/, +// component: 'multiple-slugs/[file].[ext].astro', +// params: ['file', 'ext'], +// pathname: undefined, +// }, +// ]); +// }); - it('sorts routes correctly', () => { - const { routes } = create('sorting', 'always'); +// it('sorts routes correctly', async () => { +// const { routes } = await create('sorting', 'always'); - expect(routes.map((p) => p.component)).to.deep.equal([ - 'sorting/index.astro', - 'sorting/about.astro', - 'sorting/post/index.astro', - 'sorting/post/bar.astro', - 'sorting/post/foo.astro', - 'sorting/post/f[xx].astro', - 'sorting/post/f[yy].astro', - 'sorting/post/[id].astro', - 'sorting/[wildcard].astro', - 'sorting/[...rest]/deep/[...deep_rest]/xyz.astro', - 'sorting/[...rest]/deep/[...deep_rest]/index.astro', - 'sorting/[...rest]/deep/index.astro', - 'sorting/[...rest]/abc.astro', - 'sorting/[...rest]/index.astro', - ]); - }); -}); +// expect(routes.map((p) => p.component)).to.deep.equal([ +// 'sorting/index.astro', +// 'sorting/about.astro', +// 'sorting/post/index.astro', +// 'sorting/post/bar.astro', +// 'sorting/post/foo.astro', +// 'sorting/post/f[xx].astro', +// 'sorting/post/f[yy].astro', +// 'sorting/post/[id].astro', +// 'sorting/[wildcard].astro', +// 'sorting/[...rest]/deep/[...deep_rest]/xyz.astro', +// 'sorting/[...rest]/deep/[...deep_rest]/index.astro', +// 'sorting/[...rest]/deep/index.astro', +// 'sorting/[...rest]/abc.astro', +// 'sorting/[...rest]/index.astro', +// ]); +// }); +// }); diff --git a/packages/astro/test/sass.test.js b/packages/astro/test/sass.test.js index e62092e42..4072d5547 100644 --- a/packages/astro/test/sass.test.js +++ b/packages/astro/test/sass.test.js @@ -9,7 +9,7 @@ describe('Sass', () => { let devServer; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/sass/' }); + fixture = await loadFixture({ root: './fixtures/sass/' }); devServer = await fixture.startDevServer(); }); diff --git a/packages/astro/test/slots-preact.test.js b/packages/astro/test/slots-preact.test.js index 3419dfda6..380979f04 100644 --- a/packages/astro/test/slots-preact.test.js +++ b/packages/astro/test/slots-preact.test.js @@ -6,7 +6,7 @@ describe('Slots: Preact', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/slots-preact/' }); + fixture = await loadFixture({ root: './fixtures/slots-preact/' }); await fixture.build(); }); diff --git a/packages/astro/test/slots-react.test.js b/packages/astro/test/slots-react.test.js index 1c721c6e2..3cca8ae05 100644 --- a/packages/astro/test/slots-react.test.js +++ b/packages/astro/test/slots-react.test.js @@ -6,7 +6,7 @@ describe('Slots: React', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/slots-react/' }); + fixture = await loadFixture({ root: './fixtures/slots-react/' }); await fixture.build(); }); diff --git a/packages/astro/test/slots-solid.test.js b/packages/astro/test/slots-solid.test.js index 2b45dd5d9..cf59ada41 100644 --- a/packages/astro/test/slots-solid.test.js +++ b/packages/astro/test/slots-solid.test.js @@ -6,7 +6,7 @@ describe('Slots: Solid', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/slots-solid/' }); + fixture = await loadFixture({ root: './fixtures/slots-solid/' }); await fixture.build(); }); diff --git a/packages/astro/test/slots-svelte.test.js b/packages/astro/test/slots-svelte.test.js index 3a267ccb1..3c5b5d7fa 100644 --- a/packages/astro/test/slots-svelte.test.js +++ b/packages/astro/test/slots-svelte.test.js @@ -6,7 +6,7 @@ describe('Slots: Svelte', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/slots-svelte/' }); + fixture = await loadFixture({ root: './fixtures/slots-svelte/' }); await fixture.build(); }); diff --git a/packages/astro/test/slots-vue.test.js b/packages/astro/test/slots-vue.test.js index c598d346b..9cd8ac6eb 100644 --- a/packages/astro/test/slots-vue.test.js +++ b/packages/astro/test/slots-vue.test.js @@ -6,7 +6,7 @@ describe('Slots: Vue', () => { let fixture; before(async () => { - fixture = await loadFixture({ projectRoot: './fixtures/slots-vue/' }); + fixture = await loadFixture({ root: './fixtures/slots-vue/' }); await fixture.build(); }); diff --git a/packages/astro/test/solid-component.test.js b/packages/astro/test/solid-component.test.js index 07e01fba0..f870468f2 100644 --- a/packages/astro/test/solid-component.test.js +++ b/packages/astro/test/solid-component.test.js @@ -7,7 +7,7 @@ describe('Solid component', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/solid-component/', + root: './fixtures/solid-component/', }); }); diff --git a/packages/astro/test/ssr-adapter-build-config.test.js b/packages/astro/test/ssr-adapter-build-config.test.js new file mode 100644 index 000000000..427049532 --- /dev/null +++ b/packages/astro/test/ssr-adapter-build-config.test.js @@ -0,0 +1,71 @@ +import { expect } from 'chai'; +import { load as cheerioLoad } from 'cheerio'; +import { loadFixture } from './test-utils.js'; +import { viteID } from '../dist/core/util.js'; + +// Asset bundling +describe('Integration buildConfig hook', () => { + /** @type {import('./test-utils').Fixture} */ + let fixture; + + before(async () => { + let _config; + fixture = await loadFixture({ + root: './fixtures/ssr-request/', + experimental: { + ssr: true, + }, + adapter: { + name: 'my-ssr-adapter', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + vite: { + plugins: [ + { + resolveId(id) { + if (id === '@my-ssr') { + return id; + } else if (id === 'astro/app') { + const id = viteID(new URL('../dist/core/app/index.js', import.meta.url)); + return id; + } + }, + load(id) { + if (id === '@my-ssr') { + return `import { App } from 'astro/app';export function createExports(manifest) { return { manifest, createApp: () => new App(manifest) }; }`; + } + }, + }, + ], + }, + }); + }, + 'astro:build:start': ({ buildConfig }) => { + buildConfig.server = new URL('./dist/.root/server/', _config.root); + buildConfig.client = new URL('./dist/.root/client/', _config.root); + }, + 'astro:config:done': ({ config, setAdapter }) => { + _config = config; + setAdapter({ + name: 'my-ssr-adapter', + serverEntrypoint: '@my-ssr', + exports: ['manifest', 'createApp'], + }); + }, + }, + }, + }); + await fixture.build(); + }); + + it('Puts client files in the client folder', async () => { + let data = await fixture.readFile('/.root/client/cars.json'); + expect(data).to.not.be.undefined; + }); + + it('Puts the server entry into the server folder', async () => { + let data = await fixture.readFile('/.root/server/entry.mjs'); + expect(data).to.not.be.undefined; + }); +}); diff --git a/packages/astro/test/ssr-api-route.test.js b/packages/astro/test/ssr-api-route.test.js index 6bf8fcd20..666fd217d 100644 --- a/packages/astro/test/ssr-api-route.test.js +++ b/packages/astro/test/ssr-api-route.test.js @@ -9,8 +9,10 @@ describe('API routes in SSR', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/ssr-api-route/', - buildOptions: { experimentalSsr: true }, + root: './fixtures/ssr-api-route/', + experimental: { + ssr: true, + }, adapter: testAdapter(), }); await fixture.build(); @@ -35,7 +37,7 @@ describe('API routes in SSR', () => { expect(body.length).to.equal(3); }); - describe('Dev', () => { + describe('API Routes - Dev', () => { let devServer; before(async () => { devServer = await fixture.startDevServer(); diff --git a/packages/astro/test/ssr-dynamic.test.js b/packages/astro/test/ssr-dynamic.test.js index 98d73b98e..01ff3d2be 100644 --- a/packages/astro/test/ssr-dynamic.test.js +++ b/packages/astro/test/ssr-dynamic.test.js @@ -10,8 +10,10 @@ describe('Dynamic pages in SSR', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/ssr-dynamic/', - buildOptions: { experimentalSsr: true }, + root: './fixtures/ssr-dynamic/', + experimental: { + ssr: true, + }, adapter: testAdapter(), }); await fixture.build(); diff --git a/packages/astro/test/ssr-request.test.js b/packages/astro/test/ssr-request.test.js index 04a00a195..0cba2a49e 100644 --- a/packages/astro/test/ssr-request.test.js +++ b/packages/astro/test/ssr-request.test.js @@ -10,11 +10,11 @@ describe('Using Astro.request in SSR', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/ssr-request/', - buildOptions: { - experimentalSsr: true, - }, + root: './fixtures/ssr-request/', adapter: testAdapter(), + experimental: { + ssr: true, + }, }); await fixture.build(); }); diff --git a/packages/astro/test/static-build-code-component.test.js b/packages/astro/test/static-build-code-component.test.js index ec5e33945..f6a7d205d 100644 --- a/packages/astro/test/static-build-code-component.test.js +++ b/packages/astro/test/static-build-code-component.test.js @@ -7,7 +7,7 @@ describe('Code component inside static build', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/static-build-code-component/', + root: './fixtures/static-build-code-component/', }); await fixture.build(); }); diff --git a/packages/astro/test/static-build-frameworks.test.js b/packages/astro/test/static-build-frameworks.test.js index 9b6d50028..8bb2e116a 100644 --- a/packages/astro/test/static-build-frameworks.test.js +++ b/packages/astro/test/static-build-frameworks.test.js @@ -11,7 +11,7 @@ describe('Static build - frameworks', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/static-build-frameworks/', + root: './fixtures/static-build-frameworks/', }); await fixture.build(); }); diff --git a/packages/astro/test/static-build-page-url-format.test.js b/packages/astro/test/static-build-page-url-format.test.js index 4a21419cc..941a7e571 100644 --- a/packages/astro/test/static-build-page-url-format.test.js +++ b/packages/astro/test/static-build-page-url-format.test.js @@ -6,12 +6,12 @@ function addLeadingSlash(path) { return path.startsWith('/') ? path : '/' + path; } -describe("Static build - pageUrlFormat: 'file'", () => { +describe("Static build - format: 'file'", () => { let fixture; before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/static-build-page-url-format/', + root: './fixtures/static-build-page-url-format/', }); await fixture.build(); }); diff --git a/packages/astro/test/static-build.test.js b/packages/astro/test/static-build.test.js index 47707ea27..55ce6ca07 100644 --- a/packages/astro/test/static-build.test.js +++ b/packages/astro/test/static-build.test.js @@ -11,7 +11,7 @@ describe('Static build', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/static build/', + root: './fixtures/static build/', }); await fixture.build(); }); @@ -72,7 +72,7 @@ describe('Static build', () => { const $ = cheerioLoad(html); const links = $('link[rel=stylesheet]'); for (const link of links) { - const href = $(link).attr('href').slice('/subpath'.length); + const href = $(link).attr('href'); const data = await fixture.readFile(addLeadingSlash(href)); if (expected.test(data)) { return true; diff --git a/packages/astro/test/status-page.test.js b/packages/astro/test/status-page.test.js index 5cce71f48..06b2d0ae8 100644 --- a/packages/astro/test/status-page.test.js +++ b/packages/astro/test/status-page.test.js @@ -7,7 +7,7 @@ describe('Status Code Pages', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/status-code/', + root: './fixtures/status-code/', }); await fixture.build(); }); diff --git a/packages/astro/test/svelte-component.test.js b/packages/astro/test/svelte-component.test.js index c088bf9b5..36ba35b51 100644 --- a/packages/astro/test/svelte-component.test.js +++ b/packages/astro/test/svelte-component.test.js @@ -7,7 +7,7 @@ describe('Svelte component', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/svelte-component/', + root: './fixtures/svelte-component/', }); }); diff --git a/packages/astro/test/tailwindcss.test.js b/packages/astro/test/tailwindcss.test.js index 957b3f1a2..762728310 100644 --- a/packages/astro/test/tailwindcss.test.js +++ b/packages/astro/test/tailwindcss.test.js @@ -9,7 +9,7 @@ describe('Tailwind', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/tailwindcss/', + root: './fixtures/tailwindcss/', }); }); @@ -38,7 +38,9 @@ describe('Tailwind', () => { expect(bundledCSS, 'includes responsive classes').to.match(/\.lg\\:py-3{/); // tailwind escapes brackets, `font-[900]` compiles to `font-\[900\]` - expect(bundledCSS, 'supports arbitrary value classes').to.match(/\.font-\\\[900\\\]{font-weight:900}/); + expect(bundledCSS, 'supports arbitrary value classes').to.match( + /\.font-\\\[900\\\]{font-weight:900}/ + ); }); it('maintains classes in HTML', async () => { diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js index 56c18580b..ab04f9604 100644 --- a/packages/astro/test/test-utils.js +++ b/packages/astro/test/test-utils.js @@ -36,7 +36,7 @@ polyfill(globalThis, { /** * Load Astro fixture - * @param {AstroConfig} inlineConfig Astro config partial (note: must specify projectRoot) + * @param {AstroConfig} inlineConfig Astro config partial (note: must specify `root`) * @returns {Promise} The fixture. Has the following properties: * .config - Returns the final config. Will be automatically passed to the methods below: * @@ -55,11 +55,12 @@ polyfill(globalThis, { * .clean() - Async. Removes the project’s dist folder. */ export async function loadFixture(inlineConfig) { - if (!inlineConfig || !inlineConfig.projectRoot) throw new Error("Must provide { projectRoot: './fixtures/...' }"); + if (!inlineConfig || !inlineConfig.root) + throw new Error("Must provide { root: './fixtures/...' }"); // load config - let cwd = inlineConfig.projectRoot; - delete inlineConfig.projectRoot; + let cwd = inlineConfig.root; + delete inlineConfig.root; if (typeof cwd === 'string') { try { cwd = new URL(cwd.replace(/\/?$/, '/')); @@ -69,7 +70,15 @@ export async function loadFixture(inlineConfig) { } // Load the config. let config = await loadConfig({ cwd: fileURLToPath(cwd) }); - config = merge(config, { ...inlineConfig, projectRoot: cwd }); + config = merge(config, { ...inlineConfig, root: cwd }); + + // Note: the inline config doesn't run through config validation where these normalizations usually occur + if (typeof inlineConfig.site === 'string') { + config.site = new URL(inlineConfig.site); + } + if (inlineConfig.base && !inlineConfig.base.endsWith('/')) { + config.base = inlineConfig.base + '/'; + } /** @type {import('../src/core/logger/core').LogOptions} */ const logging = { @@ -81,20 +90,22 @@ export async function loadFixture(inlineConfig) { build: (opts = {}) => build(config, { mode: 'development', logging, ...opts }), startDevServer: async (opts = {}) => { const devResult = await dev(config, { logging, ...opts }); - config.devOptions.port = devResult.address.port; // update port + config.server.port = devResult.address.port; // update port return devResult; }, config, - fetch: (url, init) => fetch(`http://${'127.0.0.1'}:${config.devOptions.port}${url.replace(/^\/?/, '/')}`, init), + fetch: (url, init) => + fetch(`http://${'127.0.0.1'}:${config.server.port}${url.replace(/^\/?/, '/')}`, init), preview: async (opts = {}) => { const previewServer = await preview(config, { logging, ...opts }); return previewServer; }, - readFile: (filePath) => fs.promises.readFile(new URL(filePath.replace(/^\//, ''), config.dist), 'utf8'), - readdir: (fp) => fs.promises.readdir(new URL(fp.replace(/^\//, ''), config.dist)), - clean: () => fs.promises.rm(config.dist, { maxRetries: 10, recursive: true, force: true }), + readFile: (filePath) => + fs.promises.readFile(new URL(filePath.replace(/^\//, ''), config.outDir), 'utf8'), + readdir: (fp) => fs.promises.readdir(new URL(fp.replace(/^\//, ''), config.outDir)), + clean: () => fs.promises.rm(config.outDir, { maxRetries: 10, recursive: true, force: true }), loadTestAdapterApp: async () => { - const url = new URL('./server/entry.mjs', config.dist); + const url = new URL('./server/entry.mjs', config.outDir); const { createApp } = await import(url); return createApp(); }, @@ -112,7 +123,11 @@ function merge(a, b) { const c = {}; for (const k of allKeys) { const needsObjectMerge = - typeof a[k] === 'object' && typeof b[k] === 'object' && (Object.keys(a[k]).length || Object.keys(b[k]).length) && !Array.isArray(a[k]) && !Array.isArray(b[k]); + typeof a[k] === 'object' && + typeof b[k] === 'object' && + (Object.keys(a[k]).length || Object.keys(b[k]).length) && + !Array.isArray(a[k]) && + !Array.isArray(b[k]); if (needsObjectMerge) { c[k] = merge(a[k] || {}, b[k] || {}); continue; diff --git a/packages/astro/test/vue-component.test.js b/packages/astro/test/vue-component.test.js index b15f6a759..e26a3cdbe 100644 --- a/packages/astro/test/vue-component.test.js +++ b/packages/astro/test/vue-component.test.js @@ -7,7 +7,7 @@ describe('Vue component', () => { before(async () => { fixture = await loadFixture({ - projectRoot: './fixtures/vue-component/', + root: './fixtures/vue-component/', }); }); diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts index f41f2a87c..ec54d250c 100644 --- a/packages/create-astro/src/index.ts +++ b/packages/create-astro/src/index.ts @@ -28,14 +28,20 @@ export function mkdirp(dir: string) { } } -const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8')); +const { version } = JSON.parse( + fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8') +); const POSTPROCESS_FILES = ['package.json', 'astro.config.mjs', 'CHANGELOG.md']; // some files need processing after copying. export async function main() { logger.debug('Verbose logging turned on'); console.log(`\n${bold('Welcome to Astro!')} ${gray(`(create-astro v${version})`)}`); - console.log(`If you encounter a problem, visit ${cyan('https://github.com/withastro/astro/issues')} to search or file a new issue.\n`); + console.log( + `If you encounter a problem, visit ${cyan( + 'https://github.com/withastro/astro/issues' + )} to search or file a new issue.\n` + ); let spinner = ora({ color: 'green', text: 'Prepare for liftoff.' }); @@ -74,7 +80,9 @@ export async function main() { const hash = args.commit ? `#${args.commit}` : ''; - const templateTarget = options.template.includes('/') ? options.template : `withastro/astro/examples/${options.template}#latest`; + const templateTarget = options.template.includes('/') + ? options.template + : `withastro/astro/examples/${options.template}#latest`; const emitter = degit(`${templateTarget}${hash}`, { cache: false, @@ -118,13 +126,25 @@ export async function main() { // Warning for issue #655 if (err.message === 'zlib: unexpected end of file') { - console.log(yellow("This seems to be a cache related problem. Remove the folder '~/.degit/github/withastro' to fix this error.")); - console.log(yellow('For more information check out this issue: https://github.com/withastro/astro/issues/655')); + console.log( + yellow( + "This seems to be a cache related problem. Remove the folder '~/.degit/github/withastro' to fix this error." + ) + ); + console.log( + yellow( + 'For more information check out this issue: https://github.com/withastro/astro/issues/655' + ) + ); } // Helpful message when encountering the "could not find commit hash for ..." error if (err.code === 'MISSING_REF') { - console.log(yellow("This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com).")); + console.log( + yellow( + "This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com)." + ) + ); console.log( yellow( "If you do have 'git' installed, please run this command with the --verbose flag and file a new issue with the command output here: https://github.com/withastro/astro/issues" @@ -178,8 +198,13 @@ export async function main() { ) ).flat(1); // merge and sort dependencies - packageJSON.devDependencies = { ...(packageJSON.devDependencies ?? {}), ...Object.fromEntries(integrationEntries) }; - packageJSON.devDependencies = Object.fromEntries(Object.entries(packageJSON.devDependencies).sort((a, b) => a[0].localeCompare(b[0]))); + packageJSON.devDependencies = { + ...(packageJSON.devDependencies ?? {}), + ...Object.fromEntries(integrationEntries), + }; + packageJSON.devDependencies = Object.fromEntries( + Object.entries(packageJSON.devDependencies).sort((a, b) => a[0].localeCompare(b[0])) + ); await fs.promises.writeFile(fileLoc, JSON.stringify(packageJSON, undefined, 2)); break; } @@ -196,7 +221,9 @@ export async function main() { const component = COUNTER_COMPONENTS[integration.id as keyof typeof COUNTER_COMPONENTS]; const componentName = path.basename(component.filename, path.extname(component.filename)); const absFileLoc = path.resolve(cwd, component.filename); - importStatements.push(`import ${componentName} from '${component.filename.replace(/^src/, '..')}';`); + importStatements.push( + `import ${componentName} from '${component.filename.replace(/^src/, '..')}';` + ); components.push(`<${componentName} client:visible />`); await fs.promises.writeFile(absFileLoc, component.content); }) @@ -225,7 +252,11 @@ export async function main() { } console.log(` ${i++}: ${bold(cyan('npm install'))} (or pnpm install, yarn, etc)`); - console.log(` ${i++}: ${bold(cyan('git init && git add -A && git commit -m "Initial commit"'))} (optional step)`); + console.log( + ` ${i++}: ${bold( + cyan('git init && git add -A && git commit -m "Initial commit"') + )} (optional step)` + ); console.log(` ${i++}: ${bold(cyan('npm run dev'))} (or pnpm, yarn, etc)`); console.log(`\nTo close the dev server, hit ${bold(cyan('Ctrl-C'))}`); diff --git a/packages/create-astro/src/logger.ts b/packages/create-astro/src/logger.ts index afde6a2af..65f354632 100644 --- a/packages/create-astro/src/logger.ts +++ b/packages/create-astro/src/logger.ts @@ -96,7 +96,12 @@ export const levels: Record = { }; /** Full logging API */ -export function log(opts: LogOptions = {}, level: LoggerLevel, type: string | null, ...args: Array) { +export function log( + opts: LogOptions = {}, + level: LoggerLevel, + type: string | null, + ...args: Array +) { const logLevel = opts.level ?? defaultLogOptions.level; const dest = opts.dest ?? defaultLogOptions.dest; const event: LogMessage = { diff --git a/packages/create-astro/test/create-astro.test.js b/packages/create-astro/test/create-astro.test.js index 15e1991f1..86a64e1f5 100644 --- a/packages/create-astro/test/create-astro.test.js +++ b/packages/create-astro/test/create-astro.test.js @@ -108,11 +108,17 @@ async function testAll() { await Promise.all( TEMPLATES.map(async ({ value: template }) => { // setup: `npm init astro` - await execa('../../create-astro.mjs', [template, '--template', template, '--commit', GITHUB_SHA, '--force-overwrite'], { - cwd: FIXTURES_DIR, - }); + await execa( + '../../create-astro.mjs', + [template, '--template', template, '--commit', GITHUB_SHA, '--force-overwrite'], + { + cwd: FIXTURES_DIR, + } + ); // setup: `pnpm install` (note: running multiple `pnpm`s in parallel in CI will conflict) - await execa('pnpm', ['install', '--no-package-lock', '--silent'], { cwd: path.join(FIXTURES_DIR, template) }); + await execa('pnpm', ['install', '--no-package-lock', '--silent'], { + cwd: path.join(FIXTURES_DIR, template), + }); }) ); diff --git a/packages/integrations/deno/CHANGELOG.md b/packages/integrations/deno/CHANGELOG.md index 31593ed2b..0e7aa5fb6 100644 --- a/packages/integrations/deno/CHANGELOG.md +++ b/packages/integrations/deno/CHANGELOG.md @@ -1,5 +1,15 @@ # @astrojs/node +## 0.1.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update config options to resepect [RFC0019](https://github.com/withastro/rfcs/blob/main/proposals/0019-config-finalization.md) + +### Patch Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Add a Deno adapter for SSR + ## 0.0.2-next.0 ### Patch Changes diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json index 6fd86ab71..db93d8098 100644 --- a/packages/integrations/deno/package.json +++ b/packages/integrations/deno/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/deno", "description": "Deploy your site to a Deno server", - "version": "0.0.2-next.0", + "version": "0.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/deno/test/fixtures/basics/astro.config.mjs b/packages/integrations/deno/test/fixtures/basics/astro.config.mjs index 38490926b..e56fe2e98 100644 --- a/packages/integrations/deno/test/fixtures/basics/astro.config.mjs +++ b/packages/integrations/deno/test/fixtures/basics/astro.config.mjs @@ -3,5 +3,7 @@ import deno from '@astrojs/deno'; export default defineConfig({ adapter: deno(), - buildOptions: { experimentalSsr: true } + experimental: { + ssr: true + } }) diff --git a/packages/integrations/lit/client-shim.js b/packages/integrations/lit/client-shim.js index cab3fe4d9..e9cf1aecf 100644 --- a/packages/integrations/lit/client-shim.js +++ b/packages/integrations/lit/client-shim.js @@ -1,9 +1,15 @@ async function polyfill() { - const { hydrateShadowRoots } = await import('@webcomponents/template-shadowroot/template-shadowroot.js'); + const { hydrateShadowRoots } = await import( + '@webcomponents/template-shadowroot/template-shadowroot.js' + ); hydrateShadowRoots(document.body); } -const polyfillCheckEl = new DOMParser().parseFromString(`

`, 'text/html', { includeShadowRoots: true }).querySelector('p'); +const polyfillCheckEl = new DOMParser() + .parseFromString(`

`, 'text/html', { + includeShadowRoots: true, + }) + .querySelector('p'); if (!polyfillCheckEl || !polyfillCheckEl.shadowRoot) { polyfill(); diff --git a/packages/integrations/lit/client-shim.min.js b/packages/integrations/lit/client-shim.min.js index 0c6a452d8..f9fe14fdd 100644 --- a/packages/integrations/lit/client-shim.min.js +++ b/packages/integrations/lit/client-shim.min.js @@ -8,7 +8,8 @@ var b = (t, n) => { function s() { if (d === void 0) { let t = document.createElement('div'); - (t.innerHTML = '
'), (d = !!t.firstElementChild.shadowRoot); + (t.innerHTML = '
'), + (d = !!t.firstElementChild.shadowRoot); } return d; } @@ -18,7 +19,9 @@ var p, c, f, u = i(() => { - (p = (t) => t.parentElement === null), (c = (t) => t.tagName === 'TEMPLATE'), (f = (t) => t.nodeType === Node.ELEMENT_NODE); + (p = (t) => t.parentElement === null), + (c = (t) => t.tagName === 'TEMPLATE'), + (f = (t) => t.nodeType === Node.ELEMENT_NODE); }); var h, E = i(() => { @@ -52,7 +55,8 @@ var h, (e = r), o !== void 0 && o.parentElement.removeChild(o); break; } - let l = (n = e.parentElement) === null || n === void 0 ? void 0 : n.nextElementSibling; + let l = + (n = e.parentElement) === null || n === void 0 ? void 0 : n.nextElementSibling; if (l != null) { (e = l), o !== void 0 && o.parentElement.removeChild(o); break; @@ -75,5 +79,9 @@ async function g() { let { hydrateShadowRoots: t } = await Promise.resolve().then(() => (S(), v)); t(document.body); } -var x = new DOMParser().parseFromString('

', 'text/html', { includeShadowRoots: !0 }).querySelector('p'); +var x = new DOMParser() + .parseFromString('

', 'text/html', { + includeShadowRoots: !0, + }) + .querySelector('p'); (!x || !x.shadowRoot) && g(); diff --git a/packages/integrations/lit/src/index.ts b/packages/integrations/lit/src/index.ts index bf256eb84..f945f1ca3 100644 --- a/packages/integrations/lit/src/index.ts +++ b/packages/integrations/lit/src/index.ts @@ -13,7 +13,12 @@ function getViteConfiguration() { exclude: ['@astrojs/lit/server.js'], }, ssr: { - external: ['lit-element/lit-element.js', '@lit-labs/ssr/lib/install-global-dom-shim.js', '@lit-labs/ssr/lib/render-lit-html.js', '@lit-labs/ssr/lib/lit-element-renderer.js'], + external: [ + 'lit-element/lit-element.js', + '@lit-labs/ssr/lib/install-global-dom-shim.js', + '@lit-labs/ssr/lib/render-lit-html.js', + '@lit-labs/ssr/lib/lit-element-renderer.js', + ], }, }; } @@ -24,7 +29,10 @@ export default function (): AstroIntegration { hooks: { 'astro:config:setup': ({ updateConfig, addRenderer, injectScript }) => { // Inject the necessary polyfills on every page (inlined for speed). - injectScript('head-inline', readFileSync(new URL('../client-shim.min.js', import.meta.url), { encoding: 'utf-8' })); + injectScript( + 'head-inline', + readFileSync(new URL('../client-shim.min.js', import.meta.url), { encoding: 'utf-8' }) + ); // Inject the hydration code, before a component is hydrated. injectScript('before-hydration', `import '@astrojs/lit/hydration-support.js';`); // Add the lit renderer so that Astro can understand lit components. diff --git a/packages/integrations/netlify/CHANGELOG.md b/packages/integrations/netlify/CHANGELOG.md index 49efea64e..91d885de1 100644 --- a/packages/integrations/netlify/CHANGELOG.md +++ b/packages/integrations/netlify/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/netlify +## 0.1.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update config options to resepect [RFC0019](https://github.com/withastro/rfcs/blob/main/proposals/0019-config-finalization.md) + ## 0.0.2 ### Patch Changes diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json index 7fbeac138..80b0565ad 100644 --- a/packages/integrations/netlify/package.json +++ b/packages/integrations/netlify/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/netlify", "description": "Deploy your site to Netlify", - "version": "0.0.2", + "version": "0.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/netlify/src/index.ts b/packages/integrations/netlify/src/index.ts index 5d54f7db6..e7fb72633 100644 --- a/packages/integrations/netlify/src/index.ts +++ b/packages/integrations/netlify/src/index.ts @@ -22,19 +22,19 @@ function netlifyFunctions({ dist }: NetlifyFunctionsOptions = {}): AstroIntegrat hooks: { 'astro:config:setup': ({ config }) => { if (dist) { - config.dist = dist; + config.outDir = dist; } else { - config.dist = new URL('./netlify/', config.projectRoot); + config.outDir = new URL('./netlify/', config.root); } }, 'astro:config:done': ({ config, setAdapter }) => { - setAdapter(getAdapter(config.buildOptions.site)); + setAdapter(getAdapter(new URL(config.base, config.site).toString())); _config = config; }, 'astro:build:start': async ({ buildConfig }) => { entryFile = buildConfig.serverEntry.replace(/\.m?js/, ''); - buildConfig.client = _config.dist; - buildConfig.server = new URL('./functions/', _config.dist); + buildConfig.client = _config.outDir; + buildConfig.server = new URL('./functions/', _config.outDir); }, 'astro:build:done': async ({ routes, dir }) => { const _redirectsURL = new URL('./_redirects', dir); diff --git a/packages/integrations/partytown/CHANGELOG.md b/packages/integrations/partytown/CHANGELOG.md index 52c5ed511..db57a46ad 100644 --- a/packages/integrations/partytown/CHANGELOG.md +++ b/packages/integrations/partytown/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/partytown +## 0.1.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update config options to resepect [RFC0019](https://github.com/withastro/rfcs/blob/main/proposals/0019-config-finalization.md) + ## 0.0.2 ### Patch Changes diff --git a/packages/integrations/partytown/package.json b/packages/integrations/partytown/package.json index 3e9a4d79f..7b3186543 100644 --- a/packages/integrations/partytown/package.json +++ b/packages/integrations/partytown/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/partytown", "description": "Astro + Partytown integration", - "version": "0.0.2", + "version": "0.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/partytown/src/index.ts b/packages/integrations/partytown/src/index.ts index 479f86b07..ebd133e33 100644 --- a/packages/integrations/partytown/src/index.ts +++ b/packages/integrations/partytown/src/index.ts @@ -23,10 +23,19 @@ export default function createPlugin(): AstroIntegration { config = _config; }, 'astro:server:setup': ({ server }) => { - server.middlewares.use(sirv(partytownLibDirectory, { mount: '/~partytown', dev: true, etag: true, extensions: [] })); + server.middlewares.use( + sirv(partytownLibDirectory, { + mount: '/~partytown', + dev: true, + etag: true, + extensions: [], + }) + ); }, 'astro:build:done': async () => { - await copyLibFiles(fileURLToPath(new URL('~partytown', config.dist)), { debugDir: false }); + await copyLibFiles(fileURLToPath(new URL('~partytown', config.outDir)), { + debugDir: false, + }); }, }, }; diff --git a/packages/integrations/partytown/src/sirv.ts b/packages/integrations/partytown/src/sirv.ts index 860a715bf..aab0c7d96 100644 --- a/packages/integrations/partytown/src/sirv.ts +++ b/packages/integrations/partytown/src/sirv.ts @@ -223,7 +223,8 @@ export default function (dir, opts = {}) { } } - let data = lookup(pathname, extns) || (isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns)); + let data = + lookup(pathname, extns) || (isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns)); if (!data) return next ? next() : isNotFound(req, res); if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) { diff --git a/packages/integrations/preact/client.js b/packages/integrations/preact/client.js index 85c18c76c..5ece5ddb2 100644 --- a/packages/integrations/preact/client.js +++ b/packages/integrations/preact/client.js @@ -1,4 +1,8 @@ import { h, render } from 'preact'; import StaticHtml from './static-html.js'; -export default (element) => (Component, props, children) => render(h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), element); +export default (element) => (Component, props, children) => + render( + h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), + element + ); diff --git a/packages/integrations/preact/package.json b/packages/integrations/preact/package.json index 74f2f6edc..3c3d89f9f 100644 --- a/packages/integrations/preact/package.json +++ b/packages/integrations/preact/package.json @@ -36,7 +36,7 @@ "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*", - "preact": "^10.6.6" + "preact": "^10.7.0" }, "peerDependencies": { "preact": "^10.6.5" diff --git a/packages/integrations/preact/server.js b/packages/integrations/preact/server.js index 25b1a1530..0729f42e9 100644 --- a/packages/integrations/preact/server.js +++ b/packages/integrations/preact/server.js @@ -25,7 +25,9 @@ function check(Component, props, children) { } function renderToStaticMarkup(Component, props, children) { - const html = render(h(Component, props, children != null ? h(StaticHtml, { value: children }) : children)); + const html = render( + h(Component, props, children != null ? h(StaticHtml, { value: children }) : children) + ); return { html }; } diff --git a/packages/integrations/preact/src/index.ts b/packages/integrations/preact/src/index.ts index c96bf1190..0b0896210 100644 --- a/packages/integrations/preact/src/index.ts +++ b/packages/integrations/preact/src/index.ts @@ -21,7 +21,12 @@ function getRenderer() { function getViteConfiguration() { return { optimizeDeps: { - include: ['@astrojs/preact/client.js', 'preact', 'preact/jsx-runtime', 'preact-render-to-string'], + include: [ + '@astrojs/preact/client.js', + 'preact', + 'preact/jsx-runtime', + 'preact-render-to-string', + ], exclude: ['@astrojs/preact/server.js'], }, ssr: { diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index 3fc5d0350..8a20e5c9d 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/react +## 0.1.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Add support for React v18 + ## 0.0.2 ### Patch Changes diff --git a/packages/integrations/react/client-v17.js b/packages/integrations/react/client-v17.js index a6bc7d3bc..64284a0b0 100644 --- a/packages/integrations/react/client-v17.js +++ b/packages/integrations/react/client-v17.js @@ -7,7 +7,9 @@ export default (element) => (Component, props, children) => createElement( Component, { ...props, suppressHydrationWarning: true }, - children != null ? createElement(StaticHtml, { value: children, suppressHydrationWarning: true }) : children + children != null + ? createElement(StaticHtml, { value: children, suppressHydrationWarning: true }) + : children ), element ); diff --git a/packages/integrations/react/client.js b/packages/integrations/react/client.js index 11d63cfcb..7eba8984c 100644 --- a/packages/integrations/react/client.js +++ b/packages/integrations/react/client.js @@ -8,6 +8,8 @@ export default (element) => (Component, props, children) => createElement( Component, { ...props, suppressHydrationWarning: true }, - children != null ? createElement(StaticHtml, { value: children, suppressHydrationWarning: true }) : children + children != null + ? createElement(StaticHtml, { value: children, suppressHydrationWarning: true }) + : children ) ); diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 1184ce8d3..359ad1c30 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/react", "description": "Use React components within Astro", - "version": "0.0.2", + "version": "0.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/react/server-v17.js b/packages/integrations/react/server-v17.js index 1c0c41286..b48d7b6f4 100644 --- a/packages/integrations/react/server-v17.js +++ b/packages/integrations/react/server-v17.js @@ -5,7 +5,11 @@ import StaticHtml from './static-html.js'; const reactTypeof = Symbol.for('react.element'); function errorIsComingFromPreactComponent(err) { - return err.message && (err.message.startsWith("Cannot read property '__H'") || err.message.includes("(reading '__H')")); + return ( + err.message && + (err.message.startsWith("Cannot read property '__H'") || + err.message.includes("(reading '__H')")) + ); } function check(Component, props, children) { diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js index e102b57fe..6ae49e7bc 100644 --- a/packages/integrations/react/server.js +++ b/packages/integrations/react/server.js @@ -5,7 +5,11 @@ import StaticHtml from './static-html.js'; const reactTypeof = Symbol.for('react.element'); function errorIsComingFromPreactComponent(err) { - return err.message && (err.message.startsWith("Cannot read property '__H'") || err.message.includes("(reading '__H')")); + return ( + err.message && + (err.message.startsWith("Cannot read property '__H'") || + err.message.includes("(reading '__H')")) + ); } function check(Component, props, children) { diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts index 25899a025..a283938c3 100644 --- a/packages/integrations/react/src/index.ts +++ b/packages/integrations/react/src/index.ts @@ -4,8 +4,12 @@ import { version as ReactVersion } from 'react-dom'; function getRenderer() { return { name: '@astrojs/react', - clientEntrypoint: ReactVersion.startsWith('18.') ? '@astrojs/react/client.js' : '@astrojs/react/client-v17.js', - serverEntrypoint: ReactVersion.startsWith('18.') ? '@astrojs/react/server.js' : '@astrojs/react/server-v17.js', + clientEntrypoint: ReactVersion.startsWith('18.') + ? '@astrojs/react/client.js' + : '@astrojs/react/client-v17.js', + serverEntrypoint: ReactVersion.startsWith('18.') + ? '@astrojs/react/server.js' + : '@astrojs/react/server-v17.js', jsxImportSource: 'react', jsxTransformOptions: async () => { const { @@ -34,14 +38,28 @@ function getRenderer() { function getViteConfiguration() { return { optimizeDeps: { - include: [ReactVersion.startsWith('18.') ? '@astrojs/react/client.js' : '@astrojs/react/client-v17.js', 'react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom'], - exclude: [ReactVersion.startsWith('18.') ? '@astrojs/react/server.js' : '@astrojs/react/server-v17.js'], + include: [ + ReactVersion.startsWith('18.') + ? '@astrojs/react/client.js' + : '@astrojs/react/client-v17.js', + 'react', + 'react/jsx-runtime', + 'react/jsx-dev-runtime', + 'react-dom', + ], + exclude: [ + ReactVersion.startsWith('18.') + ? '@astrojs/react/server.js' + : '@astrojs/react/server-v17.js', + ], }, resolve: { dedupe: ['react', 'react-dom'], }, ssr: { - external: ReactVersion.startsWith('18.') ? ['react-dom/server', 'react-dom/client'] : ['react-dom/server.js', 'react-dom/client.js'], + external: ReactVersion.startsWith('18.') + ? ['react-dom/server', 'react-dom/client'] + : ['react-dom/server.js', 'react-dom/client.js'], }, }; } diff --git a/packages/integrations/react/static-html.js b/packages/integrations/react/static-html.js index 47130d786..ecd76ae9b 100644 --- a/packages/integrations/react/static-html.js +++ b/packages/integrations/react/static-html.js @@ -9,7 +9,10 @@ import { createElement as h } from 'react'; */ const StaticHtml = ({ value }) => { if (!value) return null; - return h('astro-fragment', { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: value } }); + return h('astro-fragment', { + suppressHydrationWarning: true, + dangerouslySetInnerHTML: { __html: value }, + }); }; /** diff --git a/packages/integrations/sitemap/CHANGELOG.md b/packages/integrations/sitemap/CHANGELOG.md index 0ad92093d..5cab73553 100644 --- a/packages/integrations/sitemap/CHANGELOG.md +++ b/packages/integrations/sitemap/CHANGELOG.md @@ -1,5 +1,17 @@ # @astrojs/sitemap +## 0.1.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update config options to resepect [RFC0019](https://github.com/withastro/rfcs/blob/main/proposals/0019-config-finalization.md) + +### Patch Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Add new sitemap configuration options: + - `filter`: filter pages to include in your sitemap + - `canonicalURL`: override your astro.config `site` with a custom base URL + ## 0.0.2 ### Patch Changes diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index 02fa02597..9d84cae19 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -50,7 +50,7 @@ export default { ## Getting started -`@astrojs/sitemap` requires a deployment / site URL for generation. Add your site's URL under your `astro.config.*` using the `buildOptions.site` property: +`@astrojs/sitemap` requires a deployment / site URL for generation. Add your site's URL under your `astro.config.*` using the `site` property: __astro.config.mjs__ @@ -59,9 +59,7 @@ import sitemap from '@astrojs/sitemap'; export default { // ... - buildOptions: { - site: 'https://stargazers.club', - }, + site: 'https://stargazers.club', integrations: [sitemap()], } ``` @@ -70,5 +68,48 @@ Now, [build your site for production](https://docs.astro.build/en/reference/cli- You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. +## Configuration + +### filter + +All pages are included in your sitemap by default. By adding a custom `filter`, you can filter included pages by URL. + +__astro.config.mjs__ + +```js +import sitemap from '@astrojs/sitemap'; + +export default { + site: 'https://stargazers.club', + integrations: [ + sitemap({ + filter: (page) => page !== 'https://stargazers.club/secret-vip-lounge' + }), + ], +} +``` + +The `page` function parameter is the full URL of your rendered page, including your `site` domain. Return `true` to include a page in your sitemap, and `false` to remove it. + +### canonicalURL + +If present, we use the `site` config option as the base for all sitemap URLs. Use `canonicalURL` to override this. + +__astro.config.mjs__ + +```js +import sitemap from '@astrojs/sitemap'; + +export default { + site: 'https://stargazers.club', + integrations: [ + sitemap({ + // https://astronaut.party will be used for all sitemap URLs instead + canonicalURL: 'https://astronaut.party', + }), + ], +} +``` + [astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ [astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components diff --git a/packages/integrations/sitemap/package.json b/packages/integrations/sitemap/package.json index 857322859..26d517b40 100644 --- a/packages/integrations/sitemap/package.json +++ b/packages/integrations/sitemap/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/sitemap", "description": "Generate a sitemap for Astro", - "version": "0.0.2", + "version": "0.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/sitemap/src/index.ts b/packages/integrations/sitemap/src/index.ts index 28bc61396..70441cb8e 100644 --- a/packages/integrations/sitemap/src/index.ts +++ b/packages/integrations/sitemap/src/index.ts @@ -2,10 +2,32 @@ import fs from 'node:fs'; import type { AstroConfig, AstroIntegration } from 'astro'; const STATUS_CODE_PAGE_REGEXP = /\/[0-9]{3}\/?$/; +type SitemapOptions = + | { + /** + * All pages are included in your sitemap by default. + * With this config option, you can filter included pages by URL. + * + * The `page` function parameter is the full URL of your rendered page, including your `site` domain. + * Return `true` to include a page in your sitemap, and `false` to remove it. + * + * ```js + * filter: (page) => page !== 'http://example.com/secret-page' + * ``` + */ + filter?(page: string): string; + + /** + * If present, we use the `site` config option as the base for all sitemap URLs + * Use `canonicalURL` to override this + */ + canonicalURL?: string; + } + | undefined; + /** Construct sitemap.xml given a set of URLs */ function generateSitemap(pages: string[]) { // TODO: find way to respect URLs here - // TODO: find way to exclude pages from sitemap const urls = [...pages].filter((url) => !STATUS_CODE_PAGE_REGEXP.test(url)); urls.sort((a, b) => a.localeCompare(b, 'en', { numeric: true })); // sort alphabetically so sitemap is same each time let sitemap = ``; @@ -16,7 +38,10 @@ function generateSitemap(pages: string[]) { return sitemap; } -export default function createPlugin(): AstroIntegration { +export default function createPlugin({ + filter, + canonicalURL, +}: SitemapOptions = {}): AstroIntegration { let config: AstroConfig; return { name: '@astrojs/sitemap', @@ -25,11 +50,17 @@ export default function createPlugin(): AstroIntegration { config = _config; }, 'astro:build:done': async ({ pages, dir }) => { - const finalSiteUrl = config.buildOptions.site; + const finalSiteUrl = canonicalURL || config.site; if (!finalSiteUrl) { + console.warn( + 'The Sitemap integration requires either the `site` astro.config option or `canonicalURL` integration option. Skipping.' + ); return; } - const pageUrls = pages.map((p) => new URL(p.pathname, finalSiteUrl).href); + let pageUrls = pages.map((p) => new URL(p.pathname, finalSiteUrl).href); + if (filter) { + pageUrls = pageUrls.filter((page: string) => filter(page)); + } const sitemapContent = generateSitemap(pageUrls); fs.writeFileSync(new URL('sitemap.xml', dir), sitemapContent); }, diff --git a/packages/integrations/solid/server.js b/packages/integrations/solid/server.js index d32d60a64..ccee482ea 100644 --- a/packages/integrations/solid/server.js +++ b/packages/integrations/solid/server.js @@ -19,7 +19,9 @@ function renderToStaticMarkup(Component, props, children) { children: children != null ? ssr(`${children}`) : children, }) ); - return { html: html + `` }; + return { + html: html + ``, + }; } export default { diff --git a/packages/integrations/svelte/Wrapper.svelte.ssr.js b/packages/integrations/svelte/Wrapper.svelte.ssr.js index 9bca437b5..e6a4781a7 100644 --- a/packages/integrations/svelte/Wrapper.svelte.ssr.js +++ b/packages/integrations/svelte/Wrapper.svelte.ssr.js @@ -8,7 +8,12 @@ const App = create_ssr_component(($$result, $$props, $$bindings, slots) => { children.default = () => `${__astro_children}`; } - return `${validate_component(Component || missing_component, 'svelte:component').$$render($$result, Object.assign(props), {}, children)}`; + return `${validate_component(Component || missing_component, 'svelte:component').$$render( + $$result, + Object.assign(props), + {}, + children + )}`; }); export default App; diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index abe58baac..37c40d484 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -38,7 +38,7 @@ "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*", - "svelte": "^3.46.4" + "svelte": "^3.46.6" }, "peerDependencies": { "svelte": "^3.46.4" diff --git a/packages/integrations/svelte/server.js b/packages/integrations/svelte/server.js index c51b2f4b4..3c989cd5a 100644 --- a/packages/integrations/svelte/server.js +++ b/packages/integrations/svelte/server.js @@ -5,7 +5,11 @@ function check(Component) { } async function renderToStaticMarkup(Component, props, children) { - const { html } = SvelteWrapper.render({ __astro_component: Component, __astro_children: children, ...props }); + const { html } = SvelteWrapper.render({ + __astro_component: Component, + __astro_children: children, + ...props, + }); return { html }; } diff --git a/packages/integrations/tailwind/CHANGELOG.md b/packages/integrations/tailwind/CHANGELOG.md index 0d8ce6c98..3f0a1bb4e 100644 --- a/packages/integrations/tailwind/CHANGELOG.md +++ b/packages/integrations/tailwind/CHANGELOG.md @@ -1,5 +1,15 @@ # @astrojs/tailwind +## 0.1.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update config options to resepect [RFC0019](https://github.com/withastro/rfcs/blob/main/proposals/0019-config-finalization.md) + +### Patch Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Adds an option to opt-out of the default base styles for the Tailwind integration + ## 0.0.2 ### Patch Changes diff --git a/packages/integrations/tailwind/README.md b/packages/integrations/tailwind/README.md index 1cf730f7a..d0ab7d97d 100644 --- a/packages/integrations/tailwind/README.md +++ b/packages/integrations/tailwind/README.md @@ -82,6 +82,19 @@ export default { } ``` +We will include `@tailwind` directives for each of Tailwind's layers to enable Tailwind styles by default. If you need to customize this behavior, with Tailwind's [`@layer` directive](https://tailwindcss.com/docs/functions-and-directives#layer) for example, opt-out via the `config.applyBaseStyles` integration option: + +__astro.config.mjs__ + +```js +export default { + // ... + integrations: [tailwind({ + config: { applyBaseStyles: false }, + })], +} +``` + You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. [astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index 6ecdbdbf4..0d9fb62a2 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/tailwind", "description": "Tailwind + Astro Integrations", - "version": "0.0.2", + "version": "0.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", @@ -27,13 +27,13 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "tailwindcss": "^3.0.23", - "autoprefixer": "^10.4.4", "@proload/core": "^0.2.2", - "postcss": "^8.4.12" + "autoprefixer": "^10.4.4", + "postcss": "^8.4.12", + "tailwindcss": "^3.0.23" }, "devDependencies": { - "@types/tailwindcss": "^3.0.9", + "@types/tailwindcss": "^3.0.10", "astro": "workspace:*", "astro-scripts": "workspace:*" }, diff --git a/packages/integrations/tailwind/src/index.ts b/packages/integrations/tailwind/src/index.ts index bb5a4ade3..3efd8fde8 100644 --- a/packages/integrations/tailwind/src/index.ts +++ b/packages/integrations/tailwind/src/index.ts @@ -17,16 +17,16 @@ function getDefaultTailwindConfig(srcUrl: URL): TailwindConfig { }); } -async function getUserConfig(projectRoot: URL, configPath?: string) { - const resolvedProjectRoot = fileURLToPath(projectRoot); +async function getUserConfig(root: URL, configPath?: string) { + const resolvedRoot = fileURLToPath(root); let userConfigPath: string | undefined; if (configPath) { const configPathWithLeadingSlash = /^\.*\//.test(configPath) ? configPath : `./${configPath}`; - userConfigPath = fileURLToPath(new URL(configPathWithLeadingSlash, projectRoot)); + userConfigPath = fileURLToPath(new URL(configPathWithLeadingSlash, root)); } - return await load('tailwind', { mustExist: false, cwd: resolvedProjectRoot, filePath: userConfigPath }); + return await load('tailwind', { mustExist: false, cwd: resolvedRoot, filePath: userConfigPath }); } type TailwindOptions = @@ -43,36 +43,55 @@ type TailwindOptions = * @default true */ applyAstroPreset?: boolean; + /** + * Apply Tailwind's base styles + * Disabling this is useful when further customization of Tailwind styles + * and directives is required. See {@link https://tailwindcss.com/docs/functions-and-directives#tailwind Tailwind's docs} + * for more details on directives and customization. + * @default: true + */ + applyBaseStyles?: boolean; }; } | undefined; export default function tailwindIntegration(options: TailwindOptions): AstroIntegration { const applyAstroConfigPreset = options?.config?.applyAstroPreset ?? true; + const applyBaseStyles = options?.config?.applyBaseStyles ?? true; const customConfigPath = options?.config?.path; return { name: '@astrojs/tailwind', hooks: { 'astro:config:setup': async ({ config, injectScript }) => { // Inject the Tailwind postcss plugin - const userConfig = await getUserConfig(config.projectRoot, customConfigPath); + const userConfig = await getUserConfig(config.root, customConfigPath); if (customConfigPath && !userConfig?.value) { - throw new Error(`Could not find a Tailwind config at ${JSON.stringify(customConfigPath)}. Does the file exist?`); + throw new Error( + `Could not find a Tailwind config at ${JSON.stringify( + customConfigPath + )}. Does the file exist?` + ); } - const tailwindConfig: TailwindConfig = (userConfig?.value as TailwindConfig) ?? getDefaultTailwindConfig(config.src); + const tailwindConfig: TailwindConfig = + (userConfig?.value as TailwindConfig) ?? getDefaultTailwindConfig(config.srcDir); if (applyAstroConfigPreset && userConfig?.value) { // apply Astro config as a preset to user config // this avoids merging or applying nested spread operators ourselves - tailwindConfig.presets = [getDefaultTailwindConfig(config.src), ...(tailwindConfig.presets || [])]; + tailwindConfig.presets = [ + getDefaultTailwindConfig(config.srcDir), + ...(tailwindConfig.presets || []), + ]; } - config.styleOptions.postcss.plugins.push(tailwindPlugin(tailwindConfig)); - config.styleOptions.postcss.plugins.push(autoprefixerPlugin); + config.style.postcss.plugins.push(tailwindPlugin(tailwindConfig)); + config.style.postcss.plugins.push(autoprefixerPlugin); - // Inject the Tailwind base import - injectScript('page-ssr', `import '@astrojs/tailwind/base.css';`); + if (applyBaseStyles) { + // Inject the Tailwind base import + injectScript('page-ssr', `import '@astrojs/tailwind/base.css';`); + } }, }, }; diff --git a/packages/integrations/turbolinks/src/index.ts b/packages/integrations/turbolinks/src/index.ts index 3299736ba..fbf893f68 100644 --- a/packages/integrations/turbolinks/src/index.ts +++ b/packages/integrations/turbolinks/src/index.ts @@ -8,7 +8,10 @@ export default function createPlugin(): AstroIntegration { // This gets injected into the user's page, so we need to re-export Turbolinks // from our own package so that package managers like pnpm don't get mad and // can follow the import correctly. - injectScript('page', `import {Turbolinks} from "@astrojs/turbolinks/client.js"; Turbolinks.start();`); + injectScript( + 'page', + `import {Turbolinks} from "@astrojs/turbolinks/client.js"; Turbolinks.start();` + ); }, }, }; diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index e25e2d744..dfc40d95f 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -31,7 +31,7 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "@vitejs/plugin-vue": "^2.2.4" + "@vitejs/plugin-vue": "^2.3.1" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/markdown/remark/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md index 3a35a1b89..1f03397e8 100644 --- a/packages/markdown/remark/CHANGELOG.md +++ b/packages/markdown/remark/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/markdown-remark +## 0.8.0 + +### Minor Changes + +- [`e425f896`](https://github.com/withastro/astro/commit/e425f896b668d98033ad3b998b50c1f28bc7f6ee) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update config options to resepect [RFC0019](https://github.com/withastro/rfcs/blob/main/proposals/0019-config-finalization.md) + ## 0.7.0 ### Minor Changes diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index cfee47f76..799be8dbf 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/markdown-remark", - "version": "0.7.0", + "version": "0.8.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index 3ea436795..c15cf502d 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -1,4 +1,4 @@ -import type { AstroMarkdownOptions, MarkdownRenderingOptions } from './types'; +import type { AstroMarkdownOptions, MarkdownRenderingOptions, ShikiConfig, Plugin } from './types'; import createCollectHeaders from './rehype-collect-headers.js'; import scopedStyles from './remark-scoped-styles.js'; @@ -20,10 +20,13 @@ import rehypeStringify from 'rehype-stringify'; import rehypeRaw from 'rehype-raw'; import matter from 'gray-matter'; -export { AstroMarkdownOptions, MarkdownRenderingOptions }; +export { AstroMarkdownOptions, MarkdownRenderingOptions, ShikiConfig, Plugin }; /** Internal utility for rendering a full markdown file and extracting Frontmatter data */ -export async function renderMarkdownWithFrontmatter(contents: string, opts?: MarkdownRenderingOptions | null) { +export async function renderMarkdownWithFrontmatter( + contents: string, + opts?: MarkdownRenderingOptions | null +) { const { data: frontmatter, content } = matter(contents); const value = await renderMarkdown(content, opts); return { ...value, frontmatter }; @@ -73,7 +76,15 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp parser.use([remarkPrism(scopedClassName)]); } - parser.use([[markdownToHtml as any, { allowDangerousHtml: true, passThrough: ['raw', 'mdxTextExpression', 'mdxJsxTextElement', 'mdxJsxFlowElement'] }]]); + parser.use([ + [ + markdownToHtml as any, + { + allowDangerousHtml: true, + passThrough: ['raw', 'mdxTextExpression', 'mdxJsxTextElement', 'mdxJsxFlowElement'], + }, + ], + ]); loadedRehypePlugins.forEach(([plugin, opts]) => { parser.use([[plugin, opts]]); @@ -88,7 +99,10 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp let result: string; try { - const vfile = await parser.use([rehypeCollectHeaders]).use(rehypeStringify, { allowDangerousHtml: true }).process(content); + const vfile = await parser + .use([rehypeCollectHeaders]) + .use(rehypeStringify, { allowDangerousHtml: true }) + .process(content); result = vfile.toString(); } catch (err) { console.error(err); diff --git a/packages/markdown/remark/src/rehype-islands.ts b/packages/markdown/remark/src/rehype-islands.ts index 868f9096e..bbd584792 100644 --- a/packages/markdown/remark/src/rehype-islands.ts +++ b/packages/markdown/remark/src/rehype-islands.ts @@ -2,7 +2,11 @@ import { SKIP, visit as _visit } from 'unist-util-visit'; // This is a workaround. // It fixes a compatibility issue between different, incompatible ASTs given by plugins to Unist -const visit = _visit as (node: any, type: string, callback?: (node: any, index: number, parent: any) => any) => any; +const visit = _visit as ( + node: any, + type: string, + callback?: (node: any, index: number, parent: any) => any +) => any; // This fixes some confusing bugs coming from somewhere inside of our Markdown pipeline. // `unist`/`remark`/`rehype` (not sure) often generate malformed HTML inside of @@ -18,7 +22,11 @@ export default function rehypeIslands(): any { // Sometimes comments can be trapped as text, which causes them to be escaped // This casts them back to real HTML comments if (parent && child.value.indexOf('', '').trim() }); + parent.children.splice(index, 1, { + ...child, + type: 'comment', + value: child.value.replace('', '').trim(), + }); return [SKIP, index]; } // For some reason `rehype` likes to inject extra linebreaks, diff --git a/packages/markdown/remark/src/remark-prism.ts b/packages/markdown/remark/src/remark-prism.ts index 6d3e4e664..544de1540 100644 --- a/packages/markdown/remark/src/remark-prism.ts +++ b/packages/markdown/remark/src/remark-prism.ts @@ -56,7 +56,9 @@ function transformer(className: MaybeString) { if (className) { classes.push(className); } - node.value = `
${html}
`; + node.value = `
${html}
`; return node; }; return visit(tree, 'code', visitor); diff --git a/packages/markdown/remark/src/remark-shiki.ts b/packages/markdown/remark/src/remark-shiki.ts index f34fa26ef..314a0e38e 100644 --- a/packages/markdown/remark/src/remark-shiki.ts +++ b/packages/markdown/remark/src/remark-shiki.ts @@ -37,7 +37,10 @@ export interface ShikiConfig { */ const highlighterCacheAsync = new Map>(); -const remarkShiki = async ({ langs = [], theme = 'github-dark', wrap = false }: ShikiConfig, scopedClassName?: string | null) => { +const remarkShiki = async ( + { langs = [], theme = 'github-dark', wrap = false }: ShikiConfig, + scopedClassName?: string | null +) => { const cacheID: string = typeof theme === 'string' ? theme : theme.name; let highlighterAsync = highlighterCacheAsync.get(cacheID); if (!highlighterAsync) { @@ -63,15 +66,24 @@ const remarkShiki = async ({ langs = [], theme = 'github-dark', wrap = false }: // <span class="line" // Replace "shiki" class naming with "astro" and add "is:raw". - html = html.replace('
 any) => any;
+const visit = _visit as (
+	node: any,
+	type: string,
+	callback?: (node: any, index: number, parent: any) => any
+) => any;
 
 // Remove the wrapping paragraph for  islands
 export default function remarkUnwrap() {
@@ -33,6 +37,8 @@ export default function remarkUnwrap() {
 	};
 
 	function containsAstroRootNode(node: any) {
-		return node.children.map((child: any) => astroRootNodes.has(child)).reduce((all: boolean, v: boolean) => (all ? all : v), false);
+		return node.children
+			.map((child: any) => astroRootNodes.has(child))
+			.reduce((all: boolean, v: boolean) => (all ? all : v), false);
 	}
 }
diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts
index eb0eb5d3e..43e8331b4 100644
--- a/packages/markdown/remark/src/types.ts
+++ b/packages/markdown/remark/src/types.ts
@@ -1,5 +1,6 @@
 import type * as unified from 'unified';
 import type { ShikiConfig } from './remark-shiki';
+export { ShikiConfig };
 
 export type Plugin = string | [string, any] | unified.Plugin | [unified.Plugin, any];
 
diff --git a/packages/renderers/renderer-lit/client-shim.js b/packages/renderers/renderer-lit/client-shim.js
index cab3fe4d9..e9cf1aecf 100644
--- a/packages/renderers/renderer-lit/client-shim.js
+++ b/packages/renderers/renderer-lit/client-shim.js
@@ -1,9 +1,15 @@
 async function polyfill() {
-	const { hydrateShadowRoots } = await import('@webcomponents/template-shadowroot/template-shadowroot.js');
+	const { hydrateShadowRoots } = await import(
+		'@webcomponents/template-shadowroot/template-shadowroot.js'
+	);
 	hydrateShadowRoots(document.body);
 }
 
-const polyfillCheckEl = new DOMParser().parseFromString(`

`, 'text/html', { includeShadowRoots: true }).querySelector('p'); +const polyfillCheckEl = new DOMParser() + .parseFromString(`

`, 'text/html', { + includeShadowRoots: true, + }) + .querySelector('p'); if (!polyfillCheckEl || !polyfillCheckEl.shadowRoot) { polyfill(); diff --git a/packages/renderers/renderer-lit/index.js b/packages/renderers/renderer-lit/index.js index e6abec137..b051bc3a5 100644 --- a/packages/renderers/renderer-lit/index.js +++ b/packages/renderers/renderer-lit/index.js @@ -3,7 +3,9 @@ const NODE_VERSION = parseFloat(process.versions.node); if (NODE_VERSION < 13.9) { - throw new Error(`Package @lit-labs/ssr requires Node version v13.9 or higher. Please update Node to use @astrojs/renderer-lit`); + throw new Error( + `Package @lit-labs/ssr requires Node version v13.9 or higher. Please update Node to use @astrojs/renderer-lit` + ); } export default { diff --git a/packages/renderers/renderer-preact/client.js b/packages/renderers/renderer-preact/client.js index 85c18c76c..5ece5ddb2 100644 --- a/packages/renderers/renderer-preact/client.js +++ b/packages/renderers/renderer-preact/client.js @@ -1,4 +1,8 @@ import { h, render } from 'preact'; import StaticHtml from './static-html.js'; -export default (element) => (Component, props, children) => render(h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), element); +export default (element) => (Component, props, children) => + render( + h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), + element + ); diff --git a/packages/renderers/renderer-preact/compat/index.js b/packages/renderers/renderer-preact/compat/index.js index 3f993ec2f..a5580f04d 100644 --- a/packages/renderers/renderer-preact/compat/index.js +++ b/packages/renderers/renderer-preact/compat/index.js @@ -21,7 +21,12 @@ export default { dedupe: ['react', 'react-dom'], }, optimizeDeps: { - include: ['@astrojs/renderer-preact/client.js', 'preact/compat', 'preact/compat/jsx-runtime', 'preact-render-to-string'], + include: [ + '@astrojs/renderer-preact/client.js', + 'preact/compat', + 'preact/compat/jsx-runtime', + 'preact-render-to-string', + ], }, ssr: { external: ['preact-render-to-string'], diff --git a/packages/renderers/renderer-preact/index.js b/packages/renderers/renderer-preact/index.js index 59e900ebe..fe0a24528 100644 --- a/packages/renderers/renderer-preact/index.js +++ b/packages/renderers/renderer-preact/index.js @@ -14,7 +14,12 @@ export default { viteConfig() { return { optimizeDeps: { - include: ['@astrojs/renderer-preact/client.js', 'preact', 'preact/jsx-runtime', 'preact-render-to-string'], + include: [ + '@astrojs/renderer-preact/client.js', + 'preact', + 'preact/jsx-runtime', + 'preact-render-to-string', + ], exclude: ['@astrojs/renderer-preact/server.js'], }, ssr: { diff --git a/packages/renderers/renderer-preact/package.json b/packages/renderers/renderer-preact/package.json index 2fabb00a7..9174628e8 100644 --- a/packages/renderers/renderer-preact/package.json +++ b/packages/renderers/renderer-preact/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.17.3", - "preact": "^10.6.6", + "preact": "^10.7.0", "preact-render-to-string": "^5.1.20" }, "engines": { diff --git a/packages/renderers/renderer-preact/server.js b/packages/renderers/renderer-preact/server.js index 25b1a1530..0729f42e9 100644 --- a/packages/renderers/renderer-preact/server.js +++ b/packages/renderers/renderer-preact/server.js @@ -25,7 +25,9 @@ function check(Component, props, children) { } function renderToStaticMarkup(Component, props, children) { - const html = render(h(Component, props, children != null ? h(StaticHtml, { value: children }) : children)); + const html = render( + h(Component, props, children != null ? h(StaticHtml, { value: children }) : children) + ); return { html }; } diff --git a/packages/renderers/renderer-react/client.js b/packages/renderers/renderer-react/client.js index a6bc7d3bc..64284a0b0 100644 --- a/packages/renderers/renderer-react/client.js +++ b/packages/renderers/renderer-react/client.js @@ -7,7 +7,9 @@ export default (element) => (Component, props, children) => createElement( Component, { ...props, suppressHydrationWarning: true }, - children != null ? createElement(StaticHtml, { value: children, suppressHydrationWarning: true }) : children + children != null + ? createElement(StaticHtml, { value: children, suppressHydrationWarning: true }) + : children ), element ); diff --git a/packages/renderers/renderer-react/index.js b/packages/renderers/renderer-react/index.js index 6dd5106dc..698f2a13c 100644 --- a/packages/renderers/renderer-react/index.js +++ b/packages/renderers/renderer-react/index.js @@ -22,7 +22,13 @@ export default { viteConfig() { return { optimizeDeps: { - include: ['@astrojs/renderer-react/client.js', 'react', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-dom'], + include: [ + '@astrojs/renderer-react/client.js', + 'react', + 'react/jsx-runtime', + 'react/jsx-dev-runtime', + 'react-dom', + ], exclude: ['@astrojs/renderer-react/server.js'], }, resolve: { diff --git a/packages/renderers/renderer-react/server.js b/packages/renderers/renderer-react/server.js index 1c0c41286..b48d7b6f4 100644 --- a/packages/renderers/renderer-react/server.js +++ b/packages/renderers/renderer-react/server.js @@ -5,7 +5,11 @@ import StaticHtml from './static-html.js'; const reactTypeof = Symbol.for('react.element'); function errorIsComingFromPreactComponent(err) { - return err.message && (err.message.startsWith("Cannot read property '__H'") || err.message.includes("(reading '__H')")); + return ( + err.message && + (err.message.startsWith("Cannot read property '__H'") || + err.message.includes("(reading '__H')")) + ); } function check(Component, props, children) { diff --git a/packages/renderers/renderer-react/static-html.js b/packages/renderers/renderer-react/static-html.js index 47130d786..ecd76ae9b 100644 --- a/packages/renderers/renderer-react/static-html.js +++ b/packages/renderers/renderer-react/static-html.js @@ -9,7 +9,10 @@ import { createElement as h } from 'react'; */ const StaticHtml = ({ value }) => { if (!value) return null; - return h('astro-fragment', { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: value } }); + return h('astro-fragment', { + suppressHydrationWarning: true, + dangerouslySetInnerHTML: { __html: value }, + }); }; /** diff --git a/packages/renderers/renderer-solid/index.js b/packages/renderers/renderer-solid/index.js index b0b9aaab5..42715ffe6 100644 --- a/packages/renderers/renderer-solid/index.js +++ b/packages/renderers/renderer-solid/index.js @@ -18,7 +18,13 @@ export default { // We inject the dev mode only if the user explicitely wants it or if we are in dev (serve) mode const replaceDev = options.mode === 'development' || options.command === 'serve'; - const nestedDeps = ['solid-js', 'solid-js/web', 'solid-js/store', 'solid-js/html', 'solid-js/h']; + const nestedDeps = [ + 'solid-js', + 'solid-js/web', + 'solid-js/store', + 'solid-js/html', + 'solid-js/h', + ]; return { /** diff --git a/packages/renderers/renderer-solid/server.js b/packages/renderers/renderer-solid/server.js index d32d60a64..ccee482ea 100644 --- a/packages/renderers/renderer-solid/server.js +++ b/packages/renderers/renderer-solid/server.js @@ -19,7 +19,9 @@ function renderToStaticMarkup(Component, props, children) { children: children != null ? ssr(`${children}`) : children, }) ); - return { html: html + `` }; + return { + html: html + ``, + }; } export default { diff --git a/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js b/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js index 9bca437b5..e6a4781a7 100644 --- a/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js +++ b/packages/renderers/renderer-svelte/Wrapper.svelte.ssr.js @@ -8,7 +8,12 @@ const App = create_ssr_component(($$result, $$props, $$bindings, slots) => { children.default = () => `${__astro_children}`; } - return `${validate_component(Component || missing_component, 'svelte:component').$$render($$result, Object.assign(props), {}, children)}`; + return `${validate_component(Component || missing_component, 'svelte:component').$$render( + $$result, + Object.assign(props), + {}, + children + )}`; }); export default App; diff --git a/packages/renderers/renderer-svelte/package.json b/packages/renderers/renderer-svelte/package.json index cbb782c53..8da05e9f8 100644 --- a/packages/renderers/renderer-svelte/package.json +++ b/packages/renderers/renderer-svelte/package.json @@ -21,9 +21,9 @@ }, "dependencies": { "@sveltejs/vite-plugin-svelte": "^1.0.0-next.40", - "svelte": "^3.46.4", + "svelte": "^3.46.6", "svelte-preprocess": "^4.10.4", - "vite": "^2.8.6" + "vite": "^2.9.1" }, "engines": { "node": "^14.15.0 || >=16.0.0" diff --git a/packages/renderers/renderer-svelte/server.js b/packages/renderers/renderer-svelte/server.js index c51b2f4b4..3c989cd5a 100644 --- a/packages/renderers/renderer-svelte/server.js +++ b/packages/renderers/renderer-svelte/server.js @@ -5,7 +5,11 @@ function check(Component) { } async function renderToStaticMarkup(Component, props, children) { - const { html } = SvelteWrapper.render({ __astro_component: Component, __astro_children: children, ...props }); + const { html } = SvelteWrapper.render({ + __astro_component: Component, + __astro_children: children, + ...props, + }); return { html }; } diff --git a/packages/renderers/renderer-vue/package.json b/packages/renderers/renderer-vue/package.json index 9cfc5c727..84eb4b522 100644 --- a/packages/renderers/renderer-vue/package.json +++ b/packages/renderers/renderer-vue/package.json @@ -20,8 +20,8 @@ "./package.json": "./package.json" }, "dependencies": { - "@vitejs/plugin-vue": "^2.2.4", - "vite": "^2.8.6", + "@vitejs/plugin-vue": "^2.3.1", + "vite": "^2.9.1", "vue": "^3.2.31" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b99a7f117..4bffb8598 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: eslint-config-prettier: ^8.5.0 eslint-plugin-prettier: ^4.0.0 execa: ^6.1.0 - prettier: ^2.6.1 + prettier: ^2.6.2 pretty-bytes: ^6.0.0 tiny-glob: ^0.2.9 turbo: ^1.1.10 @@ -33,9 +33,9 @@ importers: esbuild: 0.14.25 eslint: 8.12.0 eslint-config-prettier: 8.5.0_eslint@8.12.0 - eslint-plugin-prettier: 4.0.0_b253a92c95b42c3296c682f11cccb3bd + eslint-plugin-prettier: 4.0.0_f2c91d0f54113167d2bd9214a5ab5a36 execa: 6.1.0 - prettier: 2.6.1 + prettier: 2.6.2 pretty-bytes: 6.0.0 tiny-glob: 0.2.9 turbo: 1.1.10 @@ -44,10 +44,10 @@ importers: examples/blog: specifiers: '@astrojs/preact': ^0.0.2 - astro: ^0.25.4 - preact: ^10.6.6 + astro: ^0.26.0 + preact: ^10.7.0 dependencies: - preact: 10.6.6 + preact: 10.7.0 devDependencies: '@astrojs/preact': link:../../packages/integrations/preact astro: link:../../packages/astro @@ -55,26 +55,26 @@ importers: examples/blog-multiple-authors: specifiers: '@astrojs/preact': ^0.0.2 - astro: ^0.25.4 - preact: ^10.6.6 - sass: ^1.49.9 + astro: ^0.26.0 + preact: ^10.7.0 + sass: ^1.49.11 dependencies: - preact: 10.6.6 + preact: 10.7.0 devDependencies: '@astrojs/preact': link:../../packages/integrations/preact astro: link:../../packages/astro - sass: 1.49.9 + sass: 1.49.11 examples/component: specifiers: - astro: ^0.25.4 + astro: ^0.26.0 devDependencies: astro: link:../../packages/astro examples/component/demo: specifiers: '@example/my-component': workspace:* - astro: ^0.25.4 + astro: ^0.26.0 devDependencies: '@example/my-component': link:../packages/my-component astro: link:../../../packages/astro @@ -86,12 +86,12 @@ importers: specifiers: '@algolia/client-search': ^4.13.0 '@astrojs/preact': ^0.0.2 - '@astrojs/react': ^0.0.2 + '@astrojs/react': ^0.1.0 '@docsearch/css': ^3.0.0 '@docsearch/react': ^3.0.0 '@types/react': ^17.0.43 - astro: ^0.25.4 - preact: ^10.6.6 + astro: ^0.26.0 + preact: ^10.7.0 react: ^18.0.0 react-dom: ^18.0.0 dependencies: @@ -99,7 +99,7 @@ importers: '@docsearch/css': 3.0.0 '@docsearch/react': 3.0.0_9e0989ed96c3582fc46f3bba1f5ac769 '@types/react': 17.0.43 - preact: 10.6.6 + preact: 10.7.0 react: 18.0.0 react-dom: 18.0.0_react@18.0.0 devDependencies: @@ -109,13 +109,13 @@ importers: examples/env-vars: specifiers: - astro: ^0.25.4 + astro: ^0.26.0 devDependencies: astro: link:../../packages/astro examples/framework-alpine: specifiers: - astro: ^0.25.4 + astro: ^0.26.0 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.4 + astro: ^0.26.0 lit: ^2.2.1 dependencies: '@webcomponents/template-shadowroot': 0.1.0 @@ -136,27 +136,27 @@ importers: specifiers: '@astrojs/lit': ^0.0.2 '@astrojs/preact': ^0.0.2 - '@astrojs/react': ^0.0.2 + '@astrojs/react': ^0.1.0 '@astrojs/solid-js': ^0.0.3 '@astrojs/svelte': ^0.0.2 '@astrojs/vue': ^0.0.2 '@webcomponents/template-shadowroot': ^0.1.0 - astro: ^0.25.4 + astro: ^0.26.0 lit: ^2.2.1 - preact: ^10.6.6 + preact: ^10.7.0 react: ^18.0.0 react-dom: ^18.0.0 solid-js: ^1.3.13 - svelte: ^3.46.4 + svelte: ^3.46.6 vue: ^3.2.31 dependencies: '@webcomponents/template-shadowroot': 0.1.0 lit: 2.2.1 - preact: 10.6.6 + preact: 10.7.0 react: 18.0.0 react-dom: 18.0.0_react@18.0.0 solid-js: 1.3.13 - svelte: 3.46.4 + svelte: 3.46.6 vue: 3.2.31 devDependencies: '@astrojs/lit': link:../../packages/integrations/lit @@ -170,18 +170,18 @@ importers: examples/framework-preact: specifiers: '@astrojs/preact': ^0.0.2 - astro: ^0.25.4 - preact: ^10.6.6 + astro: ^0.26.0 + preact: ^10.7.0 dependencies: - preact: 10.6.6 + preact: 10.7.0 devDependencies: '@astrojs/preact': link:../../packages/integrations/preact astro: link:../../packages/astro examples/framework-react: specifiers: - '@astrojs/react': ^0.0.2 - astro: ^0.25.4 + '@astrojs/react': ^0.1.0 + astro: ^0.26.0 react: ^18.0.0 react-dom: ^18.0.0 dependencies: @@ -194,7 +194,7 @@ importers: examples/framework-solid: specifiers: '@astrojs/solid-js': ^0.0.3 - astro: ^0.25.4 + astro: ^0.26.0 solid-js: ^1.3.13 dependencies: solid-js: 1.3.13 @@ -205,10 +205,10 @@ importers: examples/framework-svelte: specifiers: '@astrojs/svelte': ^0.0.2 - astro: ^0.25.4 - svelte: ^3.46.4 + astro: ^0.26.0 + svelte: ^3.46.6 dependencies: - svelte: 3.46.4 + svelte: 3.46.6 devDependencies: '@astrojs/svelte': link:../../packages/integrations/svelte astro: link:../../packages/astro @@ -216,7 +216,7 @@ importers: examples/framework-vue: specifiers: '@astrojs/vue': ^0.0.2 - astro: ^0.25.4 + astro: ^0.26.0 vue: ^3.2.31 dependencies: vue: 3.2.31 @@ -227,28 +227,28 @@ importers: examples/integrations-playground: specifiers: '@astrojs/lit': ^0.0.2 - '@astrojs/partytown': ^0.0.2 - '@astrojs/react': ^0.0.2 - '@astrojs/sitemap': ^0.0.2 - '@astrojs/tailwind': ^0.0.2 + '@astrojs/partytown': ^0.1.0 + '@astrojs/react': ^0.1.0 + '@astrojs/sitemap': ^0.1.0 + '@astrojs/tailwind': ^0.1.0 '@astrojs/turbolinks': ^0.0.2 '@webcomponents/template-shadowroot': ^0.1.0 - astro: ^0.25.4 + astro: ^0.26.0 lit: ^2.2.1 - preact: ^10.6.6 + preact: ^10.7.0 react: ^18.0.0 react-dom: ^18.0.0 solid-js: ^1.3.13 - svelte: ^3.46.4 + svelte: ^3.46.6 vue: ^3.2.31 dependencies: '@webcomponents/template-shadowroot': 0.1.0 lit: 2.2.1 - preact: 10.6.6 + preact: 10.7.0 react: 18.0.0 react-dom: 18.0.0_react@18.0.0 solid-js: 1.3.13 - svelte: 3.46.4 + svelte: 3.46.6 vue: 3.2.31 devDependencies: '@astrojs/lit': link:../../packages/integrations/lit @@ -261,89 +261,89 @@ importers: examples/minimal: specifiers: - astro: ^0.25.4 + astro: ^0.26.0 devDependencies: astro: link:../../packages/astro examples/non-html-pages: specifiers: - astro: ^0.25.4 + astro: ^0.26.0 devDependencies: astro: link:../../packages/astro examples/portfolio: specifiers: '@astrojs/preact': ^0.0.2 - astro: ^0.25.4 - preact: ^10.6.6 - sass: ^1.49.9 + astro: ^0.26.0 + preact: ^10.7.0 + sass: ^1.49.11 dependencies: - preact: 10.6.6 + preact: 10.7.0 devDependencies: '@astrojs/preact': link:../../packages/integrations/preact astro: link:../../packages/astro - sass: 1.49.9 + sass: 1.49.11 examples/ssr: specifiers: '@astrojs/node': ^0.0.2 '@astrojs/svelte': ^0.0.2 - astro: ^0.25.4 - concurrently: ^7.0.0 + astro: ^0.26.0 + concurrently: ^7.1.0 lightcookie: ^1.0.25 - svelte: ^3.46.4 + svelte: ^3.46.6 unocss: ^0.15.6 vite-imagetools: ^4.0.3 dependencies: - svelte: 3.46.4 + svelte: 3.46.6 devDependencies: '@astrojs/node': link:../../packages/integrations/node '@astrojs/svelte': link:../../packages/integrations/svelte astro: link:../../packages/astro - concurrently: 7.0.0 + concurrently: 7.1.0 lightcookie: 1.0.25 unocss: 0.15.6 vite-imagetools: 4.0.3 examples/starter: specifiers: - astro: ^0.25.4 + astro: ^0.26.0 devDependencies: astro: link:../../packages/astro examples/subpath: specifiers: - '@astrojs/react': ^0.0.2 - astro: ^0.25.4 + '@astrojs/react': ^0.1.0 + astro: ^0.26.0 react: ^18.0.0 react-dom: ^18.0.0 - sass: ^1.49.9 + sass: ^1.49.11 dependencies: react: 18.0.0 react-dom: 18.0.0_react@18.0.0 devDependencies: '@astrojs/react': link:../../packages/integrations/react astro: link:../../packages/astro - sass: 1.49.9 + sass: 1.49.11 examples/with-markdown: specifiers: - '@astrojs/markdown-remark': ^0.7.0 + '@astrojs/markdown-remark': ^0.8.0 '@astrojs/preact': ^0.0.2 - '@astrojs/react': ^0.0.2 + '@astrojs/react': ^0.1.0 '@astrojs/svelte': ^0.0.2 '@astrojs/vue': ^0.0.2 - astro: ^0.25.4 - preact: ^10.6.6 + astro: ^0.26.0 + preact: ^10.7.0 react: ^18.0.0 react-dom: ^18.0.0 - svelte: ^3.46.4 + svelte: ^3.46.6 vue: ^3.2.31 dependencies: - preact: 10.6.6 + preact: 10.7.0 react: 18.0.0 react-dom: 18.0.0_react@18.0.0 - svelte: 3.46.4 + svelte: 3.46.6 vue: 3.2.31 devDependencies: '@astrojs/markdown-remark': link:../../packages/markdown/remark @@ -355,8 +355,8 @@ importers: examples/with-markdown-plugins: specifiers: - '@astrojs/markdown-remark': ^0.7.0 - astro: ^0.25.4 + '@astrojs/markdown-remark': ^0.8.0 + astro: ^0.26.0 hast-util-select: 5.0.1 rehype-autolink-headings: ^6.1.1 rehype-slug: ^5.0.1 @@ -373,8 +373,8 @@ importers: examples/with-markdown-shiki: specifiers: - '@astrojs/markdown-remark': ^0.7.0 - astro: ^0.25.4 + '@astrojs/markdown-remark': ^0.8.0 + astro: ^0.26.0 devDependencies: '@astrojs/markdown-remark': link:../../packages/markdown/remark astro: link:../../packages/astro @@ -382,26 +382,26 @@ importers: examples/with-nanostores: specifiers: '@astrojs/preact': ^0.0.2 - '@astrojs/react': ^0.0.2 + '@astrojs/react': ^0.1.0 '@astrojs/solid-js': ^0.0.3 '@astrojs/svelte': ^0.0.2 '@astrojs/vue': ^0.0.2 '@nanostores/preact': ^0.1.3 '@nanostores/react': ^0.1.5 '@nanostores/vue': ^0.4.1 - astro: ^0.25.4 + astro: ^0.26.0 nanostores: ^0.5.12 - preact: ^10.6.6 + preact: ^10.7.0 react: ^18.0.0 react-dom: ^18.0.0 solid-nanostores: 0.0.6 vue: ^3.2.31 dependencies: - '@nanostores/preact': 0.1.3_nanostores@0.5.12+preact@10.6.6 + '@nanostores/preact': 0.1.3_nanostores@0.5.12+preact@10.7.0 '@nanostores/react': 0.1.5_33de46f26c75888291546388c72611d1 '@nanostores/vue': 0.4.1_nanostores@0.5.12+vue@3.2.31 nanostores: 0.5.12 - preact: 10.6.6 + preact: 10.7.0 react: 18.0.0 react-dom: 18.0.0_react@18.0.0 solid-nanostores: 0.0.6 @@ -416,8 +416,8 @@ importers: examples/with-tailwindcss: specifiers: - '@astrojs/tailwind': ^0.0.2 - astro: ^0.25.4 + '@astrojs/tailwind': ^0.1.0 + astro: ^0.26.0 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.4 + astro: ^0.26.0 vite-plugin-pwa: 0.11.11 workbox-window: ^6.5.2 devDependencies: @@ -442,9 +442,9 @@ importers: packages/astro: specifiers: - '@astrojs/compiler': ^0.13.1 - '@astrojs/language-server': ^0.13.2 - '@astrojs/markdown-remark': ^0.7.0 + '@astrojs/compiler': ^0.14.1 + '@astrojs/language-server': ^0.13.3 + '@astrojs/markdown-remark': ^0.8.0 '@astrojs/prism': 0.4.1 '@astrojs/webapi': ^0.11.0 '@babel/core': ^7.17.8 @@ -511,7 +511,7 @@ importers: rehype-slug: ^5.0.1 resolve: ^1.22.0 rollup: ^2.70.1 - sass: ^1.49.9 + sass: ^1.49.11 semver: ^7.3.5 serialize-javascript: ^6.0.0 shiki: ^0.10.1 @@ -524,12 +524,12 @@ importers: strip-ansi: ^7.0.1 supports-esm: ^1.0.0 tsconfig-resolver: ^3.0.1 - vite: ^2.8.6 + vite: ^2.9.1 yargs-parser: ^21.0.1 zod: ^3.14.3 dependencies: - '@astrojs/compiler': 0.13.1 - '@astrojs/language-server': 0.13.2 + '@astrojs/compiler': 0.14.1 + '@astrojs/language-server': 0.13.3 '@astrojs/markdown-remark': link:../markdown/remark '@astrojs/prism': link:../astro-prism '@astrojs/webapi': link:../webapi @@ -585,7 +585,7 @@ importers: strip-ansi: 7.0.1 supports-esm: 1.0.0 tsconfig-resolver: 3.0.1 - vite: 2.8.6_sass@1.49.9 + vite: 2.9.1_sass@1.49.11 yargs-parser: 21.0.1 zod: 3.14.3 devDependencies: @@ -613,7 +613,7 @@ importers: chai: 4.3.6 cheerio: 1.0.0-rc.10 mocha: 9.2.2 - sass: 1.49.9 + sass: 1.49.11 packages/astro-prism: specifiers: @@ -1037,10 +1037,10 @@ importers: packages/astro/test/fixtures/sass: specifiers: astro: workspace:* - sass: ^1.49.9 + sass: ^1.49.11 dependencies: astro: link:../../.. - sass: 1.49.9 + sass: 1.49.11 packages/astro/test/fixtures/slots-preact: specifiers: @@ -1269,15 +1269,15 @@ importers: '@babel/plugin-transform-react-jsx': ^7.17.3 astro: workspace:* astro-scripts: workspace:* - preact: ^10.6.6 + preact: ^10.7.0 preact-render-to-string: ^5.1.20 dependencies: '@babel/plugin-transform-react-jsx': 7.17.3 - preact-render-to-string: 5.1.20_preact@10.6.6 + preact-render-to-string: 5.1.20_preact@10.7.0 devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts - preact: 10.6.6 + preact: 10.7.0 packages/integrations/react: specifiers: @@ -1328,21 +1328,21 @@ importers: astro: workspace:* astro-scripts: workspace:* postcss-load-config: ^3.1.4 - svelte: ^3.46.4 + svelte: ^3.46.6 svelte-preprocess: ^4.10.4 dependencies: - '@sveltejs/vite-plugin-svelte': 1.0.0-next.40_svelte@3.46.4 + '@sveltejs/vite-plugin-svelte': 1.0.0-next.40_svelte@3.46.6 postcss-load-config: 3.1.4 - svelte-preprocess: 4.10.4_ec4868a778d68da3f0d21a10f4ea83cd + svelte-preprocess: 4.10.4_4fb28cead04100f31b0e8b0196137d75 devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts - svelte: 3.46.4 + svelte: 3.46.6 packages/integrations/tailwind: specifiers: '@proload/core': ^0.2.2 - '@types/tailwindcss': ^3.0.9 + '@types/tailwindcss': ^3.0.10 astro: workspace:* astro-scripts: workspace:* autoprefixer: ^10.4.4 @@ -1354,7 +1354,7 @@ importers: postcss: 8.4.12 tailwindcss: 3.0.23_autoprefixer@10.4.4 devDependencies: - '@types/tailwindcss': 3.0.9 + '@types/tailwindcss': 3.0.10 astro: link:../../astro astro-scripts: link:../../../scripts @@ -1384,12 +1384,12 @@ importers: packages/integrations/vue: specifiers: - '@vitejs/plugin-vue': ^2.2.4 + '@vitejs/plugin-vue': ^2.3.1 astro: workspace:* astro-scripts: workspace:* vue: ^3.2.31 dependencies: - '@vitejs/plugin-vue': 2.2.4_vue@3.2.31 + '@vitejs/plugin-vue': 2.3.1_vue@3.2.31 devDependencies: astro: link:../../astro astro-scripts: link:../../../scripts @@ -1461,12 +1461,12 @@ importers: packages/renderers/renderer-preact: specifiers: '@babel/plugin-transform-react-jsx': ^7.17.3 - preact: ^10.6.6 + preact: ^10.7.0 preact-render-to-string: ^5.1.20 dependencies: '@babel/plugin-transform-react-jsx': 7.17.3 - preact: 10.6.6 - preact-render-to-string: 5.1.20_preact@10.6.6 + preact: 10.7.0 + preact-render-to-string: 5.1.20_preact@10.7.0 packages/renderers/renderer-react: specifiers: @@ -1489,23 +1489,23 @@ importers: packages/renderers/renderer-svelte: specifiers: '@sveltejs/vite-plugin-svelte': ^1.0.0-next.40 - svelte: ^3.46.4 + svelte: ^3.46.6 svelte-preprocess: ^4.10.4 - vite: ^2.8.6 + vite: ^2.9.1 dependencies: - '@sveltejs/vite-plugin-svelte': 1.0.0-next.40_svelte@3.46.4+vite@2.8.6 - svelte: 3.46.4 - svelte-preprocess: 4.10.4_svelte@3.46.4+typescript@4.6.3 - vite: 2.8.6 + '@sveltejs/vite-plugin-svelte': 1.0.0-next.40_svelte@3.46.6+vite@2.9.1 + svelte: 3.46.6 + svelte-preprocess: 4.10.4_svelte@3.46.6+typescript@4.6.3 + vite: 2.9.1 packages/renderers/renderer-vue: specifiers: - '@vitejs/plugin-vue': ^2.2.4 - vite: ^2.8.6 + '@vitejs/plugin-vue': ^2.3.1 + vite: ^2.9.1 vue: ^3.2.31 dependencies: - '@vitejs/plugin-vue': 2.2.4_vite@2.8.6+vue@3.2.31 - vite: 2.8.6 + '@vitejs/plugin-vue': 2.3.1_vite@2.9.1+vue@3.2.31 + vite: 2.9.1 vue: 3.2.31 packages/webapi: @@ -1562,7 +1562,7 @@ importers: esbuild: 0.14.25 globby: ^12.2.0 kleur: ^4.1.4 - svelte: ^3.46.4 + svelte: ^3.46.6 tar: ^6.1.11 dependencies: '@astrojs/renderer-preact': link:../packages/renderers/renderer-preact @@ -1575,7 +1575,7 @@ importers: esbuild: 0.14.25 globby: 12.2.0 kleur: 4.1.4 - svelte: 3.46.4 + svelte: 3.46.6 tar: 6.1.11 packages: @@ -1726,15 +1726,15 @@ packages: leven: 3.1.0 dev: true - /@astrojs/compiler/0.13.1: - resolution: {integrity: sha512-iRAwvJ8/uVRtK/4ofSYKx4MTsuG8YjSgz8Lti7tPGoFaQzSNEU8J5cXvpTSV/F2SspSWB9EHjk2v7204pOxlrQ==} + /@astrojs/compiler/0.14.1: + resolution: {integrity: sha512-dYgb52JvZE8jyDg84JkdJ/dTxRgHVbC47ou6Ymok/nZDh9kvlU7TJtEDCLlGfpfZTGvnkFTHMrz1kdbqCbFVCw==} dependencies: tsm: 2.2.1 uvu: 0.5.3 dev: false - /@astrojs/language-server/0.13.2: - resolution: {integrity: sha512-4YM4hM02ILvvsSQljAlwLY7OWymlhbikY7O/gsZqELVGMXixemA6dI3GTr2K6duU4ktPBJ3JexuU/OFyb5jvtQ==} + /@astrojs/language-server/0.13.3: + resolution: {integrity: sha512-i+m49XGg52LBDsi+zT5Wo9uhundfWHdA2uzC0xMn5AOmQXXzlDgSo29/SFRsHx3shT3kZ5Uf/Jkm6BNed/bs3g==} hasBin: true dependencies: '@astrojs/svelte-language-integration': 0.1.2_typescript@4.6.3 @@ -1742,7 +1742,7 @@ packages: lodash: 4.17.21 source-map: 0.7.3 typescript: 4.6.3 - vscode-css-languageservice: 5.3.0 + vscode-css-languageservice: 5.4.1 vscode-html-languageservice: 4.2.4 vscode-languageserver: 7.0.0 vscode-languageserver-protocol: 3.16.0 @@ -1754,8 +1754,8 @@ packages: /@astrojs/svelte-language-integration/0.1.2_typescript@4.6.3: resolution: {integrity: sha512-O6LYL9igYSzxCxDHYWUqEquuuUlMG0UL1SliZ7rF/vx9GwU71TCpsRe4iHZ0bcemM5ju9ihoTzGCmLXzYrNw0g==} dependencies: - svelte: 3.46.4 - svelte2tsx: 0.5.6_svelte@3.46.4+typescript@4.6.3 + svelte: 3.46.6 + svelte2tsx: 0.5.6_svelte@3.46.6+typescript@4.6.3 transitivePeerDependencies: - typescript dev: false @@ -3384,8 +3384,8 @@ packages: resolution: {integrity: sha512-Jh0llaK2LRXQoYsorIH8maClebsnzTcve+7U3rQUSnC11X4jtPnFuyatqFLvMxZ8MLG8dB4zfHsbPfuvxluONw==} dev: true - /@iconify/utils/1.0.31: - resolution: {integrity: sha512-sBksCt6kI4WaMHwXo1c/MQVuQfWwwd87qHiAPASN8neoQvMCdYTLn+2khc3/OmYPbmg6kYisCxVLkAv0pcy9Ig==} + /@iconify/utils/1.0.32: + resolution: {integrity: sha512-m+rnw7qKHq/XF7DAi4BcFoEAcXBfqqMgQJh8brGEHeqE/RUvgDMjmxsHgWnVpFsG+VmjGyAiI7nwXdliCwEU0Q==} dependencies: '@antfu/install-pkg': 0.1.0 '@antfu/utils': 0.5.0 @@ -3468,7 +3468,7 @@ packages: read-yaml-file: 1.1.0 dev: true - /@nanostores/preact/0.1.3_nanostores@0.5.12+preact@10.6.6: + /@nanostores/preact/0.1.3_nanostores@0.5.12+preact@10.7.0: resolution: {integrity: sha512-uiX1ned0LrzASot+sPUjyJzr8Js3pX075omazgsSdLf0zPp4ss8xwTiuNh5FSKigTSQEVqZFiS+W8CnHIrX62A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} peerDependencies: @@ -3476,7 +3476,7 @@ packages: preact: '>=10.0.0' dependencies: nanostores: 0.5.12 - preact: 10.6.6 + preact: 10.7.0 dev: false /@nanostores/react/0.1.5_33de46f26c75888291546388c72611d1: @@ -3783,7 +3783,7 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /@sveltejs/vite-plugin-svelte/1.0.0-next.40_svelte@3.46.4: + /@sveltejs/vite-plugin-svelte/1.0.0-next.40_svelte@3.46.6: resolution: {integrity: sha512-DtXF01fYGEJkbC7GntU/7jaq9M1SwyyNCkbDA+cfQSXRpm3H7zbu0M80wSQBSpntdd+hgSdxKCxv4GgX6/zI6w==} engines: {node: ^14.13.1 || >= 16} peerDependencies: @@ -3800,13 +3800,13 @@ packages: debug: 4.3.4 kleur: 4.1.4 magic-string: 0.26.1 - svelte: 3.46.4 - svelte-hmr: 0.14.11_svelte@3.46.4 + svelte: 3.46.6 + svelte-hmr: 0.14.11_svelte@3.46.6 transitivePeerDependencies: - supports-color dev: false - /@sveltejs/vite-plugin-svelte/1.0.0-next.40_svelte@3.46.4+vite@2.8.6: + /@sveltejs/vite-plugin-svelte/1.0.0-next.40_svelte@3.46.6+vite@2.9.1: resolution: {integrity: sha512-DtXF01fYGEJkbC7GntU/7jaq9M1SwyyNCkbDA+cfQSXRpm3H7zbu0M80wSQBSpntdd+hgSdxKCxv4GgX6/zI6w==} engines: {node: ^14.13.1 || >= 16} peerDependencies: @@ -3823,9 +3823,9 @@ packages: debug: 4.3.4 kleur: 4.1.4 magic-string: 0.26.1 - svelte: 3.46.4 - svelte-hmr: 0.14.11_svelte@3.46.4 - vite: 2.8.6 + svelte: 3.46.6 + svelte-hmr: 0.14.11_svelte@3.46.6 + vite: 2.9.1 transitivePeerDependencies: - supports-color dev: false @@ -4092,8 +4092,8 @@ packages: '@types/node': 17.0.23 dev: true - /@types/tailwindcss/3.0.9: - resolution: {integrity: sha512-uZjNKNjlA6cr6py/GWsDjevJb/Bl0fmaMNUdIpNMW3TJGJzxN9O6uFWx97LiSK7ithWNrrDSytq1FdvHpgSvWg==} + /@types/tailwindcss/3.0.10: + resolution: {integrity: sha512-1UnZIHO0NOPyPlPFV0HuMjki2SHkvG9uBA1ZehWj/OQMSROk503nuNyyfmJSIT289yewxTbKoPG+KLxYRvfIIg==} dev: true /@types/throttle-debounce/2.1.0: @@ -4288,7 +4288,7 @@ packages: /@unocss/preset-icons/0.15.6: resolution: {integrity: sha512-o5NWtOu3OKVaWYVieQ1pVmsj7jvWvMgE5TXPKRr3OTRR2u8M5wo+yRX4+m1sVjAtWiUz8e49TpbbsQTM42Lv7A==} dependencies: - '@iconify/utils': 1.0.31 + '@iconify/utils': 1.0.32 '@unocss/core': 0.15.6 local-pkg: 0.4.1 transitivePeerDependencies: @@ -4334,8 +4334,8 @@ packages: '@unocss/scope': 0.15.6 dev: true - /@vitejs/plugin-vue/2.2.4_vite@2.8.6+vue@3.2.31: - resolution: {integrity: sha512-ev9AOlp0ljCaDkFZF3JwC/pD2N4Hh+r5srl5JHM6BKg5+99jiiK0rE/XaRs3pVm1wzyKkjUy/StBSoXX5fFzcw==} + /@vitejs/plugin-vue/2.3.1_vite@2.9.1+vue@3.2.31: + resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==} engines: {node: '>=12.0.0'} peerDependencies: vite: ^2.5.10 @@ -4344,12 +4344,12 @@ packages: vite: optional: true dependencies: - vite: 2.8.6 + vite: 2.9.1 vue: 3.2.31 dev: false - /@vitejs/plugin-vue/2.2.4_vue@3.2.31: - resolution: {integrity: sha512-ev9AOlp0ljCaDkFZF3JwC/pD2N4Hh+r5srl5JHM6BKg5+99jiiK0rE/XaRs3pVm1wzyKkjUy/StBSoXX5fFzcw==} + /@vitejs/plugin-vue/2.3.1_vue@3.2.31: + resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==} engines: {node: '>=12.0.0'} peerDependencies: vite: ^2.5.10 @@ -4693,7 +4693,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.20.2 - caniuse-lite: 1.0.30001322 + caniuse-lite: 1.0.30001324 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -4784,8 +4784,8 @@ packages: /base64-js/1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - /bcp-47-match/2.0.1: - resolution: {integrity: sha512-+8o7axFDN/h8xATDM87FhnU1eod87dX0eZz1+cW3gggcicBqrmkZc33KBPWoE49qt5Asi5OhcxSOMOzp3opTfg==} + /bcp-47-match/2.0.2: + resolution: {integrity: sha512-zy5swVXwQ25ttElhoN9Dgnqm6VFlMkeDNljvHSGqGNr4zClUosdFzxD+fQHJVmx3g3KY+r//wV/fmBHsa1ErnA==} /before-after-hook/2.2.2: resolution: {integrity: sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==} @@ -4830,7 +4830,7 @@ packages: chalk: 4.1.2 cli-boxes: 3.0.0 string-width: 5.1.2 - type-fest: 2.12.1 + type-fest: 2.12.2 widest-line: 4.0.1 wrap-ansi: 8.0.1 dev: false @@ -4862,8 +4862,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001322 - electron-to-chromium: 1.4.98 + caniuse-lite: 1.0.30001324 + electron-to-chromium: 1.4.103 escalade: 3.1.1 node-releases: 2.0.2 picocolors: 1.0.0 @@ -4937,8 +4937,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - /caniuse-lite/1.0.30001322: - resolution: {integrity: sha512-neRmrmIrCGuMnxGSoh+x7zYtQFFgnSY2jaomjU56sCkTA6JINqQrxutF459JpWcWRajvoyn95sOXq4Pqrnyjew==} + /caniuse-lite/1.0.30001324: + resolution: {integrity: sha512-/eYp1J6zYh1alySQB4uzYFkLmxxI8tk0kxldbNHXp8+v+rdMKdUBNjRLz7T7fz6Iox+1lIdYpc7rq6ZcXfTukg==} /canvas-confetti/1.5.1: resolution: {integrity: sha512-Ncz+oZJP6OvY7ti4E1slxVlyAV/3g7H7oQtcCDXgwGgARxPnwYY9PW5Oe+I8uvspYNtuHviAdgA0LfcKFWJfpg==} @@ -5017,7 +5017,7 @@ packages: resolution: {integrity: sha512-eq0GdBvxVFbqWgmCm7M3XGs1I8oLy/nExUnh6oLqmBditPO9AqQJrkslDpMun/hZ0yyTs8L0m85OHp4ho6Qm9g==} dependencies: css-select: 4.3.0 - css-what: 6.0.1 + css-what: 6.1.0 domelementtype: 2.2.0 domhandler: 4.3.1 domutils: 2.8.0 @@ -5164,8 +5164,8 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} - /concurrently/7.0.0: - resolution: {integrity: sha512-WKM7PUsI8wyXpF80H+zjHP32fsgsHNQfPLw/e70Z5dYkV7hF+rf8q3D+ScWJIEr57CpkO3OWBko6hwhQLPR8Pw==} + /concurrently/7.1.0: + resolution: {integrity: sha512-Bz0tMlYKZRUDqJlNiF/OImojMB9ruKUz6GCfmhFnSapXgPe+3xzY4byqoKG9tUZ7L2PGEUjfLPOLfIX3labnmw==} engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} hasBin: true dependencies: @@ -5238,7 +5238,7 @@ packages: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} dependencies: boolbase: 1.0.0 - css-what: 6.0.1 + css-what: 6.1.0 domhandler: 4.3.1 domutils: 2.8.0 nth-check: 2.0.1 @@ -5247,8 +5247,8 @@ packages: /css-selector-parser/1.4.1: resolution: {integrity: sha512-HYPSb7y/Z7BNDCOrakL4raGO2zltZkbeXyAd6Tg9obzix6QhzxCotdBl6VT0Dv4vZfJGVz3WL/xaEI9Ly3ul0g==} - /css-what/6.0.1: - resolution: {integrity: sha512-z93ZGFLNc6yaoXAmVhqoSIb+BduplteCt1fepvwhBUQK6MNE4g6fgjpuZKJKp0esUe+vXWlIkwZZjNWoOKw0ZA==} + /css-what/6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} dev: true @@ -5542,8 +5542,8 @@ packages: jake: 10.8.4 dev: true - /electron-to-chromium/1.4.98: - resolution: {integrity: sha512-1IdsuSAnIGVxoYT1LkcUFb9MfjRxdHhCU9qiaDzhl1XvYgK9c8E2O9aJOPgGMQ68CSI8NxmLwrYhjvGauT8yuw==} + /electron-to-chromium/1.4.103: + resolution: {integrity: sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg==} /emmet/2.3.6: resolution: {integrity: sha512-pLS4PBPDdxuUAmw7Me7+TcHbykTsBKN/S9XJbUOMFQrNv9MoshzyMFK/R57JBm94/6HSL4vHnDeEmxlC82NQ4A==} @@ -5604,7 +5604,7 @@ packages: is-callable: 1.2.4 is-negative-zero: 2.0.2 is-regex: 1.1.4 - is-shared-array-buffer: 1.0.1 + is-shared-array-buffer: 1.0.2 is-string: 1.0.7 is-weakref: 1.0.2 object-inspect: 1.12.0 @@ -5642,8 +5642,8 @@ packages: requiresBuild: true optional: true - /esbuild-android-64/0.14.28: - resolution: {integrity: sha512-A52C3zq+9tNwCqZ+4kVLBxnk/WnrYM8P2+QNvNE9B6d2OVPs214lp3g6UyO+dKDhUdefhfPCuwkP8j2A/+szNA==} + /esbuild-android-64/0.14.30: + resolution: {integrity: sha512-vdJ7t8A8msPfKpYUGUV/KaTQRiZ0vDa2XSTlzXVkGGVHLKPeb85PBUtYJcEgw3htW3IdX5i1t1IMdQCwJJgNAg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -5659,8 +5659,8 @@ packages: requiresBuild: true optional: true - /esbuild-android-arm64/0.14.28: - resolution: {integrity: sha512-sm0fDEGElZhMC3HLZeECI2juE4aG7uPfMBMqNUhy9CeX399Pz8rC6e78OXMXInGjSdEAwQmCOHmfsP7uv3Q8rA==} + /esbuild-android-arm64/0.14.30: + resolution: {integrity: sha512-BdgGfxeA5hBQNErLr7BWJUA8xjflEfyaARICy8e0OJYNSAwDbEzOf8LyiKWSrDcgV129mWhi3VpbNQvOIDEHcg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -5676,8 +5676,8 @@ packages: requiresBuild: true optional: true - /esbuild-darwin-64/0.14.28: - resolution: {integrity: sha512-nzDd7mQ44FvsFHtOafZdBgn3Li5SMsnMnoz1J2MM37xJmR3wGNTFph88KypjHgWqwbxCI7MXS1U+sN4qDeeW6Q==} + /esbuild-darwin-64/0.14.30: + resolution: {integrity: sha512-VRaOXMMrsG5n53pl4qFZQdXy2+E0NoLP/QH3aDUI0+bQP+ZHDmbINKcDy2IX7GVFI9kqPS18iJNAs5a6/G2LZg==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -5693,8 +5693,8 @@ packages: requiresBuild: true optional: true - /esbuild-darwin-arm64/0.14.28: - resolution: {integrity: sha512-XEq/bLR/glsUl+uGrBimQzOVs/CmwI833fXUhP9xrLI3IJ+rKyrZ5IA8u+1crOEf1LoTn8tV+hInmX6rGjbScw==} + /esbuild-darwin-arm64/0.14.30: + resolution: {integrity: sha512-qDez+fHMOrO9Oc9qjt/x+sy09RJVh62kik5tVybKRLmezeV4qczM9/sAYY57YN0aWLdHbcCj2YqJUWYJNsgKnw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -5710,8 +5710,8 @@ packages: requiresBuild: true optional: true - /esbuild-freebsd-64/0.14.28: - resolution: {integrity: sha512-rTKLgUj/HEcPeE5XZ7IZwWpFx7IWMfprN7QRk/TUJE1s1Ipb58esboIesUpjirJz/BwrgHq+FDG9ChAI8dZAtQ==} + /esbuild-freebsd-64/0.14.30: + resolution: {integrity: sha512-mec1jENcImVVagddZlGWsdAUwBnzR5cgnhzCxv+9fSMxKbx1uZYLLUAnLPp8m/i934zrumR1xGjJ5VoWdPlI2w==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -5727,8 +5727,8 @@ packages: requiresBuild: true optional: true - /esbuild-freebsd-arm64/0.14.28: - resolution: {integrity: sha512-sBffxD1UMOsB7aWMoExmipycjcy3HJGwmqE4GQZUTZvdiH4GhjgUiVdtPyt7kSCdL40JqnWQJ4b1l8Y51oCF4Q==} + /esbuild-freebsd-arm64/0.14.30: + resolution: {integrity: sha512-cpjbTs6Iok/AfeB0JgTzyUJTMStC1SQULmany5nHx6S4GTkSgaAHuJzZO0GcVWqghI4e0YL/bjXAhN5Mn6feNw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -5744,8 +5744,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-32/0.14.28: - resolution: {integrity: sha512-+Wxidh3fBEQ9kHcCsD4etlBTMb1n6QY2uXv3rFhVn88CY/JP782MhA57/ipLMY4kOLeSKEuFGN4rtjHuhmRMig==} + /esbuild-linux-32/0.14.30: + resolution: {integrity: sha512-liIONVT4F2kZmOMwtwASqZ8WkIjb5HHBR9HUffdHiuotSTF3CyZO+EJf+Og+SYYuuVIvt0qHNSFjBA/iSESteQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -5761,8 +5761,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-64/0.14.28: - resolution: {integrity: sha512-7+xgsC4LvR6cnzaBdiljNnPDjbkwzahogN+S9uy9AoYw7ZjPnnXc6sjQAVCbqGb7MEgrWdpa6u/Tao79i4lWxg==} + /esbuild-linux-64/0.14.30: + resolution: {integrity: sha512-LUnpzoMpRqFON5En4qEj6NWiyH6a1K+Y2qYNKrCy5qPTjDoG/EWeqMz69n8Uv7pRuvDKl3FNGJ1dufTrA5i0sw==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -5778,8 +5778,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-arm/0.14.28: - resolution: {integrity: sha512-L5isjmlLbh9E0WVllXiVETbScgMbth/+XkXQii1WwgO1RvLIfaGrVFz8d2n6EH/ImtgYxPYGx+OcvIKQBc91Rg==} + /esbuild-linux-arm/0.14.30: + resolution: {integrity: sha512-97T+bbXnpqf7mfIG49UR7ZSJFGgvc22byn74qw3Kx2GDCBSQoVFjyWuKOHGXp8nXk3XYrdFF+mQ8yQ7aNsgQvg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -5795,8 +5795,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-arm64/0.14.28: - resolution: {integrity: sha512-EjRHgwg+kgXABzyoPGPOPg4d5wZqRnZ/ZAxBDzLY+i6DS8OUfTSlZHWIOZzU4XF7125WxRBg9ULbrFJBl+57Eg==} + /esbuild-linux-arm64/0.14.30: + resolution: {integrity: sha512-DHZHn6FK5q/KL0fpNT/0jE38Nnyk2rXxKE9WENi95EXtqfOLPgE8tzjTZQNgpr61R95QX4ymQU26ni3IZk8buQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -5812,8 +5812,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-mips64le/0.14.28: - resolution: {integrity: sha512-krx9SSg7yfiUKk64EmjefOyiEF6nv2bRE4um/LiTaQ6Y/6FP4UF3/Ou/AxZVyR154uSRq63xejcAsmswXAYRsw==} + /esbuild-linux-mips64le/0.14.30: + resolution: {integrity: sha512-fLUzTFZ7uknC0aPTk7/lM7NmaG/9ZqE3SaHEphcaM009SZK/mDOvZugWi1ss6WGNhk13dUrhkfHcc4FSb9hYhg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -5829,8 +5829,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-ppc64le/0.14.28: - resolution: {integrity: sha512-LD0Xxu9g+DNuhsEBV5QuVZ4uKVBMup0xPIruLweuAf9/mHXFnaCuNXUBF5t0DxKl7GQ5MSioKtnb92oMo+QXEw==} + /esbuild-linux-ppc64le/0.14.30: + resolution: {integrity: sha512-2Oudm2WEfj0dNU9bzIl5L/LrsMEmHWsOsYgJJqu8fDyUDgER+J1d33qz3cUdjsJk7gAENayIxDSpsuCszx0w3A==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -5846,8 +5846,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-riscv64/0.14.28: - resolution: {integrity: sha512-L/DWfRh2P0vxq4Y+qieSNXKGdMg+e9Qe8jkbN2/8XSGYDTPzO2OcAxSujob4qIh7iSl+cknbXV+BvH0YFR0jbg==} + /esbuild-linux-riscv64/0.14.30: + resolution: {integrity: sha512-RPMucPW47rV4t2jlelaE948iCRtbZf5RhifxSwzlpM1Mqdyu99MMNK0w4jFreGTmLN+oGomxIOxD6n+2E/XqHw==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -5863,8 +5863,8 @@ packages: requiresBuild: true optional: true - /esbuild-linux-s390x/0.14.28: - resolution: {integrity: sha512-rrgxmsbmL8QQknWGnAL9bGJRQYLOi2AzXy5OTwfhxnj9eqjo5mSVbJXjgiq5LPUAMQZGdPH5yaNK0obAXS81Zw==} + /esbuild-linux-s390x/0.14.30: + resolution: {integrity: sha512-OZ68r7ok6qO7hdwrwQn2p5jbIRRcUcVaAykB7e0uCA0ODwfeGunILM6phJtq2Oz4dlEEFvd+tSuma3paQKwt+A==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -5880,8 +5880,8 @@ packages: requiresBuild: true optional: true - /esbuild-netbsd-64/0.14.28: - resolution: {integrity: sha512-h8wntIyOR8/xMVVM6TvJxxWKh4AjmLK87IPKpuVi8Pq0kyk0RMA+eo4PFGk5j2XK0D7dj8PcSF5NSlP9kN/j0A==} + /esbuild-netbsd-64/0.14.30: + resolution: {integrity: sha512-iyejQUKn0TzpPkufq8pSCxOg9NheycQbMbPCmjefTe9wYuUlBt1TcHvdoJnYbQzsAhAh1BNq+s0ycRsIJFZzaQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -5897,8 +5897,8 @@ packages: requiresBuild: true optional: true - /esbuild-openbsd-64/0.14.28: - resolution: {integrity: sha512-HBv18rVapbuDx52/fhZ/c/w6TXyaQAvRxiDDn5Hz/pBcwOs3cdd2WxeIKlWmDoqm2JMx5EVlq4IWgoaRX9mVkw==} + /esbuild-openbsd-64/0.14.30: + resolution: {integrity: sha512-UyK1MTMcy4j5fH260fsE1o6MVgWNhb62eCK2yCKCRazZv8Nqdc2WiP9ygjWidmEdCDS+A6MuVp9ozk9uoQtQpA==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -5914,8 +5914,8 @@ packages: requiresBuild: true optional: true - /esbuild-sunos-64/0.14.28: - resolution: {integrity: sha512-zlIxePhZxKYheR2vBCgPVvTixgo/ozOfOMoP6RZj8dxzquU1NgeyhjkcRXucbLCtmoNJ+i4PtWwPZTLuDd3bGg==} + /esbuild-sunos-64/0.14.30: + resolution: {integrity: sha512-aQRtRTNKHB4YuG+xXATe5AoRTNY48IJg5vjE8ElxfmjO9+KdX7MHFkTLhlKevCD6rNANtB3qOlSIeAiXTwHNqw==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -5931,8 +5931,8 @@ packages: requiresBuild: true optional: true - /esbuild-windows-32/0.14.28: - resolution: {integrity: sha512-am9DIJxXlld1BOAY/VlvBQHMUCPL7S3gB/lnXIY3M4ys0gfuRqPf4EvMwZMzYUbFKBY+/Qb8SRgPRRGhwnJ8Kg==} + /esbuild-windows-32/0.14.30: + resolution: {integrity: sha512-9/fb1tPtpacMqxAXp3fGHowUDg/l9dVch5hKmCLEZC6PdGljh6h372zMdJwYfH0Bd5CCPT0Wx95uycBLJiqpXA==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -5948,8 +5948,8 @@ packages: requiresBuild: true optional: true - /esbuild-windows-64/0.14.28: - resolution: {integrity: sha512-78PhySDnmRZlsPNp/W/5Fim8iivlBQQxfhBFIqR7xwvfDmCFUSByyMKP7LCHgNtb04yNdop8nJJkJaQ8Xnwgiw==} + /esbuild-windows-64/0.14.30: + resolution: {integrity: sha512-DHgITeUhPAnN9I5O6QBa1GVyPOhiYCn4S4TtQr7sO4+X0LNyqnlmA1M0qmGkUdDC1QQfjI8uQ4G/whdWb2pWIQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -5965,8 +5965,8 @@ packages: requiresBuild: true optional: true - /esbuild-windows-arm64/0.14.28: - resolution: {integrity: sha512-VhXGBTo6HELD8zyHXynV6+L2jWx0zkKnGx4TmEdSBK7UVFACtOyfUqpToG0EtnYyRZ0HESBhzPSVpP781ovmvA==} + /esbuild-windows-arm64/0.14.30: + resolution: {integrity: sha512-F1kLyQH7zSgjh5eLxogGZN7C9+KNs9m+s7Q6WZoMmCWT/6j998zlaoECHyM8izJRRfsvw2eZlEa1jO6/IOU1AQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -6001,32 +6001,32 @@ packages: esbuild-windows-64: 0.14.25 esbuild-windows-arm64: 0.14.25 - /esbuild/0.14.28: - resolution: {integrity: sha512-YLNprkCcMVKQ5sekmCKEQ3Obu/L7s6+iij38xNKyBeSmSsTWur4Ky/9zB3XIGT8SCJITG/bZwAR2l7YOAXch4Q==} + /esbuild/0.14.30: + resolution: {integrity: sha512-wCecQSBkIjp2xjuXY+wcXS/PpOQo9rFh4NAKPh4Pm9f3fuLcnxkR0rDzA+mYP88FtXIUcXUyYmaIgfrzRl55jA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - esbuild-android-64: 0.14.28 - esbuild-android-arm64: 0.14.28 - esbuild-darwin-64: 0.14.28 - esbuild-darwin-arm64: 0.14.28 - esbuild-freebsd-64: 0.14.28 - esbuild-freebsd-arm64: 0.14.28 - esbuild-linux-32: 0.14.28 - esbuild-linux-64: 0.14.28 - esbuild-linux-arm: 0.14.28 - esbuild-linux-arm64: 0.14.28 - esbuild-linux-mips64le: 0.14.28 - esbuild-linux-ppc64le: 0.14.28 - esbuild-linux-riscv64: 0.14.28 - esbuild-linux-s390x: 0.14.28 - esbuild-netbsd-64: 0.14.28 - esbuild-openbsd-64: 0.14.28 - esbuild-sunos-64: 0.14.28 - esbuild-windows-32: 0.14.28 - esbuild-windows-64: 0.14.28 - esbuild-windows-arm64: 0.14.28 + esbuild-android-64: 0.14.30 + esbuild-android-arm64: 0.14.30 + esbuild-darwin-64: 0.14.30 + esbuild-darwin-arm64: 0.14.30 + esbuild-freebsd-64: 0.14.30 + esbuild-freebsd-arm64: 0.14.30 + esbuild-linux-32: 0.14.30 + esbuild-linux-64: 0.14.30 + esbuild-linux-arm: 0.14.30 + esbuild-linux-arm64: 0.14.30 + esbuild-linux-mips64le: 0.14.30 + esbuild-linux-ppc64le: 0.14.30 + esbuild-linux-riscv64: 0.14.30 + esbuild-linux-s390x: 0.14.30 + esbuild-netbsd-64: 0.14.30 + esbuild-openbsd-64: 0.14.30 + esbuild-sunos-64: 0.14.30 + esbuild-windows-32: 0.14.30 + esbuild-windows-64: 0.14.30 + esbuild-windows-arm64: 0.14.30 dev: false /escalade/3.1.1: @@ -6069,7 +6069,7 @@ packages: eslint: 8.12.0 dev: true - /eslint-plugin-prettier/4.0.0_b253a92c95b42c3296c682f11cccb3bd: + /eslint-plugin-prettier/4.0.0_f2c91d0f54113167d2bd9214a5ab5a36: resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==} engines: {node: '>=6.0.0'} peerDependencies: @@ -6082,7 +6082,7 @@ packages: dependencies: eslint: 8.12.0 eslint-config-prettier: 8.5.0_eslint@8.12.0 - prettier: 2.6.1 + prettier: 2.6.2 prettier-linter-helpers: 1.0.0 dev: true @@ -6740,7 +6740,7 @@ packages: hast-util-to-parse5: 7.0.0 html-void-elements: 2.0.1 parse5: 6.0.1 - unist-util-position: 4.0.2 + unist-util-position: 4.0.3 unist-util-visit: 4.1.0 vfile: 5.3.2 web-namespaces: 2.0.1 @@ -6752,7 +6752,7 @@ packages: dependencies: '@types/hast': 2.3.4 '@types/unist': 2.0.6 - bcp-47-match: 2.0.1 + bcp-47-match: 2.0.2 comma-separated-tokens: 2.0.2 css-selector-parser: 1.4.1 direction: 2.0.1 @@ -7105,8 +7105,8 @@ packages: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} - /is-number-object/1.0.6: - resolution: {integrity: sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==} + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 @@ -7165,8 +7165,10 @@ packages: engines: {node: '>=0.10.0'} dev: true - /is-shared-array-buffer/1.0.1: - resolution: {integrity: sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==} + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 /is-stream/2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} @@ -7665,7 +7667,7 @@ packages: micromark-util-sanitize-uri: 1.0.0 unist-builder: 3.0.0 unist-util-generated: 2.0.0 - unist-util-position: 4.0.2 + unist-util-position: 4.0.3 unist-util-visit: 4.1.0 dev: false @@ -8615,10 +8617,10 @@ packages: postcss: ^8.2.14 dependencies: postcss: 8.4.12 - postcss-selector-parser: 6.0.9 + postcss-selector-parser: 6.0.10 - /postcss-selector-parser/6.0.9: - resolution: {integrity: sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ==} + /postcss-selector-parser/6.0.10: + resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==} engines: {node: '>=4'} dependencies: cssesc: 3.0.0 @@ -8635,17 +8637,21 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /preact-render-to-string/5.1.20_preact@10.6.6: + /preact-render-to-string/5.1.20_preact@10.7.0: resolution: {integrity: sha512-ivh2oOGzth0o7XqbatWUQ81WQGoJwSqDKP5z917SoqTWYCAr7dlBzMv3SAMTAu3Gr5g47BJwrvyO44H2Y10ubg==} peerDependencies: preact: '>=10' dependencies: - preact: 10.6.6 + preact: 10.7.0 pretty-format: 3.8.0 dev: false /preact/10.6.6: resolution: {integrity: sha512-dgxpTFV2vs4vizwKohYKkk7g7rmp1wOOcfd4Tz3IB3Wi+ivZzsn/SpeKJhRENSE+n8sUfsAl4S3HiCVT923ABw==} + dev: false + + /preact/10.7.0: + resolution: {integrity: sha512-9MEURwzNMKpAil/t6+wabDIJI6oG6GnwypYxiJDvQnW+fHDTt51PYuLZ1QUM31hFr7sDaj9qTaShAF9VIxuxGQ==} /prebuild-install/7.0.1: resolution: {integrity: sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg==} @@ -8699,8 +8705,8 @@ packages: hasBin: true dev: true - /prettier/2.6.1: - resolution: {integrity: sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==} + /prettier/2.6.2: + resolution: {integrity: sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==} engines: {node: '>=10.13.0'} hasBin: true dev: true @@ -9204,8 +9210,8 @@ packages: rimraf: 2.7.1 dev: false - /sass/1.49.9: - resolution: {integrity: sha512-YlYWkkHP9fbwaFRZQRXgDi3mXZShslVmmo+FVK3kHLUELHHEYrCmL1x6IUjC7wLS6VuJSAFXRQS/DxdsC4xL1A==} + /sass/1.49.11: + resolution: {integrity: sha512-wvS/geXgHUGs6A/4ud5BFIWKO1nKd7wYIGimDk4q4GFkJicILActpv9ueMT4eRGSsp1BdKHuw1WwAHXbhsJELQ==} engines: {node: '>=12.0.0'} hasBin: true dependencies: @@ -9719,16 +9725,16 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr/0.14.11_svelte@3.46.4: + /svelte-hmr/0.14.11_svelte@3.46.6: resolution: {integrity: sha512-R9CVfX6DXxW1Kn45Jtmx+yUe+sPhrbYSUp7TkzbW0jI5fVPn6lsNG9NEs5dFg5qRhFNAoVdRw5qQDLALNKhwbQ==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.46.4 + svelte: 3.46.6 dev: false - /svelte-preprocess/4.10.4_ec4868a778d68da3f0d21a10f4ea83cd: + /svelte-preprocess/4.10.4_4fb28cead04100f31b0e8b0196137d75: resolution: {integrity: sha512-fuwol0N4UoHsNQolLFbMqWivqcJ9N0vfWO9IuPAiX/5okfoGXURyJ6nECbuEIv0nU3M8Xe2I1ONNje2buk7l6A==} engines: {node: '>= 9.11.2'} requiresBuild: true @@ -9776,11 +9782,11 @@ packages: postcss-load-config: 3.1.4 sorcery: 0.10.0 strip-indent: 3.0.0 - svelte: 3.46.4 + svelte: 3.46.6 typescript: 4.6.3 dev: false - /svelte-preprocess/4.10.4_svelte@3.46.4+typescript@4.6.3: + /svelte-preprocess/4.10.4_svelte@3.46.6+typescript@4.6.3: resolution: {integrity: sha512-fuwol0N4UoHsNQolLFbMqWivqcJ9N0vfWO9IuPAiX/5okfoGXURyJ6nECbuEIv0nU3M8Xe2I1ONNje2buk7l6A==} engines: {node: '>= 9.11.2'} requiresBuild: true @@ -9827,15 +9833,15 @@ packages: magic-string: 0.25.9 sorcery: 0.10.0 strip-indent: 3.0.0 - svelte: 3.46.4 + svelte: 3.46.6 typescript: 4.6.3 dev: false - /svelte/3.46.4: - resolution: {integrity: sha512-qKJzw6DpA33CIa+C/rGp4AUdSfii0DOTCzj/2YpSKKayw5WGSS624Et9L1nU1k2OVRS9vaENQXp2CVZNU+xvIg==} + /svelte/3.46.6: + resolution: {integrity: sha512-o9nNft/OzCz/9kJpmWa1S52GAM+huCjPIsNWydYmgei74ZWlOA9/hN9+Z12INdklghu31seEXZMRHhS1+8DETw==} engines: {node: '>= 8'} - /svelte2tsx/0.5.6_svelte@3.46.4+typescript@4.6.3: + /svelte2tsx/0.5.6_svelte@3.46.6+typescript@4.6.3: resolution: {integrity: sha512-B4WZUtoTdVD+F73H1RQEH3Hrv7m2/ahThmAUkjT5CTWRigQaJqYQpSjisCH1Pzfi9B37YikDnAi4u4uxwYM+iw==} peerDependencies: svelte: ^3.24 @@ -9843,7 +9849,7 @@ packages: dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: 3.46.4 + svelte: 3.46.6 typescript: 4.6.3 dev: false @@ -9872,7 +9878,7 @@ packages: postcss-js: 4.0.0_postcss@8.4.12 postcss-load-config: 3.1.4_postcss@8.4.12 postcss-nested: 5.0.6_postcss@8.4.12 - postcss-selector-parser: 6.0.9 + postcss-selector-parser: 6.0.10 postcss-value-parser: 4.2.0 quick-lru: 5.1.1 resolve: 1.22.0 @@ -10224,8 +10230,8 @@ packages: engines: {node: '>=8'} dev: true - /type-fest/2.12.1: - resolution: {integrity: sha512-AiknQSEqKVGDDjtZqeKrUoTlcj7FKhupmnVUgz6KoOKtvMwRGE6hUNJ/nVear+h7fnUPO1q/htSkYKb1pyntkQ==} + /type-fest/2.12.2: + resolution: {integrity: sha512-qt6ylCGpLjZ7AaODxbpyBZSs9fCI9SkL3Z9q2oxMBQhs/uyY+VD8jHA8ULCGmWQJlBgqvO3EJeAngOHD8zQCrQ==} engines: {node: '>=12.20'} dev: false @@ -10330,8 +10336,8 @@ packages: '@types/unist': 2.0.6 dev: false - /unist-util-position/4.0.2: - resolution: {integrity: sha512-Y6+plxR41dOLbyyqVDLuGWgXDmxdXslCSRYQkSDagBnOT9oFsQH0J8FzhirSklUEe0xZTT0WDnAE1gXPaDFljA==} + /unist-util-position/4.0.3: + resolution: {integrity: sha512-p/5EMGIa1qwbXjA+QgcBXaPWjSnZfQ2Sc3yBEEfgPwsEmJd8Qh+DSk3LGnmOM4S1bY2C0AjmMnB8RuEYxpPwXQ==} dependencies: '@types/unist': 2.0.6 dev: false @@ -10525,8 +10531,8 @@ packages: - supports-color dev: true - /vite/2.8.6: - resolution: {integrity: sha512-e4H0QpludOVKkmOsRyqQ7LTcMUDF3mcgyNU4lmi0B5JUbe0ZxeBBl8VoZ8Y6Rfn9eFKYtdXNPcYK97ZwH+K2ug==} + /vite/2.9.1: + resolution: {integrity: sha512-vSlsSdOYGcYEJfkQ/NeLXgnRv5zZfpAsdztkIrs7AZHV8RCMZQkwjo4DS5BnrYTqoWqLoUe1Cah4aVO4oNNqCQ==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -10541,7 +10547,7 @@ packages: stylus: optional: true dependencies: - esbuild: 0.14.28 + esbuild: 0.14.30 postcss: 8.4.12 resolve: 1.22.0 rollup: 2.70.1 @@ -10549,8 +10555,8 @@ packages: fsevents: 2.3.2 dev: false - /vite/2.8.6_sass@1.49.9: - resolution: {integrity: sha512-e4H0QpludOVKkmOsRyqQ7LTcMUDF3mcgyNU4lmi0B5JUbe0ZxeBBl8VoZ8Y6Rfn9eFKYtdXNPcYK97ZwH+K2ug==} + /vite/2.9.1_sass@1.49.11: + resolution: {integrity: sha512-vSlsSdOYGcYEJfkQ/NeLXgnRv5zZfpAsdztkIrs7AZHV8RCMZQkwjo4DS5BnrYTqoWqLoUe1Cah4aVO4oNNqCQ==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -10565,11 +10571,11 @@ packages: stylus: optional: true dependencies: - esbuild: 0.14.28 + esbuild: 0.14.30 postcss: 8.4.12 resolve: 1.22.0 rollup: 2.70.1 - sass: 1.49.9 + sass: 1.49.11 optionalDependencies: fsevents: 2.3.2 dev: false @@ -10583,8 +10589,8 @@ packages: acorn-walk: 8.2.0 dev: true - /vscode-css-languageservice/5.3.0: - resolution: {integrity: sha512-ujWW855AoJlE4ETU17Gff7unlZZTHDA0w26itk9EQFMfJqi9lE6S67zOsMvcPmJf55MrnGQbojDYZRiDVaFjdA==} + /vscode-css-languageservice/5.4.1: + resolution: {integrity: sha512-W7D3GKFXf97ReAaU4EZ2nxVO1kQhztbycJgc1b/Ipr0h8zYWr88BADmrXu02z+lsCS84D7Sr4hoUzDKeaFn2Kg==} dependencies: vscode-languageserver-textdocument: 1.0.4 vscode-languageserver-types: 3.16.0 @@ -10696,7 +10702,7 @@ packages: dependencies: is-bigint: 1.0.4 is-boolean-object: 1.1.2 - is-number-object: 1.0.6 + is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.4 diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index 3a182c656..b2d402890 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -26,9 +26,17 @@ export default async function build(...args) { const patterns = args .filter((f) => !!f) // remove empty args .map((f) => f.replace(/^'/, '').replace(/'$/, '')); // Needed for Windows: glob strings contain surrounding string chars??? remove these - let entryPoints = [].concat(...(await Promise.all(patterns.map((pattern) => glob(pattern, { filesOnly: true, absolute: true }))))); + let entryPoints = [].concat( + ...(await Promise.all( + patterns.map((pattern) => glob(pattern, { filesOnly: true, absolute: true })) + )) + ); - const { type = 'module', version, dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString())); + const { + type = 'module', + version, + dependencies = {}, + } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString())); // expose PACKAGE_VERSION on process.env for CLI utils config.define = { 'process.env.PACKAGE_VERSION': JSON.stringify(version) }; const format = type === 'module' ? 'esm' : 'cjs'; @@ -56,7 +64,9 @@ export default async function build(...args) { console.error(dim(`[${date}] `) + red(error || result.errors.join('\n'))); } else { if (result.warnings.length) { - console.log(dim(`[${date}] `) + yellow('⚠ updated with warnings:\n' + result.warnings.join('\n'))); + console.log( + dim(`[${date}] `) + yellow('⚠ updated with warnings:\n' + result.warnings.join('\n')) + ); } console.log(dim(`[${date}] `) + green('βœ” updated')); } diff --git a/scripts/cmd/copy.js b/scripts/cmd/copy.js index 925990fe4..1700e56c4 100644 --- a/scripts/cmd/copy.js +++ b/scripts/cmd/copy.js @@ -63,7 +63,9 @@ export default async function copy() { await Promise.all( files.map((file) => { const dest = resolve(file.replace(/^[^/]+/, 'dist')); - return fs.mkdir(dirname(dest), { recursive: true }).then(() => fs.copyFile(resolve(file), dest)); + return fs + .mkdir(dirname(dest), { recursive: true }) + .then(() => fs.copyFile(resolve(file), dest)); }) ); } diff --git a/scripts/memory/index.js b/scripts/memory/index.js index 969b1bb17..da55acb71 100644 --- a/scripts/memory/index.js +++ b/scripts/memory/index.js @@ -18,8 +18,6 @@ let config = await loadConfig({ cwd: fileURLToPath(projDir), }); -config.buildOptions.legacyBuild = false; - const server = await dev(config, { logging: { level: 'error' } }); // Prime the server so initial memory is created @@ -37,7 +35,9 @@ const startSize = v8.getHeapStatistics().used_heap_size; // HUMAN mode: Runs forever. Optimized for accurate results on each snapshot Slower than CI. if (!isCI) { - console.log(`Greetings, human. This test will run forever. Run with the "--ci" flag to finish with a result.`); + console.log( + `Greetings, human. This test will run forever. Run with the "--ci" flag to finish with a result.` + ); let i = 1; while (i++) { await run(); @@ -64,7 +64,9 @@ const TEST_THRESHOLD = 1.5; const isPass = percentage < TEST_THRESHOLD; console.log(``); console.log(`Result: ${isPass ? 'PASS' : 'FAIL'} (${percentage * 100}%)`); -console.log(`Memory usage began at ${prettyBytes(startSize)} and finished at ${prettyBytes(endSize)}.`); +console.log( + `Memory usage began at ${prettyBytes(startSize)} and finished at ${prettyBytes(endSize)}.` +); console.log(`The threshold for a probable memory leak is ${TEST_THRESHOLD * 100}%`); console.log(``); console.log(`Exiting...`); diff --git a/scripts/notify/index.js b/scripts/notify/index.js index a0505c9ae..fa699372a 100755 --- a/scripts/notify/index.js +++ b/scripts/notify/index.js @@ -5,7 +5,16 @@ import { readFile } from 'node:fs/promises'; const baseUrl = new URL('https://github.com/withastro/astro/blob/main/'); const emojis = ['πŸŽ‰', 'πŸ₯³', 'πŸš€', 'πŸ§‘β€πŸš€', '🎊', 'πŸ†', 'βœ…', '🀩', 'πŸ€–', 'πŸ™Œ']; -const descriptors = ['new releases', 'hot and fresh updates', 'shiny updates', 'exciting changes', 'package updates', 'awesome updates', 'bug fixes and features', 'updates']; +const descriptors = [ + 'new releases', + 'hot and fresh updates', + 'shiny updates', + 'exciting changes', + 'package updates', + 'awesome updates', + 'bug fixes and features', + 'updates', +]; const verbs = [ 'just went out!', 'just launched!', @@ -47,7 +56,9 @@ const plurals = new Map([ ]); function pluralize(text) { - return text.replace(/(\[([^\]]+)\])/gm, (_, _full, match) => (plurals.has(match) ? plurals.get(match) : `${match}s`)); + return text.replace(/(\[([^\]]+)\])/gm, (_, _full, match) => + plurals.has(match) ? plurals.get(match) : `${match}s` + ); } function singularlize(text) { @@ -57,7 +68,9 @@ function singularlize(text) { const packageMap = new Map(); async function generatePackageMap() { const packageRoot = new URL('../../packages/', import.meta.url); - const packages = await glob(['*/package.json', '*/*/package.json'], { cwd: fileURLToPath(packageRoot) }); + const packages = await glob(['*/package.json', '*/*/package.json'], { + cwd: fileURLToPath(packageRoot), + }); await Promise.all( packages.map(async (pkg) => { const pkgFile = fileURLToPath(new URL(pkg, packageRoot)); @@ -77,7 +90,11 @@ async function run() { if (!p) { throw new Error(`Unable to find entrypoint for "${name}"!`); } - return { name, version, url: new URL(`${p}/CHANGELOG.md#${version.replace(/\./g, '')}`, baseUrl).toString() }; + return { + name, + version, + url: new URL(`${p}/CHANGELOG.md#${version.replace(/\./g, '')}`, baseUrl).toString(), + }; }) ); @@ -87,7 +104,9 @@ async function run() { if (packages.length === 1) { const { name, version, url } = packages[0]; - console.log(`${emoji} \`${name}@${version}\` ${singularlize(verb)}\nRead the [release notes β†’](<${url}>)`); + console.log( + `${emoji} \`${name}@${version}\` ${singularlize(verb)}\nRead the [release notes β†’](<${url}>)` + ); } else { console.log(`${emoji} Some ${descriptor} ${pluralize(verb)}\n`); for (const { name, version, url } of packages) { diff --git a/scripts/package.json b/scripts/package.json index c66bd0f48..d0d04dfae 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -18,7 +18,7 @@ "esbuild": "0.14.25", "globby": "^12.2.0", "kleur": "^4.1.4", - "svelte": "^3.46.4", + "svelte": "^3.46.6", "tar": "^6.1.11" } } diff --git a/scripts/stats/index.js b/scripts/stats/index.js index 435bb5c56..659df2f2b 100644 --- a/scripts/stats/index.js +++ b/scripts/stats/index.js @@ -78,12 +78,21 @@ export async function run() { per_page: 100, since: twentyFourHoursAgo.toISOString(), }); - const issuesLastTwentyFourHours = allIssuesLastTwentyFourHours.filter((iss) => new Date(iss.created_at) > twentyFourHoursAgo && !iss.pull_request); - const pullsLastTwentyFourHours = allIssuesLastTwentyFourHours.filter((iss) => new Date(iss.created_at) > twentyFourHoursAgo && iss.pull_request); + const issuesLastTwentyFourHours = allIssuesLastTwentyFourHours.filter( + (iss) => new Date(iss.created_at) > twentyFourHoursAgo && !iss.pull_request + ); + const pullsLastTwentyFourHours = allIssuesLastTwentyFourHours.filter( + (iss) => new Date(iss.created_at) > twentyFourHoursAgo && iss.pull_request + ); const entry = [ // Date (Human Readable) - `"${new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}"`, + `"${new Date().toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric', + })}"`, // Commits in last 24 hours (await countCommits(twentyFourHoursAgo)).length, // New Issues(All) in last 24 hours @@ -103,7 +112,8 @@ export async function run() { // Bugs: Needs Triage (await countCards(COLUMN_ID_BUGS_NEEDS_TRIAGE)).length, // Bugs: Accepted - (await countCards(COLUMN_ID_BUGS_ACCEPTED)).length + (await countCards(COLUMN_ID_BUGS_PRIORITIZED)).length, + (await countCards(COLUMN_ID_BUGS_ACCEPTED)).length + + (await countCards(COLUMN_ID_BUGS_PRIORITIZED)).length, // RFC: In Progress 0, // (await countCards(COLUMN_ID_RFCS_IN_PROGRESS)).length, // RFC: Accepted diff --git a/scripts/stats/stats.csv b/scripts/stats/stats.csv index 7ab3641a8..dcf1654ca 100644 --- a/scripts/stats/stats.csv +++ b/scripts/stats/stats.csv @@ -1,4 +1,6 @@ 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) +"Saturday, April 2, 2022",5,0,0,0,0,4,8,88,42,40,0,0,"2022-04-02T12:01:53.880Z" +"Friday, April 1, 2022",13,0,0,0,0,7,7,90,43,41,0,0,"2022-04-01T12:04:00.672Z" "Thursday, March 31, 2022",6,4,4,0,0,6,10,93,46,41,0,0,"2022-03-31T12:02:11.044Z" "Wednesday, March 30, 2022",9,2,2,0,0,10,10,90,43,41,0,0,"2022-03-30T12:02:39.303Z" "Tuesday, March 29, 2022",19,8,8,0,0,9,5,88,41,41,0,0,"2022-03-29T12:06:39.897Z" diff --git a/scripts/utils/svelte-plugin.js b/scripts/utils/svelte-plugin.js index 29e60c2d5..4bbd8cdaf 100644 --- a/scripts/utils/svelte-plugin.js +++ b/scripts/utils/svelte-plugin.js @@ -26,7 +26,12 @@ const handleLoad = async (args, generate, { isDev }) => { let { js, warnings } = compile(source, { ...compileOptions, filename }); let contents = js.code + `\n//# sourceMappingURL=` + js.map.toUrl(); - return { loader: 'js', contents, resolveDir: dirname(path), warnings: warnings.map((w) => convertMessage(w)) }; + return { + loader: 'js', + contents, + resolveDir: dirname(path), + warnings: warnings.map((w) => convertMessage(w)), + }; } catch (e) { return { errors: [convertMessage(e)] }; } @@ -54,8 +59,12 @@ export default function sveltePlugin({ isDev = false }) { }; } }); - build.onLoad({ filter: /.*/, namespace: 'svelte:client' }, (args) => handleLoad(args, 'dom', { isDev })); - build.onLoad({ filter: /.*/, namespace: 'svelte:server' }, (args) => handleLoad(args, 'ssr', { isDev })); + build.onLoad({ filter: /.*/, namespace: 'svelte:client' }, (args) => + handleLoad(args, 'dom', { isDev }) + ); + build.onLoad({ filter: /.*/, namespace: 'svelte:server' }, (args) => + handleLoad(args, 'ssr', { isDev }) + ); }, }; }