From 80e6e759e2b8a0bf5510f050a3e04a53b97d180c Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 31 Mar 2022 22:33:07 -0500 Subject: [PATCH 01/19] Update compiler (#2957) * chore: update compiler * chore: add changeset --- .changeset/soft-avocados-turn.md | 5 +++++ packages/astro/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/soft-avocados-turn.md diff --git a/.changeset/soft-avocados-turn.md b/.changeset/soft-avocados-turn.md new file mode 100644 index 000000000..e2669198e --- /dev/null +++ b/.changeset/soft-avocados-turn.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Update `@astrojs/compiler`, fixing some bugs related to RegExp usage in frontmatter diff --git a/packages/astro/package.json b/packages/astro/package.json index 8ca558d6b..f2cb9f967 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -73,7 +73,7 @@ "test:match": "mocha --timeout 20000 -g" }, "dependencies": { - "@astrojs/compiler": "^0.13.1", + "@astrojs/compiler": "^0.13.2", "@astrojs/language-server": "^0.13.2", "@astrojs/markdown-remark": "^0.7.0", "@astrojs/prism": "0.4.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93c0b6626..814dbf0e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -442,7 +442,7 @@ importers: packages/astro: specifiers: - '@astrojs/compiler': ^0.13.1 + '@astrojs/compiler': ^0.13.2 '@astrojs/language-server': ^0.13.2 '@astrojs/markdown-remark': ^0.7.0 '@astrojs/prism': 0.4.1 @@ -528,7 +528,7 @@ importers: yargs-parser: ^21.0.1 zod: ^3.14.3 dependencies: - '@astrojs/compiler': 0.13.1 + '@astrojs/compiler': 0.13.2 '@astrojs/language-server': 0.13.2 '@astrojs/markdown-remark': link:../markdown/remark '@astrojs/prism': link:../astro-prism @@ -1713,8 +1713,8 @@ packages: leven: 3.1.0 dev: true - /@astrojs/compiler/0.13.1: - resolution: {integrity: sha512-iRAwvJ8/uVRtK/4ofSYKx4MTsuG8YjSgz8Lti7tPGoFaQzSNEU8J5cXvpTSV/F2SspSWB9EHjk2v7204pOxlrQ==} + /@astrojs/compiler/0.13.2: + resolution: {integrity: sha512-0Un4CtLbhJljisFf9WaxK1TSV1oakR3Mh4x1Uyg1JHdyQ5te/1xcq+PWVaOyQc4lq4z8MYNFQb7hG66m0CeMtw==} dependencies: tsm: 2.2.1 uvu: 0.5.3 From 2886cc2e7106bae346a2b64f1f974e61403bb50f Mon Sep 17 00:00:00 2001 From: FredKSchott Date: Fri, 1 Apr 2022 12:04:05 +0000 Subject: [PATCH 02/19] [ci] collect stats --- scripts/stats/stats.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/stats/stats.csv b/scripts/stats/stats.csv index 7ab3641a8..33a02b47a 100644 --- a/scripts/stats/stats.csv +++ b/scripts/stats/stats.csv @@ -1,4 +1,5 @@ Date,Commits (24hr),Issues (24hr),Issues:BUG (24hr),Issues:RFC (24hr),Issues:DOC (24hr),PRs (24hr),Open PRs,Open Issues,Bugs: Needs Triage,Bugs: Accepted,RFC: In Progress,RFC: Accepted,Date (ISO) +"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" From 226822cbbf0b04288a60d05977e7f74fa4698e9e Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Fri, 1 Apr 2022 13:45:43 +0000 Subject: [PATCH 03/19] Allows projects to opt out of the base Tailwind styles (#2959) * adding an option to opt-out of the Tailwind base styles * chore: adding changeset description --- .changeset/tasty-zoos-wink.md | 5 +++++ packages/integrations/tailwind/README.md | 13 +++++++++++++ packages/integrations/tailwind/src/index.ts | 15 +++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .changeset/tasty-zoos-wink.md diff --git a/.changeset/tasty-zoos-wink.md b/.changeset/tasty-zoos-wink.md new file mode 100644 index 000000000..1b144f9c0 --- /dev/null +++ b/.changeset/tasty-zoos-wink.md @@ -0,0 +1,5 @@ +--- +'@astrojs/tailwind': patch +--- + +Adds an option to opt-out of the default base styles for the Tailwind integration 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/src/index.ts b/packages/integrations/tailwind/src/index.ts index bb5a4ade3..3bdd65011 100644 --- a/packages/integrations/tailwind/src/index.ts +++ b/packages/integrations/tailwind/src/index.ts @@ -43,12 +43,21 @@ 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', @@ -71,8 +80,10 @@ export default function tailwindIntegration(options: TailwindOptions): AstroInte config.styleOptions.postcss.plugins.push(tailwindPlugin(tailwindConfig)); config.styleOptions.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';`); + } }, }, }; From 645e1f2ac923d22877afe02e7c1a24c61e6daa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Seery?= Date: Fri, 1 Apr 2022 11:09:24 -0300 Subject: [PATCH 04/19] Fixed flag override (#2956) --- packages/astro/src/core/config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/core/config.ts b/packages/astro/src/core/config.ts index 97b467e9d..b676fc727 100644 --- a/packages/astro/src/core/config.ts +++ b/packages/astro/src/core/config.ts @@ -244,10 +244,10 @@ function resolveFlags(flags: Partial): CLIFlags { config: typeof flags.config === 'string' ? flags.config : undefined, hostname: typeof flags.hostname === 'string' ? flags.hostname : undefined, host: typeof flags.host === 'string' || typeof flags.host === 'boolean' ? flags.host : undefined, - legacyBuild: typeof flags.legacyBuild === 'boolean' ? flags.legacyBuild : false, - experimentalSsr: typeof flags.experimentalSsr === 'boolean' ? flags.experimentalSsr : false, - experimentalIntegrations: typeof flags.experimentalIntegrations === 'boolean' ? flags.experimentalIntegrations : false, - drafts: typeof flags.drafts === 'boolean' ? flags.drafts : false, + legacyBuild: typeof flags.legacyBuild === 'boolean' ? flags.legacyBuild : undefined, + experimentalSsr: typeof flags.experimentalSsr === 'boolean' ? flags.experimentalSsr : undefined, + experimentalIntegrations: typeof flags.experimentalIntegrations === 'boolean' ? flags.experimentalIntegrations : undefined, + drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined, }; } From b4ad11b5690f6835afbd6cd8efdb2d72fa6df9a0 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 1 Apr 2022 13:32:22 -0400 Subject: [PATCH 05/19] Add tests for using buildConfig (#2960) --- .../test/ssr-adapter-build-config.test.js | 71 +++++++++++++++++++ packages/astro/test/ssr-api-route.test.js | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 packages/astro/test/ssr-adapter-build-config.test.js 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..a6feab8cd --- /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({ + projectRoot: './fixtures/ssr-request/', + buildOptions: { + experimentalSsr: 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.projectRoot); + buildConfig.client = new URL('./dist/.root/client/', _config.projectRoot); + }, + '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..5ed37f0c5 100644 --- a/packages/astro/test/ssr-api-route.test.js +++ b/packages/astro/test/ssr-api-route.test.js @@ -35,7 +35,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(); From 84f23d677a7ee05a32b70e9e8b66a0cc0f21feb8 Mon Sep 17 00:00:00 2001 From: matthewp Date: Fri, 1 Apr 2022 17:33:12 +0000 Subject: [PATCH 06/19] [ci] format --- packages/astro/test/ssr-adapter-build-config.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/astro/test/ssr-adapter-build-config.test.js b/packages/astro/test/ssr-adapter-build-config.test.js index a6feab8cd..bda7752ff 100644 --- a/packages/astro/test/ssr-adapter-build-config.test.js +++ b/packages/astro/test/ssr-adapter-build-config.test.js @@ -41,7 +41,7 @@ describe('Integration buildConfig hook', () => { }, }); }, - 'astro:build:start': ({ buildConfig }) => { + 'astro:build:start': ({ buildConfig }) => { buildConfig.server = new URL('./dist/.root/server/', _config.projectRoot); buildConfig.client = new URL('./dist/.root/client/', _config.projectRoot); }, @@ -67,5 +67,5 @@ describe('Integration buildConfig hook', () => { 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; - }) + }); }); From 42760e07ca40b57f19a74a638daece81085f0dee Mon Sep 17 00:00:00 2001 From: FredKSchott Date: Sat, 2 Apr 2022 12:01:59 +0000 Subject: [PATCH 07/19] [ci] collect stats --- scripts/stats/stats.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/stats/stats.csv b/scripts/stats/stats.csv index 33a02b47a..dcf1654ca 100644 --- a/scripts/stats/stats.csv +++ b/scripts/stats/stats.csv @@ -1,4 +1,5 @@ Date,Commits (24hr),Issues (24hr),Issues:BUG (24hr),Issues:RFC (24hr),Issues:DOC (24hr),PRs (24hr),Open PRs,Open Issues,Bugs: Needs Triage,Bugs: Accepted,RFC: In Progress,RFC: Accepted,Date (ISO) +"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" From d55658f061bc4d95efa53e658cfbe407d94af284 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Sat, 2 Apr 2022 12:34:25 -0500 Subject: [PATCH 08/19] Implement new default `script` behavior, `style is:global` (#2961) * feat: implement RFC0016 * chore: update to latest compiler * chore: update compiler * test: fix script tests * test: update public tests * feat: throw a warning when referencing scripts in `public/` without `is:inline` --- .changeset/happy-carrots-carry.md | 5 +++++ examples/component/demo/src/pages/index.astro | 2 +- .../with-tailwindcss/src/components/Button.astro | 5 +++-- packages/astro/package.json | 2 +- packages/astro/src/core/render/result.ts | 9 ++++----- packages/astro/src/runtime/server/index.ts | 7 ++++--- packages/astro/src/vite-plugin-astro/index.ts | 12 ++++++++++-- packages/astro/test/astro-public.test.js | 2 +- .../astro-css-bundling/src/components/Nav.astro | 2 +- .../test/fixtures/astro-public/src/pages/index.astro | 6 +++--- .../astro-scripts/src/components/Inline.astro | 4 ++-- .../src/components/NoHoistClassic.astro | 2 +- .../astro-scripts/src/components/NoHoistModule.astro | 2 +- .../astro-scripts/src/components/Widget.astro | 2 +- .../astro-scripts/src/components/Widget2.astro | 2 +- .../fixtures/astro-scripts/src/pages/external.astro | 2 +- .../remote-css/src/components/CommonHead.astro | 4 ++-- pnpm-lock.yaml | 8 ++++---- 18 files changed, 46 insertions(+), 32 deletions(-) create mode 100644 .changeset/happy-carrots-carry.md diff --git a/.changeset/happy-carrots-carry.md b/.changeset/happy-carrots-carry.md new file mode 100644 index 000000000..82cae9fe5 --- /dev/null +++ b/.changeset/happy-carrots-carry.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Implement [RFC0016](https://github.com/withastro/rfcs/blob/main/proposals/0016-style-script-defaults.md) which changes the default behavior of `script`, introduces `is:inline`, and changes ` +--- +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 +133,7 @@ export function createResult(args: CreateResultArgs): SSRResult { or consider make it a module like so: - `; diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index 7cf56c35f..7e8bc2b50 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -535,16 +535,17 @@ function getHTMLElementName(constructor: typeof HTMLElement) { } function renderElement(name: string, { props: _props, children = '' }: SSRElement, shouldEscape = true) { - // Do not print `hoist`, `lang`, `global` + // Do not print `hoist`, `lang`, `is:global` const { lang: _, 'data-astro-id': astroId, 'define:vars': defineVars, ...props } = _props; if (defineVars) { if (name === 'style') { - if (props.global) { + if (props['is:global']) { children = defineStyleVars(`:root`, defineVars) + '\n' + children; } else { children = defineStyleVars(`.astro-${astroId}`, defineVars) + '\n' + children; } - delete props.global; + delete props['is:global']; + delete props['is:scoped']; } if (name === 'script') { delete props.hoist; diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index aded8f425..7d5839e48 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -63,7 +63,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu const { query: fromQuery, filename } = parseAstroRequest(from); if (fromQuery.astro && isRelativePath(id) && fromQuery.type === 'script') { const resolvedURL = new URL(id, `file://${filename}`); - const resolved = resolvedURL.pathname; + const resolved = resolvedURL.pathname if (isBrowserPath(resolved)) { return relativeToRoot(resolved + resolvedURL.search); } @@ -96,7 +96,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu let source = await fs.promises.readFile(fileUrl, 'utf-8'); const isPage = fileUrl.pathname.startsWith(config.pages.pathname); if (isPage && config._ctx.scripts.some((s) => s.stage === 'page')) { - source += `\n'); - expect(indexHtml).to.include(''); + expect(indexHtml).to.include(''); expect(indexHtml).to.include(''); }); }); 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/pnpm-lock.yaml b/pnpm-lock.yaml index 814dbf0e8..b68e34713 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -442,7 +442,7 @@ importers: packages/astro: specifiers: - '@astrojs/compiler': ^0.13.2 + '@astrojs/compiler': ^0.14.1 '@astrojs/language-server': ^0.13.2 '@astrojs/markdown-remark': ^0.7.0 '@astrojs/prism': 0.4.1 @@ -528,7 +528,7 @@ importers: yargs-parser: ^21.0.1 zod: ^3.14.3 dependencies: - '@astrojs/compiler': 0.13.2 + '@astrojs/compiler': 0.14.1 '@astrojs/language-server': 0.13.2 '@astrojs/markdown-remark': link:../markdown/remark '@astrojs/prism': link:../astro-prism @@ -1713,8 +1713,8 @@ packages: leven: 3.1.0 dev: true - /@astrojs/compiler/0.13.2: - resolution: {integrity: sha512-0Un4CtLbhJljisFf9WaxK1TSV1oakR3Mh4x1Uyg1JHdyQ5te/1xcq+PWVaOyQc4lq4z8MYNFQb7hG66m0CeMtw==} + /@astrojs/compiler/0.14.1: + resolution: {integrity: sha512-dYgb52JvZE8jyDg84JkdJ/dTxRgHVbC47ou6Ymok/nZDh9kvlU7TJtEDCLlGfpfZTGvnkFTHMrz1kdbqCbFVCw==} dependencies: tsm: 2.2.1 uvu: 0.5.3 From 76f6643dddb9343218020cf7585be92a1fe45d3a Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Sat, 2 Apr 2022 17:35:42 +0000 Subject: [PATCH 09/19] [ci] format --- packages/astro/src/vite-plugin-astro/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 7d5839e48..8aff612ba 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -63,7 +63,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu const { query: fromQuery, filename } = parseAstroRequest(from); if (fromQuery.astro && isRelativePath(id) && fromQuery.type === 'script') { const resolvedURL = new URL(id, `file://${filename}`); - const resolved = resolvedURL.pathname + const resolved = resolvedURL.pathname; if (isBrowserPath(resolved)) { return relativeToRoot(resolved + resolvedURL.search); } @@ -131,7 +131,9 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu const src = hoistedScript.src!; if (src.startsWith('/') && !isBrowserPath(src)) { const publicDir = config.public.pathname.replace(/\/$/, '').split('/').pop() + '/'; - throw new Error(`\n\n` }; + 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/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/src/index.ts b/packages/integrations/tailwind/src/index.ts index 2f469b507..3efd8fde8 100644 --- a/packages/integrations/tailwind/src/index.ts +++ b/packages/integrations/tailwind/src/index.ts @@ -67,14 +67,22 @@ export default function tailwindIntegration(options: TailwindOptions): AstroInte 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.srcDir); + 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.srcDir), ...(tailwindConfig.presets || [])]; + tailwindConfig.presets = [ + getDefaultTailwindConfig(config.srcDir), + ...(tailwindConfig.presets || []), + ]; } config.style.postcss.plugins.push(tailwindPlugin(tailwindConfig)); 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/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index 0fb398bc7..c15cf502d 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -23,7 +23,10 @@ import matter from 'gray-matter'; 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/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/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/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/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 a1e34e144..da55acb71 100644 --- a/scripts/memory/index.js +++ b/scripts/memory/index.js @@ -35,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(); @@ -62,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/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/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 }) + ); }, }; } From a05177c50d52f09f32bcb2983e7af73f6507e235 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Sat, 2 Apr 2022 14:16:31 -0600 Subject: [PATCH 19/19] add big reformat to git-blame-ignore-revs --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) 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