Commit graph

2158 commits

Author SHA1 Message Date
bholmesdev
29eef85ce5 [ci] format 2022-07-21 01:36:26 +00:00
Ben Holmes
b2b367c969
[MDX] Support YAML frontmatter (#3995)
* chore: remove old comment

* deps: add remark-frontmatter

* deps: add remark-mdx-frontmatter

* fix: handle null or undefined frontmatter key

* feat: configure frontmatter plugins with defaults

* test: frontmatter and custom frontmatter name

* docs: add frontmatterOptions config

* docs: add "variables" and "frontmatter" docs

* chore: excessible -> accessible

* chore: changeset

* chore: remove bad mdx comment
2022-07-20 21:34:21 -04:00
Erika
40a45e3ef6
Properly support and type optional props in Svelte components (#3993)
* Properly support and type optional props in Svelte components

* Change output to support documentating components

* Add changeset
2022-07-20 17:32:46 -04:00
Tony Sullivan
1c1b9da624
Updates SSR routing to always give priority to public assets (#4000)
* matchRoute should ignore requests for public assets

* chore: add changeset
2022-07-20 20:54:46 +00:00
matthewp
335e58cd8b [ci] format 2022-07-20 20:47:28 +00:00
Matthew Phillips
bccd88f0eb
Move the Markdown component to its own package (#3986)
* Move the Markdown component to its own package

* Update the examples

* Updated lockfile

* Use is:raw

* Add a main field

* Update the formatting of the readme

* Rename to @astrojs/markdown-component
2022-07-20 16:45:05 -04:00
matthewp
d13afad272 [ci] format 2022-07-20 19:53:46 +00:00
Matthew Phillips
ccae431426
Removes warnings / flags for integrations and ssr (#3992) 2022-07-20 15:52:10 -04:00
bholmesdev
74b0099cd1 [ci] format 2022-07-20 18:16:33 +00:00
Ben Holmes
19433eb4a4
[MDX] Support remark and rehype plugins, with defaults (#3977)
* feaet: allow remark and rehype plugin config

* deps: add remark-gfm, remark-smartypants

* feat: add gfm and smartypants by default

* test: add GFM and remark plugin tests

* feat: preserve default plugins with "extends"

* docs: add remarkPlugins

* docs: add rehypePlugins

* chore: changeset

* fix: remove skip from mdx tests

* chore: dup hyperlink flavor text

* chore: authGen -> autoGen

* nit: markdown -> Markdown

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 1

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 2

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 3

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 4

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-20 14:14:23 -04:00
Princesseuh
d50f46bfab [ci] format 2022-07-20 15:18:23 +00:00
Erika
9841c21e8e
Fix astro check file paths not handling URL paths correctly (#3988)
* Fix `astro check` file paths not handling URLs path correctly

* Add changeset
2022-07-20 11:16:22 -04:00
bholmesdev
66012e334a [ci] format 2022-07-20 14:58:33 +00:00
Ben Holmes
61fec63044
[MDX] Include url in glob result (#3981)
* deps: add es-module-lexer

* feat: inject url export on mdx files

* fix: apply url transform in prod

* test: page urls with overrides

* fix: revert test skips

* chore: changeset

* fix: add newline before export
2022-07-20 10:56:32 -04:00
Tony Sullivan
eaf187f2c4
Fixing TypeScript type definitions for image components (#3980)
* moving back to importing from components directory

* exporting components with a .ts file instead of .js

* chore: changeset
2022-07-20 00:33:11 +00:00
natemoo-re
b043fb1980 [ci] format 2022-07-19 21:49:29 +00:00
Nate Moore
4412fe61f4
Improve error handling (#3859)
* feat: tag JSX exports with correct renderer

* feat(error): enhance generic errors with frame

* feat(error): surface errors from streaming response

* feat(error): use vite overlay to display errors

* chore: fix build issues

* feat: use custom logger to hide vite errors for known packages

* chore: move error-react-spectrum to e2e test

* chore: add todo comment

* test: fix error overlay handling

* refactor: extract overlay message to util

* test(e2e): update shared component tests

* fix: give error overlay more time

* refactor: move errors tests to e2e

* fix: appease ts

* test: move sass error to e2e tests

* fix: scope optimizeDeps to `src/pages/**/*`

* chore: update lockfile

* chore: update test script

* chore: log error overlay

* chore: log error tests

* chore: update playwright config

* test(e2e): update errors tests

* test(e2e): fix overlay util

* test(e2e): fix test utils

* test(e2e): try timeout

* test(e2e): give up on overlay tests

* fix: typo

* fix: typo

* refactor: collapse definition

* fix: let errors throw

* chore: revert scanner change

* chore: refactor err.plugin handling

* chore: add clarifying comments

* fix: make astro:renderer non enumerable

* chore: update comments

* refactor: replace astro:renderer string with Symbol

* chore: add comment about tagged components

* feat: improve error overlay when hint exists

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-19 16:47:31 -05:00
matthewp
4ee997da43 [ci] format 2022-07-19 20:11:53 +00:00
Matthew Phillips
5a23483efb
Adds support for Astro.clientAddress (#3973)
* Adds support for Astro.clientAddress

* Pass through mode and adapterName in SSG

* Pass through the mode provided

* Provide an adapter specific error message when possible
2022-07-19 16:10:15 -04:00
Tony Sullivan
d73c04a9e5
<Picture> component should pass all unknown attributes to the <img> element (#3961)
* <Picture /> should pass all unrecognized props down to the <img> element

* chore: add changeset

* Adding test coverage for custom <img> attributes

* chore: adding a README note for passing attributes to the picture's img

* Revert "<Picture /> should pass all unrecognized props down to the <img> element"

This reverts commit ce3e33930f.

* Picture should pass alt text to the img
2022-07-19 19:21:58 +00:00
Astroalex
b37d7078a0
minor: updating the README for @astrojs/sitemap@0.2.0 changes (#3978)
* fix: updating the README for `v0.2.0` changes

* Create chilled-cherries-decide.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-19 14:02:30 -05:00
bholmesdev
6f69516f98 [ci] format 2022-07-19 17:49:40 +00:00
Ben Holmes
95eaa207d8
Feat: log warning on astro.config change, restart server on astro.config added (#3968)
* feat: log on config change, restart on config add

* chore: changeset

* chore: remove unused export
2022-07-19 13:48:07 -04:00
Mihkel Eidast
e82ff13f18
fix: add export keyword to file stub (#3944) 2022-07-19 10:55:59 -05:00
Erika
54865612ea
Add missing media attribute on MetaHTMLAttributes (#3974)
* Add missing media attribute on MetaHTMLAttributes

* Fixed media not being optional, oops

* Add changeset
2022-07-19 11:41:29 -04:00
Tony Sullivan
e6e2160614
Adds back create-astro support for GitHub repos (#3971)
* adding create-astro support for GitHub repos

* chore: add changeset

* nit: adding a comment to document what the fix is doing
2022-07-19 14:24:19 +00:00
FredKSchott
91e4ba03da [ci] format 2022-07-19 05:23:28 +00:00
Rafid Muhymin Wafi
ba11b33996 Removes trailing dash from generated slugs in markdown (#3044)
* fixed header slugs in markdown if ends with a dash

* added changeset

* removes trailing dash only if slug was created

* updated test

* updated change level from patch to minor
2022-07-18 22:21:56 -07:00
FredKSchott
4bb96ac8e5 [ci] format 2022-07-19 05:21:24 +00:00
Matthew Phillips
04070c0c12
Migrate to Vite 3 ️ (#3570)
* Vite 3 test

* deps: bump to Vite beta.1

* refactor: move to use optimizeDeps.force option

* refactor: stub out new updateModuleInfo params

* nit: remove comment on deprecated Vite feature

* nit: remove comment on deprecated vite feature

* hail mary: destroy all ssr external / noexternal!

* fix: use new middlewareMode config settings

* fix: resolve npm package paths for rollup input

* wip: revert to unresolved. Issue reported!

* sad refactor: use legacy devDepsScanner for component HMR

* fix: add astro/components to noExternal for Code component

* refactor: use ALWAYS_NOEXTERNAL array

* refactor: add package.json to all test runners for noExternal error

* deps: bump to latest vite 3 beta

* wip: add package.json to smoke

* fix: remove accidental "force true" on create-vite

* refactor: write smoke package.json programmatically

* refactor: add fontsource to noExternal

* fix: only add to ssr.noExternal if present in project

* wip: what if we just... didn't have a memory test

* deps: bump to latest vite beta

* Revert "wip: what if we just... didn't have a memory test"

This reverts commit 173729dbdc685e52881fc3333487b8f744add55f.

* fix: add type check for plugin.name

* feat: remove legacy.devDepsScanner. Vite 3 strat is now Vite 2.x strat!

* fix: add ssr.noExternal to components ex

* wip: ignore with-mdx starter

* fix: add serviceEntryPoint to ssr.noExternal

* temp: reset NODE_ENV on prod builds

* fix: missing async tag

* VITE 3 IS STABLE BABY

* deps: bump svelte to vite 3

* deps: bump vue to vite 3

* fix: resolve plugins for proper sorting

* sad fix: regex "export default" out of CSS ssr

* chore: add TODO to understand sad fix

* Revert "fix: resolve plugins for proper sorting"

This reverts commit e67c194d3a8e11070487ed325947e7c59e8d69cd.

* Revert "sad fix: regex "export default" out of CSS ssr"

This reverts commit 721d40b62b61440dc9e488787901c915579659db.

* fix: sort plugins WITHOUT resolveConfig

* Revert "wip: ignore with-mdx starter"

This reverts commit 7d4f7338e6.

* chore: revert memory test changes

* chore: add nanostores/preact ot noexternal

* chore: changeset

* chore: changeset

* deps: use Vite ^3.0.0

* fix: add back third party astro pkg scanner

Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-07-18 22:19:23 -07:00
Fred K. Bot
37534004f0
[ci] release (#3939)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-18 21:54:25 -07:00
FredKSchott
167ed5486a [ci] format 2022-07-19 04:50:06 +00:00
Tony Sullivan
299b4afcab
Feat/image url hash (#3965)
* Including a hash of the full remote URL when building for SSG

* chore: add changeset
2022-07-18 21:48:22 -07:00
Juan Martín Seery
60e38f6eb4
ci: fix eslint issues (#3969) 2022-07-18 19:59:53 -03:00
Charles Vandevoorde
5d0edfc3b9
add missing props in markdown layout (#3588)
The `url` props was missing but should there according to [this
document](https://docs.astro.build/en/guides/markdown-content/#markdown-layouts).

The `file` props was not initially there but is quite useful when you
need to resolve file which are relative to the markdown file itself.
2022-07-18 19:58:36 -03:00
FredKSchott
39c864773b [ci] format 2022-07-18 22:02:35 +00:00
Vlad Esafev
57e529e4c1
Throw the error when site option is missing (#3956)
* Throw the error when site option is missing

* Update index.ts

* Update index.ts

* Update rss.test.js

* Update index.ts

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-18 15:01:04 -07:00
Erika
72e777aad8
Make timeout higher for astro check tests as TypeScript is very slow on Windows in CI (#3966) 2022-07-18 17:59:08 -04:00
Fred K. Schott
f5c9d8e829 Revert "Removes trailing dash from generated slugs in markdown (#3044)"
This reverts commit 8530cce14f.
2022-07-18 14:32:51 -07:00
Fred K. Schott
4555c8cb0b Revert "Revert "Removes trailing dash from generated slugs in markdown (#3044)""
This reverts commit 7160bbeede.
2022-07-18 14:32:29 -07:00
Fred K. Schott
7160bbeede Revert "Removes trailing dash from generated slugs in markdown (#3044)"
This reverts commit 8530cce14f.
2022-07-18 14:08:51 -07:00
matthewp
497306178d [ci] format 2022-07-18 20:45:03 +00:00
Matthew Phillips
ceda294e13
Fixes hydration of Maps and Sets (#3960) 2022-07-18 16:43:09 -04:00
Matthew Phillips
5fde2fd8bc
Moves Debug component's styles to be inlined (#3963) 2022-07-18 16:42:57 -04:00
tony-sull
f6d61e6e72 [ci] format 2022-07-18 19:45:31 +00:00
Tony Sullivan
2a7dd040e8
Improving support for third-party hosted image services (#3957)
* WIP: always use the built-in sharp service for local images in `dev`

* adding type definitions for the integration's use of globalThis

* simplifying the globalThis type checking

* chore: adding changeset

* removing temp hosted service used for testing
2022-07-18 19:43:40 +00:00
Princesseuh
eee14b5e5f [ci] format 2022-07-18 19:36:57 +00:00
Erika
b37695c34c
Improve astro check (#3906)
* Improve astro check

* Fix lockfile

* Update to latest language-server version

* Add simple tests

* Fix lock file, again

* Fix `astro check` not working on Windows, speeds up tests

* Add changeest
2022-07-18 15:34:35 -04:00
Fred K. Schott
07fb544dab
remove ssr-utils file (#3924) 2022-07-18 12:12:45 -04:00
Erika
8eba6d9d97
Fix expected types for Element in our JSX definitions (#3958)
* Fix expected types for Element in our JSX definitions

* Add changeset
2022-07-18 11:45:50 -04:00
matthewp
b282cdb21f [ci] format 2022-07-18 15:35:14 +00:00
Matthew Phillips
3acb9ec264
Hoist Astro.globbed hoisted scripts in dev (#3930)
* Hoist Astro.globbed hoisted scripts in dev

* Adds a changeset

* Increase the timeout for the HMR test

* Fix e2e tests

* Refactor test
2022-07-18 11:33:13 -04:00
Matthew Phillips
92b48b1525
Sets import.meta.env.BASE_URL correctly in dev (#3955) 2022-07-18 11:32:56 -04:00
RafidMuhymin
963100fb27 [ci] format 2022-07-16 09:47:09 +00:00
Rafid Muhymin Wafi
8530cce14f
Removes trailing dash from generated slugs in markdown (#3044)
* fixed header slugs in markdown if ends with a dash

* added changeset

* removes trailing dash only if slug was created

* updated test

* updated change level from patch to minor
2022-07-16 15:45:41 +06:00
bholmesdev
6809a0d289 [ci] format 2022-07-15 15:27:19 +00:00
Nate Moore
f5d4ebf0e2
Handle metadata for MDX files during build (#3915)
* fix: metadata handling for MDX files

* chore: add changeset

* chore: update mdx example

* fix: protect against infinite loops in jsx-runtime, properly hook console.error

* chore: remove unused import

* feat(mdx): support `client:only`

* fix: prefer Symbol.for

* fix(jsx): handle vnode check properly

* chore: appease ts

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-15 11:25:29 -04:00
Chris Swithinbank
31f9c0bf02
Roll back supported Node engines (#3937)
Fixes #3936
2022-07-15 08:15:04 -04:00
Fred K. Bot
f7fa39e682
[ci] release (#3925)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-14 15:36:23 -04:00
Matthew Phillips
d6dfef0caa
Add @babel/core dependencies to react/preact integrations (#3928)
* Add @babel/core dependencies

* Adds a changeset
2022-07-14 14:39:58 -04:00
Erika
7c5c4106d7
Use a .ts file to export built-in components so they're typed (#3927)
* Use a .ts file to export built-in components so they automatically have types

* Add changeset
2022-07-14 14:33:10 -04:00
Princesseuh
636881e185 [ci] format 2022-07-14 18:21:39 +00:00
Herman Z
77a708a3ee
fix: export AstroComponentFactory for tsc validattion to pass (#3917) 2022-07-14 14:20:10 -04:00
Nate Moore
7094d6a45f
Handle false properly in class:list (#3922)
* fix(#3920): properly handle false in `class:list`

* fix: allow 0 in `class:list`

* fix: output empty `class:list` as `''` rather than `class=''`

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-14 12:01:17 -05:00
Fred K. Bot
78e765dc65
[ci] release (#3921)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-14 11:36:33 -05:00
Nate Moore
6a7a17f735
chore: update compiler (#3918)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-14 11:09:44 -05:00
FredKSchott
cea2063a94 [ci] format 2022-07-14 16:06:50 +00:00
Fred K. Schott
01a55467d5
add back missing ssr-utils.ts file (#3919) 2022-07-14 09:05:20 -07:00
Fred K. Bot
056d4d5fd2
[ci] release (#3903)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-13 17:16:24 -04:00
Randall
b487679853
Rollback Nodejs Dependancy (#3914)
* Rollback Nodejs Dependancy

Closes #3908

Signed-off-by: Randall T. Vasquez <ran.dall@icloud.com>

* Create ninety-apes-talk.md
2022-07-13 17:06:37 -04:00
Sarah Rainsberger
aa2ac87881
Astro Types for docs: capitalize Markdown (#3912)
- Capitalizes a few errant "markdowns" that find their way into Docs.
- Also updates "if or not" to "whether or not" since I'm here.
- Also, admittedly a point of contention, but until we decide otherwise for the entire site: a straggling "front matter" -> "frontmatter"
2022-07-13 16:02:06 -05:00
matthewp
fa8ec57f16 [ci] format 2022-07-13 20:39:29 +00:00
Matthew Phillips
cd2dbfedb1
Provide a better error message for when RSS is missing link field (#3913)
* Provide a better error message for when RSS is missing `link` field

* Adds a changeset
2022-07-13 16:37:17 -04:00
tony-sull
75f202a124 [ci] format 2022-07-13 19:33:49 +00:00
Juan Martín Seery
ca45c0c270
fix: don't throw when Shiki doesn't recognize a language (#3911)
* Don't throw when Shiki doesn't recognise a language

* Changeset
2022-07-13 19:31:59 +00:00
Ben Holmes
d8af02a944
fix: add github-slugger to ALWAYS_EXTERNAL (#3902)
* fix: add github-slugger to ALWAYS_EXTERNAL

* chore: changeset
2022-07-12 14:28:14 -04:00
Fred K. Bot
ba67a924ca
[ci] release (#3900)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 12:18:13 -04:00
Fred K. Bot
4bf4736768
[ci] release (#3899)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 11:16:15 -04:00
Chris Swithinbank
4097f06226
Centralise community health files in .github repo (#3830)
* Centralise community health files in `.github` repo

* Clean up links

* Add changeset
2022-07-12 17:16:08 +02:00
Corbin Crutchley
402c4181dc
Fix md mode comment (#3880)
* fix: fix a bug where md mode markdown breaks on comments

* chore: add changeset
2022-07-12 11:15:53 -04:00
Fred K. Bot
c2b14d5253
[ci] release (#3894)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 09:08:15 -04:00
Corbin Crutchley
b4cb4a40df
fix: add TypeScript type and documentation for markdown "mode" config (#3883)
* fix: add TypeScript type and documentation for markdown "mode" config

* chore: add changeset
2022-07-12 09:07:51 -04:00
Yuji Sugiura
c4f6fdf372
Remove unused(and also vulnerable) libs from @astro/telemetry (#3898)
* Remove unused(and also vulnerable) libs from @astro/telemetry

* Add changeset
2022-07-12 09:07:21 -04:00
Nate Moore
93e1020b1e
Fix: reintroduce smoke tests across example projects (#3669)
* chore: update smoke tests

* chore: bump smoke tests to node@16

* chore: remove gitmodules

* chore(ci): prefer node@14

* wip: remove path from smoke clone step

* feat: run build:examples from test:smoke

* fix: remove no-frozen-lockfile

* fix: checkout monorepo last for pnpm setup

* wip: replace @astrojs/markdown/remark import from md

* fix: remove type defs from generated file

* fix: function order

* chore: remove ssr-utils export

* wip: remove windows from smoke test

* fix: instantiate slugger in snippet

* fix: exclude with-mdx from smoke (for now)

* fix: add quotes on filter flag for safety

* chore: changeset

* wip: try reintroducing windows smoke

* sad chore: remove client: directive from with-mdx

* Revert "wip: try reintroducing windows smoke"

This reverts commit 9529b1a45c.

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-07-11 22:51:17 -04:00
matthewp
14ed29c645 [ci] format 2022-07-11 20:15:17 +00:00
Matthew Phillips
5f4ecbad1b
Allow defining Astro components in Vite plugins (#3889)
* Allow defining Astro components in Vite plugins

* Adds a changeset

* Move non-main compilation into load

* Use the cachedCompilation in the markdown plugin

* Fix HMR test

* Simplify getNormalizedID

* Use a windows-friendly virtual module id for the test
2022-07-11 16:13:21 -04:00
Chris Swithinbank
bf5d1cc1e7
More integration README fixes (#3885)
* Integration README fixes

* More tweaks (mostly code backticks for filenames)

* Update changeset

* Few more tweaks

* Make sure code blocks all have a code language

* Use URLs of new docs pages for package homepage

* One more stray `<br>` 👢

* Standardise to `sh` instead of `shell`
2022-07-11 21:10:34 +02:00
Fred K. Bot
1554a37622
[ci] release (#3887)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-11 13:38:42 -05:00
Nate Moore
7c49096e86
Update compiler (#3892)
* chore: update @astrojs/compiler

* chore: add changeset

* chore: update test

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-11 13:34:29 -05:00
Matthew Phillips
9cf7e40641
Properly await on children before hydrating in Safari (#3891) 2022-07-11 14:10:23 -04:00
Nate Moore
1cc5b78905
fix(#3071): update supported node versions (#3871)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-11 11:32:53 -05:00
matthewp
0fd645e32f [ci] format 2022-07-11 12:13:57 +00:00
Matthew Phillips
21869a614a
Move client types into Astro (#3851)
* Move client types into Astro

* Adds a changeset

* Fix path to local client

* Reference vite/client in our HMR types

* Add back in the expect-error

* Update types comment
2022-07-11 08:12:18 -04:00
Fred K. Bot
16fdc01322
[ci] release (#3877)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-09 19:03:22 +00:00
Tony Sullivan
f961412862
Updating the <Picture /> component to default to async image decoding (#3876)
* defaulting pictures to use decoding=async

* chore: add changeset
2022-07-09 18:44:31 +00:00
Fred K. Bot
1785e568a0
[ci] release (#3850)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-08 20:54:39 -04:00
bholmesdev
abb874b6c2 [ci] format 2022-07-08 23:06:06 +00:00
Ben Holmes
957fb50541
chore: changeset (#3873) 2022-07-08 19:04:27 -04:00
Erika
f9ed77bb0d
Add editor integrations to language integrations (#3864) 2022-07-08 17:47:01 -04:00
tony-sull
d2f68345f9 [ci] format 2022-07-08 21:40:22 +00:00
Tony Sullivan
89d76753a0
Adds a new <Picture> component to the image integration (#3866)
* moving all normalization logic out of the Image component

* refactor: only require loaders to provide the image src

* Adding a `<Picture />` component

* fixing types.ts imports

* refactor: moving getImage to it's own file

* updating component types to use astroHTML.JSX

* Revert "updating component types to use astroHTML.JSX"

This reverts commit 6e5f578da8.

* going back to letting loaders add extra HTML attributes

* Always use lazy loading and async decoding

* Cleaning up the Picture component

* Adding test coverage for <Picture>

* updating the README

* using JSX types for the Image and Picture elements

* chore: adding changeset

* Update packages/integrations/image/src/get-image.ts

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* allow users to override loading and async on the <img>

* renaming config to constants, exporting getPicture()

* found the right syntax to import astro-jsx

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-08 21:37:55 +00:00
bholmesdev
ec392589f6 [ci] format 2022-07-08 20:57:10 +00:00
Ben Holmes
b012ee55b1
[astro add] Support adapters and third party packages (#3854)
* feat: support adapters and third part integrations by keywords

* refactor: add keywords to all official integrations

* docs: add adapter ex to astro add help

* nit: clarify astro add usage

* nit: highlight link

* fix: use process.exit(1) on error

* chore: changeset

* nit: bold integration name

* fix: log install instructions for adapters instead

* nit: change to logAdapterConfigInstructions

* Revert "fix: log install instructions for adapters instead"

This reverts commit 1a459f152b.

* feat: add hardcoded adapter export map

* refactor: inline adapter config log
2022-07-08 16:55:33 -04:00
tony-sull
9300af9bc2 [ci] format 2022-07-08 20:20:57 +00:00
Tony Sullivan
0aaef1c48b
fix: Always add @astrojs/image to vite.ssr.noExternal (#3869)
* fix: always add @astrojs/image to vite.ssr.noExternal

* chore: add changeset
2022-07-08 20:19:27 +00:00
Chris Swithinbank
1f9e4857ff
Integration README fixes (#3865)
* Remove stray XML tag in sitemap integration README

* Fix link errors

* Add changeset
2022-07-08 21:56:24 +02:00
Nate Moore
70b0246d4c
fix(#3843): move @babel/types to dependencies (#3863)
* fix(#3843): move @babel/types to dependencies

* chore: update lockfile

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-08 14:49:06 -05:00
Isaac McFadyen
37401cc3e6
Fixed broken Markdown link (#3868) 2022-07-08 14:47:16 -05:00
Nate Moore
bd11c01fa8
chore: bump Vite minimum version (#3861)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-08 11:11:02 -05:00
matthewp
f7bcd0d6f6 [ci] format 2022-07-08 15:40:00 +00:00
Matthew Phillips
c2c4e5c238
Better response.arrayBuffer() handling in Node (#3860)
* Better response.arrayBuffer() handling in Node

* Adds a changeset
2022-07-08 11:38:06 -04:00
Chris Williams
f84a1552ec
Fix manual import (#3857) 2022-07-08 10:01:23 -05:00
bholmesdev
272d24ba3a [ci] format 2022-07-07 22:21:10 +00:00
Ben Holmes
08fa0772ab
Docs: add adapter heading for configuration docs (#3842)
* Docs: add adapter heading for configuration docs

* docs: add adapter example, rework doc links

* chore: changeset
2022-07-07 18:19:39 -04:00
natemoo-re
0a156feca0 [ci] format 2022-07-07 21:08:44 +00:00
Joaquín Sánchez
c6ba6ec4d9
fix: lint failing on astro and some integrations (#3794)
* fix: lint failing on astro and some integrations

* chore: fix telemetry lint

* chore: fix turbo cache (thx nate)

* chore: fix runtime server
2022-07-07 16:06:44 -05:00
Fred K. Schott
515e876598 update solid peer dependencies 2022-07-07 12:11:27 -07:00
Fred K. Schott
2b7b626629
update lockfile (#3828) 2022-07-07 12:06:56 -07:00
Erika
b84bd7db63
Improve JSX definitions (#3801) 2022-07-07 14:44:15 -04:00
Nate Moore
5afb807688
Fix slot attribute inside expressions (#3837)
* fix: use slots inside expressions

* test: add test for conditional named slots

* test: fix incorrect test fixture

* chore: update `@astrojs/compiler`

* chore: add test coverage for `switch`

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-07 13:23:51 -05:00
FredKSchott
c191098b97 [ci] format 2022-07-07 18:14:25 +00:00
Fred K. Schott
eedb32c797
detect package manager and improve types (#3847) 2022-07-07 11:12:31 -07:00
Fred K. Schott
4fb08502a9
small create-astro wording changes (#3831) 2022-07-07 11:05:59 -07:00
matthewp
9f54fa3cd9 [ci] format 2022-07-07 17:51:24 +00:00
Matthew Phillips
502f063131
Allow importing Image component from @astrojs/image (#3848)
* Allow importing Image component from @astrojs/image

* Adds a changeset

* Export the Image type
2022-07-07 13:49:46 -04:00
Fred K. Bot
568960f175
[ci] release (#3818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-06 21:00:18 -04:00
bholmesdev
67f91fe2fd [ci] format 2022-07-07 00:49:59 +00:00
Ben Holmes
820a26dde5
Fix: Infer content type with charset in dev and prod (#3841)
* fix: add text/plain;charset;utf-8 header in dev

* test: ensure content type for body shorthand

* chore: changeset

* feat: infer content type by pathname

* feat: add charset to prod build handler

* test: update for charset in prod build test
2022-07-06 20:48:14 -04:00
bholmesdev
b2f53c37c5 [ci] format 2022-07-06 20:59:56 +00:00
Ben Holmes
cd3f6348c4
Fix client:visible directive in safari (#3839)
* fix: client visible on safari

* chore: changeset

* refactor: wait for children with mutation observer

* fix: remove unecessary settimeout

* refactor: remove unecessary awaits
2022-07-06 16:58:28 -04:00
matthewp
b1c4600fd4 [ci] format 2022-07-06 12:11:57 +00:00
Matthew Phillips
c2165c34a7
Ensure that maybeRenderHead runs last (#3821)
* Ensure that maybeRenderHead runs last

* Adds a changeset

* Make work with MDX
2022-07-06 08:10:19 -04:00
Fred K. Schott
e4b2dca1f3
fix piped telemetry error output (#3822) 2022-07-05 14:46:57 -05:00
Randall
2f56664f85
Fix example on README.md on @astrojs/node (#3817)
* Fix example on `README.md`

The example was suggesting `import deno from '@astrojs/node';` which doesn't work. It needs to be `import node from '@astrojs/node';`.

* Create itchy-bottles-rhyme.md

Co-authored-by: Peter Singh <afuzzybear@outlook.com>
2022-07-04 22:51:30 +01:00
Fred K. Bot
822befc59b
[ci] release (#3813)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-04 15:22:09 +00:00
Tony Sullivan
5ccccace0c
Updates how the new Image component is exported to support older versions of Astro (#3812)
* don't use typescript for the components named export file

* Adding a readme example for images in markdown

* chore: add changeset
2022-07-04 14:52:32 +00:00
Fred K. Bot
08d068496d
[ci] release (#3800)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 15:56:49 -05:00
Nate Moore
5fe52737cb
Update MDX example to address failure (#3799)
* fix: do not use symbol in JSX runtime

* chore: update MDX example

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-01 15:51:28 -05:00
Tony Sullivan
b9d26f39e2
manually correcting import ordering to unblock CI (#3798) 2022-07-01 20:24:45 +00:00
Fred K. Bot
5953a6ca0d
[ci] release (#3797)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 20:13:33 +00:00
tony-sull
88dad63322 [ci] format 2022-07-01 20:06:01 +00:00
Tony Sullivan
d143d24c72
Updates the images integration to automatically mark optimizeDeps for sharp (#3795)
* including src in npm publish

* bugfix: always round dimensions before passing to sharp.resize

* automatically add optimizeDeps vite config

* chore: changeset
2022-07-01 19:56:43 +00:00
Fred K. Bot
94143fcdba
[ci] release (#3789)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 17:43:26 +00:00
Tony Sullivan
e8593e7ead
Adds an @astrojs/image integration for optimizing images (#3694)
* initial commit

* WIP: starting to define interfaces for images and transformers

* WIP: basic sharp service to test out the API setup

* adding a few tests for sharp.toImageSrc

* Adding tests for sharp.parseImageSrc

* hooking up basic SSR support

* updating image services to return width/height

* simplifying config setup for v1

* hooking up basic SSR + SSG support (dev & build)

* refactor: a bit of code cleanup and commenting

* WIP: migrating local files to ESM + vite plugin

* WIP: starting to hook up user-provided loaderEntryPoints

* chore: update lock file

* chore: update merged lockfile

* refactor: code cleanup and type docs

* pulling over the README template for first-party integrations

* moving metadata out to the loader

* updating the test for the refactored import

* revert: remove unrelated webapi formatting

* revert: remove unrelated change

* fixing up the existing sharp tests

* fix: vite plugin wasn't dynamically loading the image service properly

* refactor: minor API renaming, removing last hard-coded use of sharp loader

* don't manipulate src for hosted image services

* Adding support for automatically calculating dimensions by aspect ratio, if needed

* a few bug fixes + renaming the aspect ratio search param to "ar"

* Adding ETag support, removing need for loaders to parse file metadata

* using the battle tested `etag` package

* Adding support for dynamically calculating partial sizes

* refactor: moving to the packages/integrations dir, Astro Labs TBD later

* refactor: renaming parse/serialize functions

* Adding tests for SSG image optimizations

* refactor: clean up outdated names related to ImageProps

* nit: reusing cached SSG filename

* chore: update pnpm lock file

* handling file URLs when resolving local image imports

* updating image file resolution to use file URLs

* increasing test timeout for image build tests

* fixing eslint error in sharp test

* adding slash for windows compat in src URLs

* chore: update lockfile after merge

* Adding README content

* adding a readme call to action for configuration options

* review: A few of the quick updates from the PR review

* hack: adds a one-off check to allow query params for the _image route

* Adds support for src={import("...")}, and named component exports

* adding SSR tests

* nit: adding a bit more comments

* limiting the query params in SSG dev to the images integration
2022-07-01 15:47:48 +00:00
Fred K. Bot
0f73ece26b
[ci] release (#3783)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 03:09:17 +00:00
tony-sull
a2b385303c [ci] format 2022-07-01 02:32:07 +00:00
Tony Sullivan
976e1f175a
Adding an option to disable HTTP streaming (#3777)
* Adding a flag to disable HTTP streaming

* refactor: adding support for SSG builds

* handling string responses in the server runtime, adding tests

* removing streaming CLI flag

* removing import.meta.env.STREAMING

* include Content-Length header when streaming is disabled

* Verifying content-length header in dev

* fix: default streaming to enabled in the base App server

* TEMP: disabling the production test to investigate the test-adapter

* re-enabling the test with an adapter option to disable streaming for the test

* fix: use the existing TextEncoder to get the body's byte length

* moving config to build.streaming, ignoring it in `dev`

* fixing dev test to expect response streaming

* chore: add changsets

* removing the new config option all together 🎉

* remove temp debug log

* Updating astro changeset now that streaming isn't a config option
2022-07-01 02:29:59 +00:00
Fred K. Bot
d07ad8a782
[ci] release (#3774)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 11:39:44 -07:00
Fred K. Schott
192c4bcfd6
await error reporter (#3779) 2022-06-30 11:17:32 -07:00
natemoo-re
af23bdd515 [ci] format 2022-06-30 18:11:12 +00:00
Nate Moore
032ad1c047
MDX support (#3706)
* feat: first pass at MDX support

* fix: move built-in JSX renderer to come first

* chore: remove jsx example

* chore: update lockfile

* chore: cleanup example

* fix: missing deps

* refactor: move component render logic to `renderPage`

* chore: update HMR script

* chore: update MDX example

* refactor: prefer unshit

* refactor: remove TODO comment

* fix: remove duplicate identifier

* refactor: cleanup mdx entrypoint

* fix: better html handling

* fix: add tsconfig to mdx package

* chore: update lockfile

* fix: do not sort plugins unless mdx is enabled

* chore: update compiler

* fix(hmr): maybe render head for non-Astro pages

* fix: set initial pageExtensions

* refactor: cleanup addPageExtension

* refactor: remove addPageExtensions from types

* refactor: expose HookParameters type

* fix: only default to astro for MDX

* test: pick up jsx support in test fixtures

* refactor: simplify mdx entrypoint

* test: add basic MDX tests

* test(e2e): add mdx + framework tests

* chore: update lockfile

* test(e2e): fix preact mdx e2e test

* fix(mdx): disable .md support

* test(e2e): fix vue-component test missing mdx

* test(e2e): fix solid component needing import

* fix: allow `client:only="solid"` as an alias to `solid-js`

* chore: move to with-mdx example

* chore: update MDX readme

* chore: update example readme

* chore: bump astro version

* chore: update lockfile

* Update mod.d.ts

* feat: support `export const components` in MDX pages

* chore: update mdx example

* fix: update jsx-runtime with better slot support

* refactor: remove object style support

* chore: cleanup package exports

* chore: add todo comment

* refactor: improve isPage function, move to utils

* refactor: dry up manual HMR updates

* chore: add dev tests for MDX

* chore: prefer set to array

* chore: add changesets

* fix(hmr): flip public/private route

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-30 13:09:09 -05:00
hippotastic
91635f05df
Fix integration name (prefetch instead of lit) (#3778) 2022-06-30 12:53:01 -05:00
Dan Jutan
8045c8ade1
Integration Docs Next Steps (#3677)
* sitemap readme skeleton + first sections

* Revert "sitemap readme skeleton + first sections"

This reverts commit cc55b312b6.

* sitemap readme skeleton + first sections

* remove canonicalURL option from sitemap

* add customPages option to readme

* sitemap examples

* partytown

* deno run command

* reference deno example

* node readme

* netlify & vercel readmes

* note that telemetry is installed

* telemetry is *enabled*, not installed

* Update packages/integrations/vercel/README.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/integrations/vercel/README.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* readme -> README

* Update packages/integrations/deno/readme.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/integrations/deno/readme.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* qualify they

* Update packages/integrations/sitemap/README.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Uppercase README names

* Update packages/integrations/partytown/README.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* imports -> import typo

* update changeset

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-06-30 12:02:39 -04:00
tony-sull
75ffab7009 [ci] format 2022-06-30 14:18:38 +00:00
Fred K. Schott
913591d137
refactor to provide better cli error handling (#3768) 2022-06-30 14:16:39 +00:00
Fred K. Bot
8cbe92b74b
[ci] release (#3772)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 08:08:09 -05:00
hippotastic
40fa87c274 [ci] format 2022-06-30 12:12:27 +00:00
hippotastic
b934ab5d86
Fix "Invalid hook call" warning (#3769)
* Fix "Invalid hook call" warning

* Fix eslint warnings

* Apply code review suggestions
2022-06-30 14:10:56 +02:00
Fred K. Bot
38f2fd7723
[ci] release (#3759)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-29 17:11:48 -05:00
FredKSchott
a99a54d344 [ci] format 2022-06-29 21:56:28 +00:00
Fred K. Schott
4bc6c7ceaa
manual lockfile update (#3751)
* lockfile update

* update lockfile gen script

* Update index.ts
2022-06-29 14:54:40 -07:00
Fred K. Schott
dd176ca58d
add error event to telemetry (#3750) 2022-06-29 14:54:33 -07:00
tony-sull
2f7d918912 [ci] format 2022-06-29 20:58:19 +00:00
Tony Sullivan
51d5dc4789
Updates an error handler to expect updated @astrojs/lit behavior (#3766)
* fix: don't throw an error when the lit renderer doesn't provide a clientEntrypoint

* updating the framework-lit example to match new behavior

* fix: updating the playground example to latest lit syntax
2022-06-29 20:56:51 +00:00
delucis
e667477103 [ci] format 2022-06-29 15:48:55 +00:00
Chris Swithinbank
e3fdc9b403
Add preact/compat support to @astrojs/preact (#3712)
* Add preact/compat renderer (likely broken)

Based on the current Preact renderer and the old preact/compat implementation: f892aeb52f/packages/renderers/renderer-preact/compat/index.js

* Make sure name is consistent

* Switch to single integration with compat option

* fix: add module-resolver to alias react => preact/compat

* fix: preact/compat mode

* chore: remove client-compat entrypoint

* chore: add e2e test for preact/compat

* Try to fix frozen lock file error

* Add changeset

* Update README to new structure & document `compat`

* Fix changeset wording

* Fix README typo

* Tweak wording

Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
2022-06-29 17:42:47 +02:00
Tony Sullivan
54cd6b8dd1
Fixes a bug in how injectRoute parses route patterns on Windows (#3763)
* always remove a leading slash in the `injectRoute` pattern

* chore: add changeset
2022-06-29 09:46:23 -05:00
Erika
40be96d7c8
Improve types for getStaticPaths, fixes dead links (#3755) 2022-06-29 09:43:52 -05:00
Sarah Rainsberger
aaf0cd8bfc
Added: reminder to also update docs if create-astro flow or wording is changed (#3760) 2022-06-29 11:10:20 -03:00
Fred K. Bot
789dc1fabc
[ci] release (#3757)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-28 11:02:59 -07:00
Fred K. Bot
b0c1ed1513
[ci] release (#3754)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-28 10:49:15 -07:00
Ben Holmes
507cd5c868
Chore: remove complex install step test (#3756)
* chore: remove complex install step test

* chore: changeset
2022-06-28 13:46:54 -04:00
Fred K. Schott
cabd9dcc80
anonymize non-git project id (#3753) 2022-06-28 10:29:24 -07:00
Fred K. Bot
be3c99316a
[ci] release (#3749)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-28 19:00:40 +02:00
Nate Moore
8829cc7ab6
Disable problematic create-astro test (#3746)
* chore(test): disable problematic create-astro test

* chore: fix skip

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-28 10:24:54 -05:00
Fred K. Bot
a59a27eb0c
[ci] release (#3733)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-28 15:11:59 +00:00
natemoo-re
27d8c351bb [ci] format 2022-06-28 13:40:53 +00:00
Nate Moore
53bf0be280
chore(lint): fix lint issues (#3743)
Co-authored-by: Nate Moore <nate@astro.build>
2022-06-28 08:39:10 -05:00
Fred K. Bot
768c8ed21d
[ci] update lockfile (#3740)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-28 08:33:13 -05:00
Victor
6360f474fb
Fix Tailwind integration Typescript warning (#3732)
* Make options optional

* chore: add changeset

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-06-28 07:49:08 -05:00
bholmesdev
efd6548d49 [ci] format 2022-06-27 21:22:26 +00:00
Ben Holmes
4acd245d8f
Refactor: remove Deno shim to esbuild "banner" (#3734)
* refactor: remove Deno shim to esbuild "banner"

* refactor: move shim to const

* refactor: add shim to netlify edge

* chore: changeset
2022-06-27 17:20:28 -04:00
FredKSchott
701799c6d6 [ci] format 2022-06-27 21:17:40 +00:00
Fred K. Schott
ebd7e7ad81
update telemetry to support more anonymized project id (#3713)
* update telemetry to support more anonymized project id

* Create strange-laws-kick.md

* respond to nate feedback
2022-06-27 14:16:07 -07:00
Fred K. Schott
4d6d8644e6
SImplify "astro add" by removing confusing multi-select (#3715)
* wip

* update create-astro for new astro add

* update copy

* update git prompt

* Update packages/astro/src/core/logger/node.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/create-astro/test/install-step.test.js

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* update git prompt

* update test

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-06-27 14:15:51 -07:00
Sarah Rainsberger
0bcc969cd4
removed experimental warning from astro add command (#3727) 2022-06-27 13:44:32 -05:00
tony-sull
cb3fcdde6a [ci] format 2022-06-27 18:28:16 +00:00
Tony Sullivan
79fe09fa30
Adds a prefetch integration for near-instant page navigations (#3725)
* Adds a basic @astrojs/prefetch integration

* adding tests for custom selectors

* missed in last commit

* Adding a few docs, removing the option for `selectors` to be an element array

* adding an option for the concurrency limit

* fixing test for updated integration options

* Update packages/labs/prefetch/src/client.ts

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: removing the NodeJS.Timer type to allow typescript to infer the return

* updating docs for default selector with ~=

* Skip prefetching on 2G connections, or when data saver is enabled

* refactor: moving to packages/integrations, Astro Labs TBD down the road

* README typo fix

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-27 18:26:21 +00:00
FredKSchott
7d0c3f9ecb [ci] format 2022-06-27 18:12:43 +00:00
Oleksii Tymoshenko
52f75369ef
feat: better behavior for 'undefined' return values from 'serialize… (#3723)
* feat: better behavior with 'undefined' return values after 'serialize' func

* build: changeset added
2022-06-27 13:02:00 -05:00
github-actions[bot]
0ae1365533
[ci] release (#3726)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-27 10:40:35 -04:00
matthewp
ab3aa3099b [ci] format 2022-06-27 14:38:25 +00:00
Matthew Phillips
86635e035b
Inline define:var styles rendered after the head (#3724)
* Inline define:var styles rendered after the head

* Adds a changeset

* Remove tests that don't work with streaming
2022-06-27 10:36:41 -04:00
Matthew Phillips
c8dda94125 Revert "Inline define:var styles rendered after the head"
This reverts commit 65e2b71b80.
2022-06-27 09:08:40 -04:00
unknown
65e2b71b80 Inline define:var styles rendered after the head 2022-06-27 09:07:48 -04:00
github-actions[bot]
701a3bd698
[ci] release (#3707)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 17:02:11 -04:00
matthewp
f3e01f6c26 [ci] format 2022-06-24 21:00:16 +00:00
Matthew Phillips
b5e3403fa1
Simplified Response#text() implementation (#3705)
* Simplified Response#text() implementation

* Adds a changeset

* Fix tsignore
2022-06-24 16:58:14 -04:00
Matthew Phillips
b11e3b38eb
Ensure import.meta.env.SSR is true in SSR mode (#3702)
* Ensure import.meta.env.SSR is true in SSR mode

* Define in the env plugin instead
2022-06-24 16:14:00 -04:00
natemoo-re
5e716e8cd5 [ci] format 2022-06-24 20:13:12 +00:00
Nate Moore
908c2638cb
Add *private* built-in JSX renderer (#3697)
* feat: add private `addPageExtensions` hook

* feat: experimental JSX support

* chore: remove experimental.jsx option from config

* chore: remove automatic astro JSX runtime detection

* fix: throw warning when client:* directive is used but no client entrypoint is found

* feat: add slot support to renderer

* chore: remove client entrypoint from jsx renderer

* test: add barebones JSX test

* test: add frameworks-in-jsx test

* feat: improve error message when no matching import is found

* feat: support slots

* fix: do not strip `astro-slot` when using JSX renderer

* fix: handle null values in isVNode

* fix: do not transform slots for elements

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-24 15:11:17 -05:00
github-actions[bot]
67b5aa4ca4
[ci] release (#3701)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 16:05:02 -04:00
Matthew Phillips
47c81effa6
Make Astro.redirect use a 302 status code (#3700)
* Make Astro.redirect use a 302 status code

* Adds a changeset

* Add a package.json
2022-06-24 15:55:06 -04:00
matthewp
69c955b2bf [ci] format 2022-06-24 19:37:09 +00:00
Matthew Phillips
3daaf510ea
Streaming (#3696)
* Start of streaming

* New lockfile

* Base should be Uint8Arrays

* Remove the ability to throw from a component

* Add a warning when returning a Response from a non-page component

* Adds a changeset
2022-06-24 15:35:21 -04:00
Richard Cooke
0d667d0e57
fix: @astrojs/clooudflare 404 handling (#3695) 2022-06-24 14:30:47 -05:00
github-actions[bot]
6a6047483b
[ci] release (#3692)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 12:55:36 -05:00
dperolio
fd0a24c424
fix run-on sentence (#3699) 2022-06-23 20:24:43 -05:00
matthewp
3dc22a2443 [ci] format 2022-06-23 19:39:58 +00:00
Matthew Phillips
fa7ed3f3a9
Remove post-rendering head injection (#3679)
* Remove post-rendering head injection

* Adds a changeset

* Use a layout component for vue
2022-06-23 15:37:55 -04:00
d-suke
446f8c4f13
Added test for dir parameter in astro:build:done. (#3649)
* Added test for dir in astro:build:done

* Added changeset

* Change pathname for Windows

* Change changeset generated file summary

* Eliminate testing of branches by os

* Eliminate OS dependence

* Change changeset generated file summary

* Using fileURLToPath

* Cross-platform fixes.

* Use posix for everything.

* Pass an empty string for relative from

* Use path.join for the correct value

* Update packages/astro/test/static-build-dir.test.js

* Update packages/astro/test/static-build-dir.test.js

* Update packages/astro/test/static-build-dir.test.js

* Remove trailing slash

* add toString

* fix syntax error

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-23 14:04:10 -05:00
tony-sull
e990b9f42d [ci] format 2022-06-23 17:30:21 +00:00
Tony Sullivan
c7cb5df450
centralizing test setup with a universal resetAllFiles hook (#3693) 2022-06-23 17:28:54 +00:00
bholmesdev
589b840f5a [ci] format 2022-06-23 15:33:20 +00:00
Ben Holmes
3f8ee70e2b
Fix: document sitemap + SSR use case (#3689)
* fix: offer suggestion for SSR sitemap users

* docs: add customPages to README

* chore: changeset
2022-06-23 11:31:54 -04:00
natemoo-re
059d00bd5d [ci] format 2022-06-23 15:12:46 +00:00
Nate Moore
7373d61cdc
Enable named slots in renderers (#3652)
* feat: pass all slots to renderers

* refactor: pass `slots` as top-level props

* test: add named slot test for frameworks

* fix: nested hydration, slots that are not initially rendered

* test: add nested-recursive e2e test

* fix: render unmatched custom element children

* chore: update lockfile

* fix: unrendered slots for client:only

* fix(lit): ensure lit integration uses new slots API

* chore: add changeset

* chore: add changesets

* fix: lit slots

* feat: convert dash-case or snake_case slots to camelCase for JSX

* feat: remove tmpl special logic

* test: add slot components-in-markdown test

* refactor: prefer Object.entries.map() to for/of loop

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-23 10:10:54 -05:00
github-actions[bot]
19cd962d0b
[ci] release (#3684)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 09:14:17 -04:00
matthewp
16cdfeef81 [ci] format 2022-06-23 13:05:55 +00:00
Matthew Phillips
b36ecb717e
Include partytown scripts in SSR manifest (#3686)
* Include partytown scripts in SSR manifst

* Adds a changeset
2022-06-23 09:03:43 -04:00
bholmesdev
9133a42831 [ci] format 2022-06-22 23:55:00 +00:00
Ben Holmes
3d554fdbfb
Fix: pass Astro config postcss to Svelte preprocess (#3685)
* fix: pass Astro config postcss to Svelte preprocess

* test: preset env for nested styles

* chore: changeset
2022-06-22 19:52:32 -04:00
natemoo-re
a3654a7537 [ci] format 2022-06-22 21:15:21 +00:00
Fred K. Schott
921d9a27e2
simplify a complex peer semver used by astro add (#3633)
* fix peer semver used by astro add

* Create pink-shirts-mix.md

* update with regex over `' '` split

Co-authored-by: Ben Holmes <hey@bholmes.dev>
2022-06-22 16:13:32 -05:00
matthewp
b9f891b8a6 [ci] format 2022-06-22 16:49:59 +00:00
Matthew Phillips
9a813268db
Allow TypeScript in hoisted scripts (#3665)
* Allow TypeScript in hoisted scripts

* Pass skipSelf

* Fix linting
2022-06-22 12:47:52 -04:00
matthewp
c2dffc1c38 [ci] format 2022-06-22 16:33:56 +00:00
Matthew Phillips
85c33751c2
Allow specifying entryFileNames for client JS (#3676)
* Allow specifying entryFileNames for client JS

* Adds a changeset
2022-06-22 12:32:17 -04:00
matthewp
c97bdf1a45 [ci] format 2022-06-22 16:21:26 +00:00
github-actions[bot]
8ad146a5d7
[ci] release (#3683)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 12:19:43 -04:00
matthewp
5a41ea1202 [ci] format 2022-06-22 16:04:06 +00:00
Matthew Phillips
aeab890971
Inline small hoisted scripts (#3658)
* Inline small hoisted scripts

This makes it so that small hoisted scripts get inlined into the page rather than be fetched externally.

* Ensure we don't inline when there are imports

* Fix ts

* Update tests with new url structure

* Adds a changeset
2022-06-22 12:02:42 -04:00
tony-sull
ae7415612e [ci] format 2022-06-22 16:01:42 +00:00
Tony Sullivan
b8c6dabfb7
Enables eslint on the full repo and adds a rule for no only() tests (#3659)
* enabling eslint on the all packages and tests

* enabling for all packages

* TEMP: adding an only() test to verify it fails CI

* using our eslint config and ignore in CI

* removing the temporary .only() test

* update lock file

* lint: fixing new test with a no-shadow warning

* chore: update lock file
2022-06-22 15:59:49 +00:00
bholmesdev
f6400e694e [ci] format 2022-06-22 15:41:50 +00:00
Ben Holmes
df02fad13e
Add @nanostores/preact to ALWAYS_NOEXTERNAL (#3667)
* chore: add nanostores/preact to ALWAYS_NOEXTERNAL

* chore: update comment to reference pR

* chore: changeset
2022-06-22 11:38:59 -04:00
matthewp
fc74dc4a8c [ci] format 2022-06-22 15:37:47 +00:00
Matthew Phillips
898845402c
Include all client build artifacts in SSRManifest (#3678)
* Include all client build artifacts in SSRManifest

* Adds a changeset
2022-06-22 11:35:54 -04:00
github-actions[bot]
119283775a
[ci] release (#3666)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 10:05:21 -04:00
hippotastic
ba5ad7855c
Fix react dependencies to improve test reliability (#3673)
* Fix local react tests by unifying versions

* Add missing dependencies to react tests

* Add changeset

* Fix lockfile

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-06-22 09:11:48 -04:00
hippotastic
ef6282d5d9
Fix import.meta.env also without trailing dot (#3675)
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-06-22 08:58:20 -04:00
github-actions[bot]
b4db008e53
[ci] release (#3664)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 12:47:04 -04:00
matthewp
0d3a7de527 [ci] format 2022-06-21 16:36:57 +00:00
Matthew Phillips
c20b93c484
Resolve .jsx -> .tsx in hydrated components (#3663) 2022-06-21 12:35:11 -04:00
github-actions[bot]
e13ce4d751
[ci] release (#3662)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 11:50:06 -04:00
Matthew Phillips
2ff11df438
Add .js to imports in the sitemap package (#3661)
* Add .js to imports in the sitemap package

* Adds a smoke test

* Adds a changeset
2022-06-21 11:29:18 -04:00
Yuji Sugiura
7d4699b8f9
Check null for props serialization (#3657)
* Check null for props serialization

* Add changeset
2022-06-21 10:26:27 -05:00
github-actions[bot]
e67171252c
[ci] release (#3615)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-06-21 09:43:19 -04:00
matthewp
948f82048b [ci] format 2022-06-21 12:33:55 +00:00
Matthew Phillips
f5afaf2498
Support re-exporting astro components containing client components (#3625)
* Support re-exporting astro components containing client components

* Include metadata for markdown too

* Fix ssr, probably

* Inject post-build

* Remove tagName custom element test

* Allows using the constructor for lit elements

* Fix hoisted script scanning

* Pass through plugin context

* Get edge functions working in the edge tests

* Fix types for the edge function integration

* Upgrade the compiler

* Upgrade compiler version

* Better release notes for lit

* Update .changeset/unlucky-hairs-camp.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* Properly test that the draft was not rendered

* Prevent from rendering draft posts

* Add a changeset about the build perf improvement.

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-21 08:32:05 -04:00
Nate Moore
bb02bca36c
Remove it.only (#3655)
* chore: remove it.only

* test: fix failing test

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-20 17:40:53 -05:00
natemoo-re
9532d56b50 [ci] format 2022-06-20 19:31:39 +00:00
Oleksii Tymoshenko
facfc4682f
refactor: better typings (#3634) 2022-06-20 14:29:53 -05:00
Nate Moore
d9f6dcf6ea
fix: properly catch falsy components (#3650)
Co-authored-by: Nate Moore <nate@astro.build>
2022-06-20 14:14:54 -05:00
tony-sull
0519601b52 [ci] format 2022-06-20 19:10:59 +00:00
Tony Sullivan
48e67fe053
Encode ampersands in markdown code blocks (#3630)
* encode ampersands in markdown code blocks

* chore: add changeset

* nit: fixing test case description
2022-06-20 19:09:35 +00:00
natemoo-re
509b4f122f [ci] format 2022-06-20 19:06:53 +00:00
Nate Moore
8e3e4894c9
Add private addPageExtension hook (#3628)
* feat: add private `addPageExtensions` hook

* chore: remove renderer binding

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-20 14:05:16 -05:00
tony-sull
9502fbf4a9 [ci] format 2022-06-20 17:14:08 +00:00
Tony Sullivan
80c71c7c56
Fixes rendering of HTML comments inside markdown code blocks (#3638)
* JS comment wrappers should be removed from HTML comments in code blocks

* chore: add changeset
2022-06-20 17:12:42 +00:00
tony-sull
9b530bdece [ci] format 2022-06-17 22:36:22 +00:00
Nate Moore
12ec35feff
docs: update incorrect example in changelog (#3609)
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-06-17 22:34:47 +00:00
hippotastic
6ab749be5c
Add component hydration in .md E2E tests, refactor (#3610)
Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-17 22:34:19 +00:00
Tony Sullivan
56937563c3
disabling Netlify Edge Functions tests for now (#3631) 2022-06-17 22:12:04 +00:00
hippotastic
05aa72442c
Remove extra newlines around Markdown components (#3620) 2022-06-17 11:52:37 -05:00
bholmesdev
8ce5b824ab [ci] format 2022-06-17 00:32:29 +00:00
Ben Holmes
fca58cfd91
Fix: Netlify edge deployment when using markdown (#3612)
* wip: revert sitemap PR

* fix: extract SSR-ready "slug" helper to separate module

* Un-revert sitemap PR. Not to blame!

This reverts commit 7cd2a8a5ea.

* fix: use .netlify for edge deployment test

* refactor: add md file to edge function fixture

* fix: add netlify edge tests to ci

* chore: remove stray console log

* wip: undo "dist" change on edge tests

* chore: changeset

* Revert "wip: undo "dist" change on edge tests"

This reverts commit 70e565ef06.

* temp: add ignore to breaking edge tests
2022-06-16 20:31:08 -04:00
tony-sull
fb80e384e3 [ci] format 2022-06-16 22:11:13 +00:00
Tony Sullivan
e02097d0b9
Investiging a flaky error test (#3613)
* restarting dev server between each error test

* re-enabling the test on Linux CI

* trying separate describe() suites per error test

* narrowed the issue down, disabling for more investigation

* not: removing unrelated whitespace change
2022-06-16 22:09:47 +00:00
Richard Cooke
9716747879
feat: update @astrojs/cloudflare readme (#3616) 2022-06-16 15:16:25 -05:00
tony-sull
1c944a148a [ci] format 2022-06-16 19:08:44 +00:00
Oleksii Tymoshenko
1031c06f9c
feat: improved sitemap (#3579)
* feat: extended sitemap functionality

* docs: del samples

* docs: readme

* feat: new sitemap

* feat: createLinkInHead removed

* docs: updated changeset text

* refactor: 'zod' function() instead of self made refine()

* Revert "refactor: 'zod' function() instead of self made refine()"

This reverts commit 036bac730d.

undo function()
2022-06-16 19:06:48 +00:00
matthewp
44ba4e1ed9 [ci] format 2022-06-16 18:54:57 +00:00
Okiki Ojo
9c8a7c0b09
fix(@astrojs/telemetry): add optional integrations field (#3614)
* fix: filter out falsy integration from telemetry

Falsy integrations are now ignored in `@astrojs/telemetry`

This error should no longer occur,
```ts
 error   Cannot read properties of null (reading 'name')
    at file:///workspaces/bundle/node_modules/.pnpm/@astrojs+telemetry@0.1.2/node_modules/@astrojs/telemetry/dist/events/session.js:53:117
    ...
```

* ci: add tests for optional integrations

* ci: add changeset

* fix(@astrojs/telemetry): count number of optional integrations in use

* ci: add test for counting the total number of optional integrations in use

* ci: update changeset

* chore: make the changes @tony-sull sugested

* revert(@astrojs/webapi): mod.d.ts -> a4c78b5: [ci] format

* ci: remove `@astrojs/webapi` patch change

* chore(@astrojs/telemetry): remove totalIntegrations payload field

* fix(@astrojs/telemetry): add optional integrations field

* ci: add changeset
2022-06-16 14:53:07 -04:00
Tony Sullivan
493441f57b Revert "restarting dev server between each error test"
This reverts commit 49e4453acc.
2022-06-16 12:56:57 -05:00
Tony Sullivan
49e4453acc restarting dev server between each error test 2022-06-16 12:49:48 -05:00
github-actions[bot]
81104a9335
[ci] release (#3604)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-16 12:05:10 -04:00
matthewp
5d11c6d56f [ci] format 2022-06-16 14:14:44 +00:00
Richard Cooke
7f42358141
feat: add SSR adaptor for cloudflare pages functions (#3600) 2022-06-16 10:12:25 -04:00
matthewp
f6cdf1202e [ci] format 2022-06-16 13:55:54 +00:00
Matthew Phillips
4916b733c2
Inline hydration directive scripts (#3605)
* Inline hydration scripts

* Adds a changeset

* Update directiveAstroKeys type
2022-06-16 09:54:09 -04:00
tony-sull
a4c78b544e [ci] format 2022-06-15 19:50:36 +00:00
Tony Sullivan
0ddcef2043
Adds support base64 encoding in Netlify Functions (#3592)
* Adding support for base64 encoded responses in Netlify Functions

* chore: add changeset

* removing the regex check for a more simple header-based check

* nit: cleaning up the readme a bit
2022-06-15 19:49:09 +00:00
Ari Gibson
0ffc350c8d
fix: check node version and find acceptable host accordingly (#3599) 2022-06-15 10:26:55 -05:00
matthewp
f1f207839a [ci] format 2022-06-15 12:52:13 +00:00
Matthew Phillips
fc52321a88
Consolidate hydration scripts into just one (#3571)
* Remove redundant hydration scripts

* Prebuild the island JS

* Fix build

* Updates to tests

* Update more references

* Custom element test now has two classic scripts

* Account for non-default exports

* Restructure hydration directives

* Move nested logic into the island component

* Remove try/catch
2022-06-15 08:50:05 -04:00
github-actions[bot]
31e3224319
[ci] release (#3596)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-14 15:46:51 -05:00
natemoo-re
b49bf0c480 [ci] format 2022-06-14 20:32:18 +00:00
Nate Moore
5ab9d573f6
Collect project meta info (#3587)
* chore: add project meta

* Update index.ts
2022-06-14 15:30:39 -05:00
matthewp
7832c6a260 [ci] format 2022-06-14 20:28:50 +00:00
Matthew Phillips
330fef448e
Handle importing multiple CSS packages in same bundle (#3595)
* Handle importing multiple CSS packages in same bundle

* Changeset
2022-06-14 16:27:21 -04:00
natemoo-re
d32f6723a0 [ci] format 2022-06-14 20:23:09 +00:00
Pascal Schilp
23fceb93ac
feat: implement injectRoute (#3457)
* feat: implement injectRoute

* chore: make ts happy

* feat: add route collision detection and error message

* fix: case sensitivity in route collision detection

* chore: ts

* fix: improve route collision logic

* chore: make ts happy

* chore: update error message

* refactor: lowercase route

* fix: inject routes when no pages

* Update packages/astro/src/integrations/index.ts

Co-authored-by: Nate Moore <nate@skypack.dev>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-14 15:21:23 -05:00
Don Denton
48161b77ca
Fix unintentional missing type data in MarkdownInstance (#3397)
* Update MarkdownInstance type

The return of the `default` function includes the same `frontmatter`
data as the parent object, merged with the `astro` data. The inclusion
of that frontmatter type was previously not recognized by TS, and fell
back to a `Record<string, any>`. This change persists the more accurate
type, as the runtime code does.

* fixup! Update MarkdownInstance type

(This change is what I'd personally do, but I don't really know how you
expect people to use `MarkdownContent` in practice, or if there is some
deeper benefit you wish to exploit by leaving it as an interface instead
of a type.
2022-06-14 15:20:13 -05:00
github-actions[bot]
acc8afbdda
[ci] release (#3594)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-14 15:51:10 -04:00
Matthew Phillips
0e2314d8e5
Fix inlined hoisted scripts and SSR (#3593)
* Fix inlined hoisted scripts and SSR

* Adds a changeset
2022-06-14 15:14:15 -04:00
(◕ᴥ◕)
56a99bebbe
Generate tailwind config with type imported (#3585) 2022-06-14 14:13:32 -05:00
matthewp
60653c7340 [ci] format 2022-06-14 18:10:04 +00:00
Okiki Ojo
d46f8fb14d
feat: support optional and conditional integrations (#3590)
* feat(integrations): support optional integrations

By making integration optional, Astro can now ignore null or undefined Integrations instead of giving an internal error most devs can't read/won't understand.

This also enables optional integrations,
e.g.
```ts
integration: [
  // Only run `compress` integration in production environments, etc...
  import.meta.env.production ? compress() : null
]
```

* ci: add tests for optional integration

* docs: add changelog
2022-06-14 14:08:14 -04:00
github-actions[bot]
c54b024803
[ci] release (#3569)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-10 21:07:03 -05:00