Commit graph

1827 commits

Author SHA1 Message Date
Alexey Shmalko
c54a115e29 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-02-03 12:18:19 -05:00
Renato Lacerda
dc37849f1d Fix GetPictureResult interface (#5894) 2023-02-03 12:18:19 -05:00
Houston (Bot)
7de72f3417 [ci] release (#6041)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-03 12:18:19 -05:00
Nate Moore
0f007f3d56 Handle invalid argument errors (#6045)
* fix: add error handling for invalid arguments

* chore: add changeset

* Update packages/astro/src/core/errors/errors-data.ts

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

---------

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-02-03 12:18:19 -05:00
Matthew Phillips
df32011652
Fix Cloudflare directory mode regression (#6046)
* Fix Cloudflare directory mode regression

* Adding a changeset
2023-01-30 14:50:44 -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
Nate Moore
e779c62424
fix(#5922): improve top-level return error (#6036)
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-30 11:37:13 -06:00
Matthew Phillips
071e1dee7e
Simplified head injection (#6034)
* Simplified head injection

* Make renderHead also yield an instruction

* Add changeset

* Add mdx test
2023-01-30 11:55:10 -05:00
Ben Holmes
b4432cd6b6
[Content collections] Load MDX hoisted scripts in dev (#6035)
* chore: script, rename delayed -> propagated

* fix: consistent propagatedAssets flag

* feat: inject those scripts in dev!

* test: scripts included in dev and build

* chore: add TODO for prod build fix

* chore: changeset
2023-01-30 11:22:17 -05:00
Happydev
98a4a914bc
Remove outdated MDX import types (#6024) 2023-01-30 16:48:40 +08:00
Caleb Jasik
9c298aa5ae
@astrojs/image: Allow passing undefined to transform options (#6008)
* Allow passing `undefined` to transform options

This fixes #6001, allowing undefined passed as a variable in addition to not passing the property at all

* Create strange-olives-rest.md

* Improve error message for missing `widths` prop

* Add changeset
2023-01-27 18:05:00 +01:00
Tony Sullivan
b994f6f35e
Makes the AstroCookies type importable directly from "astro" (#6006)
* re-exports the AstroCookie type from the main 'astro' types

* chore: add changeset
2023-01-27 11:00:24 -06:00
Juan Miguel Guerrero
1c230f1037
feat(@astrojs/netlify): Add on-demand builders Netlify functions (#5874)
* Add on-demand builders option

* chore: add changeset

* docs: add documentation in configuration section

* Update packages/integrations/netlify/README.md

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

* Update packages/integrations/netlify/README.md

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

* Update packages/integrations/netlify/README.md

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

* Update .changeset/twenty-pans-agree.md

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

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-27 10:20:34 -05:00
Roy Eden
254eb21c83
fix: autoprefixer on dev mode for tailwind plugin (#6002)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-27 23:14:19 +08:00
Anders Kaseorg
12c68343c0
fix: Don’t require getCollection() filter to be a type guard (#5998)
Commit dabce6b8c6 (#5970) broke the use
of a plain boolean filter.  Add an overload similar to TypeScript’s
Array#filter overload:

https://github.com/microsoft/TypeScript/blob/v4.9.4/lib/lib.es5.d.ts#L1442-L1453

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-01-26 21:03:09 -05:00
Chris Banford
5c64324c0a
Add a check for existing .git directory (and skip if one is found). (#5953)
* Add a check for existing .git directory (and skip if one is found).

* Changeset attempt :-)

* Update .changeset/try-button-rumor.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-26 15:34:49 -05:00
银河渡舟
322e059d0d
fix: undefined remarkPluginFrontmatter after calling render method (#5927)
* Update vite-plugin-content-assets.ts

* Add changeset for #5927

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Co-authored-by: Anders Kaseorg <andersk@mit.edu>
2023-01-26 13:47:09 -06:00
Subha Chanda
1c7eef308e
Updated according to new configuration (#5478)
* Updated according to new configuration

Astro imports the `defineConfig` function from `astro/config`. The `integrations` key needs to be passed into the `defineConfig` function, but it is not shown in the README. Updated the README according to the CLI example.

* update alpine

* update image

* update lit

* update mdx

* update preact

* update prefetch

* update react

* update sitemap

* update solid

* update svelte

* update tailwind

* update turbolinks

* update vue

* chore: add changeset

* update image

* update svelte readme

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-26 13:03:00 -06: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
Angus
088f5194c5
Re-enable streaming on Cloudflare Pages (#5914)
* Support streaming on Cloudflare Pages

* Create tidy-ties-repeat.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-26 07:44:09 -06:00
wulinsheng123
aedf23f858
fix: component is not able to use a custom theme anymore (#5952)
* Astro <Code> component is not able to use a custom theme anymore

* Astro <Code> component is not able to use a custom theme anymore

* Astro <Code> component is not able to use a custom theme anymore

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-25 17:21:15 -06:00
Yaroslav Lapin
883e0cc299
change @astrojs/solid to @astrojs/solid-js (#5971)
* change @astrojs/solid to @astrojs/solid-js

@astrojs/solid package doesn't exist

* Create serious-turtles-explode.md

* Update .changeset/serious-turtles-explode.md

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-01-25 17:21:03 -06:00
HiDeoo
9d4bfc76e8
Support passing children as props to a React component (#5886) 2023-01-25 16:31:57 -06:00
Ben Holmes
dabce6b8c6
[Content collections] Support type guards on getCollection() filter (#5970)
* fix: respect type guards from collection filter

* chore: changeset
2023-01-25 16:21:27 -06:00
Nate Moore
b53e0717b7
Handle unmatched 404 when using prerender in dev mode (#5983)
* fix(#5975): unmatched static paths should 404 during dev

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-25 13:57:32 -06: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
Matthew Phillips
f4c71e5eb9
Protect against shimmed process usage in Vercel Edge (#5969)
* Protect against shimmed process usage in Vercel Edge

* Adding a changeset
2023-01-24 21:11:09 -05: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)
398a516f03
[ci] release (#5959)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-24 11:12:02 -06:00
Nate Moore
d0d7f61182
fix(create-astro): typescript prompt handling (#5958)
* fix(create-astro): typescript prompt handling

* fallback

* fix(create-astro): additional case

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-24 11:01:26 -06: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
Matthew Phillips
58dfdc5a36
Bump lit changesets to minor (#5954) 2023-01-24 10:55:56 -05:00
Matthew Phillips
8c03c76923
Exit pre mode (#5947) 2023-01-23 16:30:21 -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
Matthew Phillips
c61ec4202a
Go back to pre-mode (#5946) 2023-01-23 16:08:46 -05:00
Matthew Phillips
453b373dc5
Exit pre-mode for 2.0 release (#5942) 2023-01-23 15:07:51 -05:00
Ben Holmes
304823811e
[Content Collections] Add slug frontmatter field (#5941)
* feat: respect `slug` frontmatter prop

* chore: replace `slug` check with proper types

* fix: regen types on `slug` change

* chore: add TODO on slug gen

* tests: update to use `slug` frontmatter prop

* chore: add error message on `slug` inside object schema

* lint

* chore: add note on frontmatter parse

* refactor: move content errors to new heading

* chore: ContentSchemaContainsSlugError

* chore: changeset

* docs: be 10% less gentle

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

* fix: avoid parsing slug on unlink

* docs: clarify old API is for beta users

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-23 15:04:56 -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
Bjorn Lu
4987d6f44c
Handle custom injected entry files during build (#5499) 2023-01-23 23:00:05 +08:00
Matthew Phillips
f5adbd6b55
Support prerender in Netlify redirects (#5904)
* Support prerender in Netlify redirects

* Updated sorting algorithm

* Update packages/integrations/netlify/src/shared.ts

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-01-23 09:47:33 -05:00
Happydev
9e57268f13
fix(@astrojs/tailwind): manually load postcss config file (#5908) 2023-01-23 22:46:19 +08:00
Rishi Raj Jain
77ae7a597a
fix: trailingSlash with base breaking partytown file path (#5936)
* fix: trailingSlash with base breaking partytown file path

* Update index.ts

* Update index.ts

* Update index.ts

* fix lint

* Update index.ts
2023-01-23 09:43:06 -05:00
heyhoe
46ecd5de34
Update magic-string used by @astrojs/image and @astrojs/webapi (#5930) 2023-01-22 17:11:19 +08:00
Chris Swithinbank
f32bf07c19
Improve Svelte README (#5923)
* First stylistic pass

* Rework for x/o instead of and

* fix typo

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

* Add changeset

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-21 10:55:19 +01:00
Chris Swithinbank
f27bb3d79f
Improve error message for third-party template 404s (#5920) 2023-01-21 00:04:39 +01:00
Reuben Tier
d8919b1a21
Add headless support to create-astro (#5898)
* Add headless support to create-astro

* Document new flags for create-astro
2023-01-20 08:53:12 -06:00