Commit graph

694 commits

Author SHA1 Message Date
Alexey Shmalko
b3e65991f7
fix(image): allow usage of image from any directory (#5932)
Currently, @astrojs/image allows *importing* images from srcDir
only. Importing images from outside srcDir fails miserably *in dev
mode* and produces incorrect src.

This happens because `path.relative(fileURLToPath(config.srcDir), id)`
resolves to "../something" and when joined with '/@astroimage' cancels
it out (`join('/@astroimage', '../../something')` => `'/something'`).

Rework /@astroimage URL scheme to be similar to "/@fs/" scheme—always
export absolute path to the target file.
2023-01-30 15:29:41 -05:00
Houston (Bot)
a2cbc75ac4
[ci] release (#6041)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-30 15:28:32 -05:00
Houston (Bot)
d9787a6ff6
[ci] release (#5995)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-30 12:38:31 -05:00
Houston (Bot)
fbb34e1ef6
[ci] update lockfile (#5988)
* [ci] update lockfile

* fix type issues

---------

Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-30 12:03:32 -05:00
Houston (Bot)
607f0ac31a
[ci] release (#5984)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-26 13:53:32 -05:00
HiDeoo
7abb1e9056
Fix MDX heading IDs generation when using a frontmatter reference (#5978)
* Fix MDX heading IDs generation when using a frontmatter reference

* Hoist safelyGetAstroData() call and add statement null check
2023-01-26 12:52:50 -05:00
Matthew Phillips
9855db676e
Support for prerendering in the Cloudflare integration (#5993)
* Cloudflare prerender branch

* Add prerendered routes to Cloudflare routes.json

* Adding changeset

* Prevent process proxy from running during prerender phase
2023-01-26 12:43:39 -05:00
HiDeoo
60b32d5856
Fix Astro.url.protocol when using the @astrojs/node SSR adapter with HTTPS (#5992) 2023-01-26 12:39:57 -05:00
Houston (Bot)
4842d6acb0
[ci] release (#5963)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-25 10:19:27 +08:00
Bjorn Lu
02549b8ced
Upgrade semver dependency (#5972) 2023-01-25 10:13:47 +08:00
Happydev
46b6e14265
Fix Content Collections not loading config file when there are spaces in the folder tree (#5962)
* fix

* add test

* use `fileURLToPath` instead

* chore: changeset

* remove useless config file

* revert back to using `decodeURIComponent`

* test: better test

* re-revert back to using `fileURLToPath`
2023-01-24 20:00:17 +00:00
Houston (Bot)
73ca0ef383
[ci] release (#5948)
* [ci] release

* Update changelogs (#5955)

* [ci] release

* Wrap astro 2.0 beta logs in `<details>`

* Add link to docs upgrade guide

* First pass cleaning up 2.0 release notes

* mdx changes from Sarah

* combine 5584 and 5842 in deno, image, netlify

* markdown/remark incl (5684 & 5769) to match mdx

* Tweak markdown/remark formatting

* Format astro-prism

* Format astro-rss

* Format create-astro

* Format cloudflare

* Format lit

* Format partytown

* Format node

* Format preact

* Format react

* Format solid

* Format svelte

* Format tailwind

* Format vercel

* Format vue

* Format telemetry

* Format webapi

* Format scripts

* Reinstate h3s for headings

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Reformat mdx

* astro & markdown/remark: Combine #5679 & #5684 changelogs

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-01-24 11:38:06 -05:00
Houston (Bot)
a75177f843
[ci] release (beta) (#5911)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-23 16:11:39 -05:00
Nate Moore
7325df4121
Remove duplicate CSS in dev (#5917)
* fix(#5817): remove duplicate CSS in dev

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-23 12:03:19 -06:00
Happydev
9e57268f13
fix(@astrojs/tailwind): manually load postcss config file (#5908) 2023-01-23 22:46:19 +08:00
heyhoe
46ecd5de34
Update magic-string used by @astrojs/image and @astrojs/webapi (#5930) 2023-01-22 17:11:19 +08:00
Caleb Jasik
5fd9208d44
Update compiler to 1.0.1 (#5909)
* Update compiler to 1.0.1

* Add changeset
2023-01-19 13:51:45 -05:00
Hoston (Bot)
9ddb7a2f2e
[ci] release (beta) (#5906)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-19 11:40:44 -05:00
Ben Holmes
81dce94f2a
[RSS] Get ready for content collections (#5851)
* chore: strictNullChecks for zod

* feat: expose `rssSchema` helper

* refactor: align types with schema types

* feat: break glob handler to globToRssItems util

* refactor: RSS options validation to Zod

* refactor: avoid intermediate type

* fix: allow numbers and dates in pubDate

* test: update glob and error tests

* feat: add rss to with-content starter

* fix: move globToRssItems back to internal behavior

* chore: JSON.stringify

* Revert "fix: move globToRssItems back to internal behavior"

This reverts commit 85305075e6444907455541b24bccbccd5016951a.

* test: missing url

* docs: `import.meta.env.SITE` -> `context.site`

* docs: update README to content collections example

* fix: url -> link

* docs: add `rssSchema` to README

* chore: consistent formatting

* docs: add `pagesGlobToRssItems()` reference

* chore: globToRssItems -> pagesGlobToRssItems

* chore: changeset

* fix: bad docs line highlighting

* fix: add collections export to example

* nit: remove "our"

* fix: are -> all

* fix: more README edits

* deps: kleur

* chore: add back import.meta.glob handling as deprecated

* docs: bump down to `minor`, update headline to be less content collections-y

* typo: suggest adding

* chore: support URL object on `site`

* docs: add await to pagesGlob ex

* docs: tighten `rssSchema` explainer

* docs: tighten pagesGlobToRssItems section

* docs: add content to README

* docs: replace examples with docs link

* docs: re-we

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-19 11:24:55 -05:00
Hoston (Bot)
97267e3881
[ci] release (beta) (#5856)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-19 11:00:03 -05:00
Nate Moore
64b8082e77
chore: update compiler (#5896)
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-18 16:12:00 -06:00
Nate Moore
16dc36a870
Remove legacy compiler error handling (#5855)
* refactor: remove legacy compiler handling

* docs: add hint to unknown compiler error

* feat: add link detection to error overlay

* chore: update compiler

* chore: update compiler issue link

* Update packages/astro/src/core/errors/overlay.ts

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2023-01-18 12:57:31 -06:00
Erika
1bd42c6b2a
Fix image integration not working on Node 18+ (#5871)
* fix(image): Remove unnecessary polyfill now that we dropped Node 14

* fix(squoosh): Remove fetch of local wasm binary since undici doesn't support that

* chore: changeset
2023-01-17 15:48:06 +01:00
Fred K. Bot
02b797fd3c
[ci] release (beta) (#5792)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-12 11:40:35 -05:00
Nate Moore
63a6ceb38d
fix(core): handle encoded characters when matching routes (#5836)
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-12 09:44:18 -06:00
Bjorn Lu
ae8a012a7b
Handle compiler breaking change (#5803) 2023-01-12 22:46:56 +08:00
Fred K. Bot
982e21c164
[ci] update lockfile (#5815)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-11 10:40:11 -06:00
HiDeoo
2303f95142
Add support for serving well-known URIs with the @astrojs/node SSR adapter (#5832) 2023-01-11 17:52:51 +08:00
Dovlat Yakshibayev
813073addd
Bumps partytown version to fix deprecation warning (#5820)
* bumps partytown version, adds changeset

* changes changeset from minor to patch

* changes changeset from minor to patch
2023-01-10 16:05:28 -06:00
wulinsheng123
9869f2f6d8
can jump 404 when that page does not exist (#5701) 2023-01-11 00:59:20 +08:00
Erika
c55fbcb8ed
Remove more unnecessary polyfills from webapi for Node 16 (#5814)
* feat(webapi): Remove unnecessary polyfills now that we dropped support for Node 14

* feat(webapi): Removed more unnecessary polyfills for Node 16

* chore: changeset
2023-01-10 15:29:06 +01:00
Bjorn Lu
4a1cabfe6b
Cleanup dependencies (#5773) 2023-01-10 15:58:55 +08:00
Erika
1f92d64ea3
Drop Node 14 support (#5782)
* chore: Update engines field

* fix(deps): Remove node-fetch

* feat(polyfills): Remove node-fetch for undici

* feat(webapi): Remove node-fetch from the webapis polyfills for undici

* feat(core): Remove node-fetch for undici in Astro core

* feat(telemetry): Remove node-fetch for undici

* feat(node): Remove node-fetch for undici in node integration

* feat(vercel): Remove node-fetch for undici in Vercel integration

* chore: update lockfile

* chore: update lockfile

* chore: changeset

* fix(set): Fix set directives not streaming correctly on Node 16

* Try another approach

* Debugging

* Debug fetch

* Use global fetch if there is one

* changeset for lit

* Remove web-streams-polyfill

* Remove web-streams-polyfill license note

* Update .changeset/stupid-wolves-explain.md

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

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-09 16:59:20 -05:00
Bjorn Lu
302e0ef8f5
Default preview host to localhost (#5753)
* Initial refactor

* Extract as vite plugin

* Cleanup vite plugin

* Reduce option passing

* Use localhost as preview default host

* Simplify base handling

* Fix host handling

* Add changeset

* Remove unused imports

* Remove unused sirv dep

* Try pin playwright to 1.28.1

* Update playwright

* Try this

* Speed up CI

* Try fix page off

* Refactor networkidle

* Ensure open connections are destroyed when the preview server is closed

* Revert debug code

Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
2023-01-09 12:14:07 -05:00
Chris Swithinbank
f35411487b
[markdown-remark] Remove unused dependencies (#5804)
* [markdown-remark] Remove unused dependency

Follow up to #5785. Missed one dependency that is no longer used and can be removed.

* [markdown-remark] Remove unused dependency

* Lockfile fix

* Update lockfile [again]
2023-01-09 17:06:29 +01:00
Nate Moore
f8f4d49aba
Output assets to _astro directory (#5772)
* WIP: emit assets to _astro

* chore: better _astro handling

* refactor: emit server assets to `chunks/`

* chore: update /asset tests

* test: add explicit build output tests

* fix: update image to emit to configured asset path

* chore: update changeset

* chore: update image tests

* chore: update image tests

* test: update css test

* test: update bundling test

* test: update tests

* Update packages/astro/src/@types/astro.ts

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

* Update packages/astro/src/@types/astro.ts

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

* Update packages/astro/src/@types/astro.ts

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

* chore: add clarifying comment

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-01-09 10:01:33 -06:00
Fred K. Bot
32b0795bc0
[ci] update lockfile (#5805)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-09 09:28:53 -05:00
Chris Swithinbank
16107b6a10
Remove Astro-flavored Markdown from @astrojs/markdown-remark (#5785) 2023-01-09 10:23:21 +01:00
Fred K. Bot
0be2d0dbc2
[ci] update lockfile (#5790)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-09 15:25:01 +08:00
Sebastiaan
f7aa1ec25d
[@astrojs/lit] Fix slotted content into main (#5791)
* Fix  add the missing slot attribute to child nodes

* Add lit slot tests

* Add changeset
2023-01-07 08:29:16 -05:00
Fred K. Bot
ec5a39c299
[ci] release (beta) (#5742)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-06 13:00:12 -05:00
Bjorn Lu
49ab4f231c
Remove proload for config loading (#5778)
* Refactor resolve and load config

* Add changeset

* Update name

* Remove unnecessary node_env handling

* Fix test

* Update comment
2023-01-06 12:49:18 -05:00
Fred K. Bot
23937fbbc9
[ci] update lockfile (#5775)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-06 10:29:58 -05:00
Ben Holmes
93e633922c
Add SmartyPants flag (#5769)
* feat: add smartypants flag

* test: smartypants in markdown and mdx

* docs: Smartypants -> SmartyPants

* chore: changeset

* chore: update changeset with 1.0 -> 2.0 in mind

* chore: bump to minor change
2023-01-06 09:26:02 -05:00
Nate Moore
9ef0c50427
Update compiler (#5656)
* chore: update compiler

* chore: pin compiler

* update compiler

* update changeset

* chore: test prerelease

* chore: update compiler

* chore: update lockfile

* chore: do not pin compiler

* Delete fresh-kids-serve.md

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-05 10:43:57 -06:00
Fred K. Bot
17608762e1
[ci] update lockfile (#5764)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-05 09:22:54 -06:00
Matthew Phillips
116d8835ca
Fix for hoisted scripts in project with spaces in the file path (#5756)
* Fix for hoisted scripts in project with spaces in the file path

* Adding a changeset

* Use viteID instead
2023-01-04 15:36:44 -05:00
Nate Moore
55cea0a9d8
Handle getStaticPaths with prerendered pages (#5734)
* fix(#5661): ensure getStaticPaths is correctly handled for prerendered pages

* test: add prerender getStaticPaths cases

* chore: add changeset

* test: add props to test suite

* chore: update lockfile

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-04 13:20:13 -06:00
Fred K. Bot
cc4606d65e
[ci] update lockfile (#5744)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-04 10:45:33 -06:00
Erika
2a57864195
Add file location to errors in build (#5743)
* feat(errors): Add file location where error happened during build for user-generated errors

* chore: changeset

* fix(errors): Only add information if the error is in a compatible shape

* feat(errors): Add hint to throw Error objects instead of other types for better information

* test(errors): Add test to make sure errors in build have the error location

* chore(lockfile): Update lockfile

* chore: misc text fixes
2023-01-04 13:31:28 +01:00