Commit graph

2352 commits

Author SHA1 Message Date
Nate Moore
98f242cdcd
Throw helpful errors when attempting to serialize cyclic references (#4646)
* fix(#4332): add helpful error on cyclic references

* chore: add changeset

* test(e2e): add cyclic reference test

* test(e2e): add preact integration

* chore: update lockfile

* fix: ensure vite client is loaded for 500 responses

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-07 13:25:26 -05:00
tony-sull
b5a91d40b7 [ci] format 2022-09-07 17:26:36 +00:00
Valentin Bersier
e4348a4eb4
@astrojs/image: add a background option/prop to replace the alpha layer (#4642)
* Added `background` option and prop.
This optional color specifies which background to use when removing the
alpha channel if the output format doesn't support transparency.

* Modified existing tests

* Fixed wrong dimensions in tests

* Fixing a few instances of jpeg vs jpg

* Added color checking

* working on the tests

* tests are now passing

* Adding tests

* Added tests for background color

* no need to test with subpath

* Added fixture

* Renamed test fixture for background-color

* skipping test until fixed

* Typo

* Working on tests

* tests are passing

* Updated readme and added changeset

* Updated lockfile

* Updated lockfile

* Updated lockfile

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-09-07 17:22:11 +00:00
Tony Sullivan
93c3aee01c
fixes an eslint error (#4659) 2022-09-07 16:33:57 +00:00
tony-sull
c080438b89 [ci] format 2022-09-07 13:57:52 +00:00
Tony Sullivan
db70afdcd5
[@astrojs/image] Fixes a regression in remote image filenames (#4649)
* fixes a bug in filename creation for remote images without a file extension

* chore: add changeset
2022-09-07 13:56:07 +00:00
Matthew Phillips
6d845c353d
Upgrade minimum compiler version (#4656)
* Upgrade minimum compiler version

* Add changeset

* Update lockfile
2022-09-07 08:29:54 -04:00
Tibor Schiemann
d693e365ca
Integrations: Fix NPM instructions to use npx astro add again (#4653)
* Fix install instructions to use `npx astro` again

* Replace joyful hiccups with regular issues :)
2022-09-07 12:08:58 +02:00
Fred K. Bot
481e0d1d8a
[ci] release (#4620)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-06 15:40:15 -04:00
matthewp
d1d1e0ec12 [ci] format 2022-09-06 19:05:35 +00:00
Matthew Phillips
307b7b97ce
When removing duplicate CSS, also remove from metadata (#4643)
* When removing duplicate CSS, also remove from metadata

* Adding a changeset
2022-09-06 15:03:02 -04:00
Chris Swithinbank
eb1862b4e6
Improve third-party Astro package support (#4623) 2022-09-06 19:04:56 +02:00
matthewp
91a9cb0764 [ci] format 2022-09-06 15:12:47 +00:00
Matthew Phillips
f08ca005e2
Add vueperslides to noExternal in vue integration (#4639) 2022-09-06 11:11:01 -04:00
tony-sull
29f044267f [ci] format 2022-09-06 14:32:19 +00:00
Alan
494c2b8353
Parallelize @astrojs/image transforms (#4626) 2022-09-06 14:29:20 +00:00
Sarah Rainsberger
5231ec05d2
[docs] update adapter READMESs to include astro add (#4595)
* update adapter READMES to include astro add

* missing space

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

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-09-06 08:53:47 -04:00
Dan Jutan
e6c80843f8
use unused self-documenting variable (#4605) 2022-09-06 08:41:36 -04:00
Allan Chain
0068afb876
fix: ensure SSR module is loaded before testing is CSS (#4621) 2022-09-06 08:25:26 -04:00
Mohammed Elhaouari
63cd9d89e8
Fix AlpineJS homepage link (#4622)
* Update AlpineJS homepage

* Add changeset
2022-09-04 15:53:54 +02:00
Bjorn Lu
29a5fdc153
Correctly escape paths in file names (#4584) 2022-09-04 16:43:47 +08:00
Yan Thomas
893a02a1bb
Add deploy guides links to integrations READMEs (#4612) 2022-09-03 17:23:44 -03:00
Vinício Augusto
4d02f7775c
Typo in alpinejs integration README.md (#4611) 2022-09-03 21:46:51 +02:00
Fred K. Bot
7114aee208
[ci] release (#4604)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 16:50:59 -04:00
matthewp
e76c2afd1f [ci] format 2022-09-02 20:47:04 +00:00
Matthew Phillips
36dee7169b
Provide a better error message when no jsx renderer configured (#4603)
* Provide a better error message when no jsx renderer configured

* Add a changeset
2022-09-02 16:45:17 -04:00
Fred K. Bot
592de3d703
[ci] release (#4589)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 16:13:04 -04:00
Chris Swithinbank
eb4eebde9e
Fix image integration README (#4599)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-09-02 17:05:04 +02:00
matthewp
c220f53b21 [ci] format 2022-09-02 01:29:14 +00:00
Matthew Phillips
8476f2a293
Fix client:only when used with JSX (#4592) 2022-09-01 21:27:26 -04:00
Fred K. Schott
f018e365cf
Small polish to the "missing adapter" error message (#4585)
* improve output server error message

* chore: changeset

Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-09-01 21:34:20 +00:00
tony-sull
c62257f0b0 [ci] format 2022-09-01 21:26:15 +00:00
Jan Müller
72c760e9b8
feat(image): throw if alt text is missing (#4511)
* feat(image): throw if no `alt` is provided

* chore: add changeset

* docs(image): update README

* updated alt text stuff throughout

* fixing with-mdx test suite

* warn for missing alt text, will throw an error in a future release

* final README tweaks

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-09-01 21:24:07 +00:00
tony-sull
df402ddc93 [ci] format 2022-09-01 20:34:20 +00:00
Tony Sullivan
56f83be92a
Fix: [@astrojs/image] handle filenames with spaces (#4593)
* fix: decode file URLs to handle filenames with spaces

* chore: add changeset
2022-09-01 20:31:53 +00:00
Bjorn Lu
16814dc718
Move ast-types as dev dependency (#4586) 2022-09-01 12:33:29 -04:00
Ben Holmes
db38f61b2b
[MDX] Fix: GFM and Smartypants missing by default (#4588)
* fix: apply Astro defaults on empty md config

* chore: changeset
2022-09-01 12:11:13 -04:00
tony-sull
ef0ed38339 [ci] format 2022-09-01 15:01:07 +00:00
Tony Sullivan
aeae89d6ae
refactor: Cleaning up all uses of hard-coded hashes in image tests (#4579) 2022-09-01 14:58:57 +00:00
Fred K. Bot
005d53145f
[ci] release (#4555)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-31 18:03:27 -04:00
Chris Swithinbank
b92c24f409
Update astro add integrations list (#4574) 2022-08-31 23:49:08 +02:00
matthewp
fa48d01109 [ci] format 2022-08-31 20:14:25 +00:00
Zicklag
294122b4e4
Deno custom 404 pages (#4562)
* Add Failing Test For Deno Custom 404 Pages

* Make Deno SSR Serve Custom 404 Pages
2022-08-31 16:11:46 -04:00
Bjorn Lu
9ad307a9fc
Remove unused CSS for client:load components (#4566) 2022-08-31 22:36:41 +08:00
tony-sull
6f1fbd8be0 [ci] format 2022-08-30 21:12:45 +00:00
Tony Sullivan
00c605ce35
Image integration refactor and cleanup (#4482)
* WIP: simplifying the use of `fs` vs. the vite plugin

* removing a few node deps (etag and node:path)

* adding ts defs for sharp

* using the same mime package as astro's core App

* fixing file URL support in windows

* using file URLs when loading local image metadata

* fixing a bug in the etag helper

* Windows compat

* splitting out dev & build tests

* why do these suites fail in parallel?

* one last windows compat case

* Adding tests for treating /public images the same as remote URLs

* a couple fixes for Astro's `base` config

* adding base path tests for SSR

* fixing a bad merge, lost the kleur dependency

* adding a test suite for images + MDX

* chore: add changeset

* simplifying the with-mdx tests

* bugfix: don't duplicate the period when using existing file extensions

* let Vite cache the image loader service

* adding some docs for using /public images

* fixing changeset

* Update packages/integrations/image/README.md

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

* Update packages/integrations/image/README.md

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

* nit: minor README syntax tweaks

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 21:09:44 +00:00
Tony Sullivan
7429664566
Adds the "withastro" keyword to adapter packages (#4558)
* adds the "withastro" keyword to adapter packages

* chore: add changeset
2022-08-30 20:19:19 +00:00
bholmesdev
385a8f052f [ci] format 2022-08-30 17:41:06 +00:00
Ben Holmes
8f8dff4d33
[MDX] Extend Markdown plugin config, with customization options (#4504)
* test: new combined remark / rehype suite

* fix: use with-plugins fixture

* chore: remove old mdx plugin tests

* docs: add JS docs

* docs: update README with thorough example

* chore: changeset

* fix: add "extends" error message

* fix: ignore string-based plugins in md

* feat: add warning log for string plugins

* docs: highlight `extendPlugins`

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

* nit: highlight "extendPlugins"

* fix: md plugins type check

* chore: "defaults" -> "astroDefaults"

* nit: info log when inheriting markdown plugins

* refactor: one big log on new behavior

* dan: dan nit

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 13:38:35 -04:00
Fred K. Bot
e905784bf1
[ci] release (#4520)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-30 12:45:04 -04:00
Kyle F Butts
8504cd79b7
Add custom components to mdx integration guide (#4530)
* Add custom components to mdx integration guide

* Update packages/integrations/mdx/README.md

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

* Update packages/integrations/mdx/README.md

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

* Update packages/integrations/mdx/README.md

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

* Update packages/integrations/mdx/README.md

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

* Incorporate Sarah and Ben's Feedback

* Fix what would be an ugly background lol

* Sarah taking liberty of removing double text

* Add changeset

Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-30 11:55:52 -04:00
matthewp
65cc3f64f6 [ci] format 2022-08-30 15:47:42 +00:00
Matthew Phillips
2f05f5d307
Include trailingSlash in astro:build:done hook (#4553) 2022-08-30 11:45:16 -04:00
Ben Holmes
69b640b87c
Fix "failed to load for SSR" error when removing Astro <style> blocks (#4548)
* wip: try removing ssrLoadModule on styles

* chore: changeset

* fix: invalidate mod before crawling graph

* Revert "fix: invalidate mod before crawling graph"

This reverts commit 883710d21c.

* Revert "wip: try removing ssrLoadModule on styles"

This reverts commit 880e73d94a.

* SAD fix: try/catch on ssrLoadModule

* refactor: isFile -> isRootFile

* docs: update comments for new findings
2022-08-30 11:27:19 -04:00
Sarah Rainsberger
00ea2267e2
[docs] remove confusing note added in wrong place (#4551) 2022-08-30 08:23:24 -04:00
Bjorn Lu
9adb7cca33
Vite ignore unknown import (#4527) 2022-08-30 15:25:34 +08:00
Ben Holmes
bb71be78db
[astro add] Add an Adapter -> Add an SSR Adapter (#4546)
* nit: Add an Adapter -> Add an SSR Adapter

* chore: changeset
2022-08-29 17:05:12 -04:00
Matthew Phillips
1222ab9540
Configures Lit to work with its decorators (#4503)
* Configures Lit to work with its decorators

* Remove comment
2022-08-29 14:06:36 -04:00
Bjorn Lu
046bfd908d
Skip clean SSR output if page generation fails (#4526) 2022-08-29 23:59:25 +08:00
Bjorn Lu
2d2e38e473
Remove hardcoded Vite middleware handling (#4531) 2022-08-29 23:11:18 +08:00
Erika
ca28d7578b
Add missing slot attribute to possible attributes on SVG elements (#4535) 2022-08-29 12:06:50 -03:00
Erika
b8a80bc42d
Fix image integration's types not referring to the base types for Vite client types (#4534) 2022-08-29 12:06:41 -03:00
Bjorn Lu
fc32e2d94c
Fix @astrojs/node typo (#4525) 2022-08-29 17:02:44 +08:00
Tim Rinkel
9389517f63
Update README.md (#4517) 2022-08-29 16:42:27 +08:00
applemonkey496
d431fbe4e1
fix: config type import (#4524) 2022-08-29 00:12:58 -03:00
Juan Martín Seery
a2e8e76c30
chore: updated shiki (#4519)
* Upgraded shiki

* Use setColorReplacements

* no-shadow

* Changeset
2022-08-28 08:23:37 -03:00
Fred K. Bot
270852370a
[ci] release (#4508)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-26 21:30:37 -03:00
Erika
4e1af3f0e8
Fix import-meta.d.ts not being included in the package (#4507) 2022-08-26 19:28:34 -03:00
Fred K. Bot
d85133393a
[ci] release (#4502)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-26 13:03:04 -07:00
Fred K. Schott
8d6978b8d0
Update README.md 2022-08-26 11:50:30 -07:00
Mohammed Elhaouari
17e2178568
Add renderer keyword to alpinejs integration (#4501)
* Add renderer keyword to alpinejs

* Add changeset
2022-08-26 11:50:11 -07:00
Fred K. Bot
ff03313848
[ci] release (#4495)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-26 13:01:30 -04:00
Erika
9874c7bf42
Update astro check to use latest version of the language server (#4500)
* Update @astrojs/language-server to latest version

* Add changeset

* Update lockfile
2022-08-26 12:54:38 -03:00
Erika
1f42c0791c
Vendor Vite's importMeta.d.ts inside our repo to workaround issue with tsc on Linux (#4499)
* Update @astrojs/language-server to latest version

* Vendor importMeta.d.ts from Vite inside our repo to workaround TypeScript issue on Linux

* Remove unnecessary change

* Add changeset
2022-08-26 12:47:39 -03:00
Ben Holmes
78e06c8ec0
Only print file output only for 404 and 500 routes (#4497)
* fix: print file output only for 404 and 500 routes

* chore: changeset
2022-08-26 11:35:30 -04:00
Abdullah Mzaien
824a2adddd
chore: update to solid 1.5 (#4496) 2022-08-26 11:11:57 -04:00
Mark Spratt
7efbda97af
Edit Alpinejs content generation for Docs (#4466)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-26 10:14:40 -03:00
Bjorn Lu
ba697da4c2
Note private env var handling with cloudflare builds (#4490) 2022-08-26 09:03:22 -04:00
Tc001
ca24a60b13
Earlier import snippet for @astrojs/image (#4484)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-25 19:39:22 -03:00
Fred K. Bot
7960fb80a1
[ci] release (next) (#4480)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-25 17:27:35 -04:00
matthewp
4faee5afed [ci] format 2022-08-25 21:24:13 +00:00
Ben Holmes
ac03218247
[MD] extendDefaultPlugins to preserve default remark plugins (#4474)
* feat: add { extends } to markdown config

* test: remark plugins with extends

* deps: pnpm lock

* chore: changeset

* fix: remarkPlugins -> rehypePlugins

* docs: update markdown config reference

* Revert "feat: add { extends } to markdown config"

This reverts commit 5d050bbcf9a2c0d470cae79c4d0a954d489f4e8c.

* feat: new "extendDefaultPlugins" flag

* docs: update config

* nit: We -> Astro applies

* fix: backticks on `false`

* nit: Note -> REAL note

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

* docs: note -> caution

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-25 17:21:56 -04:00
Ben Holmes
d4cd7a59fd
Update Markdown type signature to match behavior (#4423)
* feat: "file" and "url" top-level layout props

* test: markdown file and url

* test: mdx file and url

* feat: update MarkdownInstance + JSDoc improvements

* chore: changeset
2022-08-25 17:08:43 -04:00
matthewp
9cff515318 [ci] format 2022-08-25 20:32:45 +00:00
gtnbssn
839097c84e
make Remark rehype options available in astro config (#4138)
* make remark-rehype config available in astro.config.mjs

* add test for remark-rehype config, checks that footnotes can be translated

* update lockfile to take the added test into account

* omit handlers and unkownHandler from the RemarkRehype type

* define RemarkRehype with proper references to the handler and handlers types

* formatting

* changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-25 16:30:16 -04:00
matthewp
b680c3eb97 [ci] format 2022-08-25 19:23:09 +00:00
Matthew Phillips
cd154e447b
Make Astro.url conform to build.format during the build (#4352)
* Make Astro.url conform to build.format during the build

* Adding a changeset

* Better implementation

* fix some stuff that tests failed on

* Add docs

* Change to minor

* account for empty path
2022-08-25 15:20:59 -04:00
Erika
77ce6be30c
Add template tsconfigs for users to extend from (#4439)
* Add tsconfig templates to extend from

* Add changeset

* Right order for assign parameters

* Add tsconfigs to export map
2022-08-25 15:15:27 -04:00
Aleksander Heintz
fcc36ac908
Make astro package play nice with node16 module resolution (#4182)
* Make astro package play nice with node16 module resolution

Projects using node16 module resolution in typescript uses the new
exports and imports configuration from typescript to find definition
files. This mirrors how nodejs resolves the files. If a package contains
an exports map in the package.json, typescript will ignore the "types"
field (not sure how it plays with typesVersions). This moves the typings
hirearchy of definition files into the same hierarchy that astro
produces output files in, so that typescript can discover them.

Fixes: #4172

* Add changeset

* Reorder export keys

* Update paths inside .d.ts files

Co-authored-by: Princesseuh <princssdev@gmail.com>
2022-08-25 14:57:11 -04:00
matthewp
d48de5a06f [ci] format 2022-08-25 18:53:12 +00:00
Sanjaiyan Parthipan
3b5f34d606
Adding time-slicing with startTransition to prevent hydration from blocking the main thread for too long for those users who immediately scroll. (#4313)
* Adding timeslicing for hydrating  :)

* update
2022-08-25 14:50:45 -04:00
Fred K. Bot
0b66ff39b8
[ci] release (#4453)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-25 12:00:17 -04:00
Erika
47e71ae8f8
Added more clarification around using Astro.slots.render (#4456)
* Add an error message for when something that's not an array is passed to Astro.slots.render

* Add changeset

* Add more details
2022-08-25 11:42:27 -04:00
Matthew Phillips
78334b9765
Revert "Fix invalid hook usage for exports (#4385)" (#4475)
* Revert "Fix invalid hook usage for exports (#4385)"

This reverts commit 8164fa6f1a.

* Adding a changeset
2022-08-25 11:42:02 -04:00
matthewp
ba1ca7e61f [ci] format 2022-08-25 15:16:13 +00:00
Matthew Phillips
9490f0e223
Include styles imported by hoisted scripts (#4457)
* Include styles imported by hoisted scripts

* Add changeset

* remove unused imports
2022-08-25 11:14:22 -04:00
Bjorn Lu
467108730e
Remove optional chaining in astro-island (#4473) 2022-08-25 22:01:22 +08:00
kagankan
8a2d6958f1
Fix load base option in build (#4469) 2022-08-25 09:35:28 -04:00
bluwy
cb0db5ff9d [ci] format 2022-08-25 08:36:41 +00:00
Bjorn Lu
aa555932be
Support vite.build.cssCodeSplit: false option (#4458) 2022-08-25 16:34:13 +08:00