Commit graph

2260 commits

Author SHA1 Message Date
adenpun
42baf62e7c
Fixed AstroUserConfig's redirect type definition (#7366) 2023-06-12 16:34:05 +08:00
Houston (Bot)
4f7091206c
[ci] release (#7354)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-10 13:54:36 -04:00
Ben Holmes
0a8d178c90
Raise error for duplicate content entry slugs (#7352)
* chore: throw error on dup slugs

* chore: move to ErrorData

* fix: remove unknownerror

* chore: changeset
2023-06-10 13:49:17 -04:00
Ben Holmes
a30f2f3de4
Fix Markdoc cloudflare errors (#7351)
* fix: move `node:` libs out of utils

* fix: node -> default

* chore: remove kleur from markdoc ex (why was this there??)

* chore: lock

* chore: changeset
2023-06-10 13:43:26 -04:00
Ben Holmes
491c2db424
Fix: better collection entry devalue error (#7341)
* feat: add clear error for devalue parse

* refactor: create error data entry

* deps: up devalue

* chore: changeset
2023-06-09 18:15:11 -04:00
Houston (Bot)
e138f66344
[ci] release (#7318)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-09 08:40:17 +03:00
Caleb Williams
1430ffb473
Fixes an issue where create Astro doesn't respect custom npm registries (#7326)
* Fixes an issue where create Astro doesn't respect custom npm registries

* chore: fix pnpm-lock

* chore: update lockfile

---------

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-09 07:56:29 +03:00
Matthew Phillips
bbcf69e7b8
Fix redirects in dev mode (#7342)
* Fix redirects in dev mode

* Adding a changeset
2023-06-09 07:54:14 +03:00
Matthew Phillips
3d9a392a09
Remove error message for using Markdown component (#7343) 2023-06-09 07:41:08 +03:00
Ben Holmes
e3271f8c16
Better dynamic route regex error (#7339)
* feat: add helpful invalid route seg error

* chore: add errors-data entry

* refactor: add hint for non-spread errors

* chore: add `undefined` to common cases

* nit: if the param contains slashes

* chore: changeset

* chore: it's trivial my dear watson
2023-06-08 18:12:39 -04:00
Edo-San
52f0480d14
Fix/update spread attribute (#7310)
* fix: add default fallback for spreadAttributes values

* chore: add PR changeset

* chore: fix pnpm lock

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-08 15:58:17 -05:00
Ben Holmes
e6bff651ff
Fix: catch and report config errors from handleConfigError (#7316)
* fix: catch and report config errors from `handleConfigError`

* chore: changeset
2023-06-07 09:59:20 -04:00
Bjorn Lu
a4176f98b8
Mark #7314 changeset as major (#7320) 2023-06-07 14:58:55 +08:00
wackbyte
e47e53dc0c
Update to svelte2tsx 0.6.15 and vite-plugin-svelte 2.4.1 (#7314) 2023-06-06 18:07:43 -05:00
Houston (Bot)
8a029d9889
[ci] release (#7312)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-06 17:24:57 -04:00
Ben Holmes
a11b62ee1f
Fix: Markdoc type errors (#7311)
* fix: config, prism, shiki exports

* fix: type error for `render` property

* chore: use `.ts` files in select tests for type checks

* fix: type error on shiki() promise

* chore: changeset
2023-06-06 14:48:54 -04:00
Ben Holmes
8034edd9ec
Fix [Object AsyncGenerator] logging for Markdoc components (#7307)
* Revert "Bug 6672 (#7062)"

This reverts commit cf621340b0.

* chore: remove unused test

* chore: changeset
2023-06-06 13:48:10 -04:00
Ben Holmes
2a4bb23b2f
Fix missing styles and scripts on document: {render:null} (#7309)
* fix: propagate assets when using document `render: null`

* fix: reverse spread order

* refactor: use README rec in test

* chore: changeset

* chore: revert unneeded changes
2023-06-06 13:40:04 -04:00
Houston (Bot)
d5a089810f
[ci] release (#7295)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-06 10:32:10 -05:00
Alex Sherwin
4929332c32
#7226 - fixes NodeJS adapter for multiple set-cookie headers (and other header issues) (#7227)
* Utilizes the new standard WebAPI Fetch Headers.getSetCookie() function
to safely handle multiple set-cookie headers when converting from a
WebAPI Response to a NodeJS ServerResponse

Modifies the existing nodeMiddleware logic which first set AstroCookies
on ServerResponse.setHeader(...) and then called
ServerResponse.writeHead(status, Response.headers) which means any that
if the WebAPI Response had any set-cookie headers on it, they would
replace anything from AstroCookies.

The new logic delegates appending AstroCookie values onto the WebAPI
Response Headers object, so that a single unified function safely
converts the WebAPI Response Headers into a NodeJS compatible
OutgoingHttpHeaders object utilizing the new standard
Headers.getSetCookie() function provided by the undici WebAPI polyfills.

Plus extensive test coverage.

* #7226 - changeset for NodeJS adapter set-cookie fix

* fixing all double quotes to single quotes

---------

Co-authored-by: Alex Sherwin <alex.sherwin@acadia.inc>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-06 10:09:16 -05:00
Riki
409c60028a
fix:query not considered in directory redirection (#7243)
* fix:query not considered in directory redirection

* feat: req.url may be empty

* test(node): add redirect + query param tests

* refactor(node): cleanup query param logic

* chore: remove log

* chore: add changeset

---------

Co-authored-by: Riki <947968273@qq.com>
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-06 10:09:00 -05:00
André Alves
144813f730
Fix injected scripts not injected to injected routes (#7262)
* Fix injected scripts not injected to injected routes

* chore: changeset

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-06 10:08:38 -05:00
Bjorn Lu
d72cfa7cad
Fix nested astro-island hydration race condition (#7197) 2023-06-06 17:39:25 +08:00
Nate Moore
39403c32fa
Unflag hybrid output (#7260)
* feat(hybrid): unflag hybrid output

* chore: cleanup rebase errors
2023-06-05 13:19:15 -05:00
Bjorn Lu
414eb19d2f
Remove experimental flag for custom client directives (#7237) 2023-06-06 00:04:35 +08:00
Erika
b5213654b1
feat(tsconfigs): Enable allowJs in base preset (#7274) 2023-06-05 17:31:21 +02:00
Emanuele Stoppa
101f032098
feat: remove experimental flag middleware (#7109)
* fix: middleware for API endpoints

* feat: remove experimental flag middleware

* chore: rebase and update

* chore: check if physical file exists

* chore: restore change

* merge

* merge

* fix: remove options, not needed

* remove experimental from types

* chore: don't have the middleware inside the manifest

* Update how redirects work, slightly

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-06-05 11:25:18 -04:00
Erika
a7e2b37ff7
fix(html): Export HTML components as default export so their type is valid JSX (#7296)
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-06-05 16:40:53 +02:00
Arsh
e3b8c62969
Stabilize inline stylesheets (#7180)
* changeset

* chore(inline stylesheets config): stabilize

* grammar

* not a major change

* Update inlineStylesheets version in the configuration reference

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

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-06-05 10:28:29 -04:00
Matthew Phillips
57f8d14c02
Redirects (#7067)
* Redirects spike

* Allow redirects in static mode

* Support in Netlify as well

* Adding a changeset

* Rename file

* Fix build problem

* Refactor to be more modular

* Fix location ref

* Late test should only run in SSR

* Support redirects in Netlify SSR configuration (#7167)

* Implement support for dynamic routes in redirects (#7173)

* Implement support for dynamic routes in redirects

* Remove the .only

* No need to special-case redirects in static build

* Implement support for redirects config in the Vercel adapter (#7182)

* Implement support for redirects config in the Vercel adapter

* Remove unused condition

* Move to a internal helper package

* Add support for the object notation in redirects

* Use status 308 for non-GET redirects (#7186)

* Implement redirects in Cloudflare (#7198)

* Implement redirects in Cloudflare

* Fix build

* Update tests b/c of new ordering

* Debug issue

* Use posix.join

* Update packages/underscore-redirects/package.json

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Update based on review comments

* Update broken test

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* Test that redirects can come from middleware (#7213)

* Test that redirects can come from middleware

* Allow non-promise returns for middleware

* Implement priority (#7210)

* Refactor

* Fix netlify test ordering

* Fix ordering again

* Redirects: Allow preventing the output of the static HTML file (#7245)

* Do a simple push for priority

* Adding changesets

* Put the implementation behind a flag.

* Self review

* Update .changeset/chatty-actors-stare.md

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>

* 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 docs on dynamic restrictions.

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

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

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

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

* Code review changes

* Document netlify static adapter

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

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

* Slight reword

* Update .changeset/twenty-suns-vanish.md

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

* Add a note about public/_redirects file

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

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

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-05 09:03:20 -04:00
Matthew Phillips
dd1a6b6c94
Fixes cookies being set by middleware (#7294)
* Fixes cookies being set by middleware

* Adding a changeset
2023-06-05 08:28:29 -04:00
Jerry_wu
890a2bc989
remove the white space after the doctype according to the property co… (#7242) 2023-06-05 16:02:04 +08:00
Houston (Bot)
c895981386
[ci] release (#7278)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-02 13:17:55 -05:00
Nate Moore
229affca40
Add 'starlight' as template alias (#7277)
* feat(create-astro): add starlight as template alias

* chore: lint
2023-06-02 12:56:25 -05:00
Houston (Bot)
c64dfdd3d8
[ci] release (#7254)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-02 10:51:28 -04:00
Bjorn Lu
96ae37eb09
Fix Vitest with content collections (#7233) 2023-06-02 21:05:57 +08:00
Ben Holmes
9e7366567e
Content collections: ignored underscore directories in file glob (#7268)
* fix: ignored underscore dirs in glob

* chore: changeset
2023-06-02 07:54:50 -04:00
Benjamin MENANT
6e27f2f6db
fix(astro/core/app/node): support http2 requests (#7215) 2023-06-02 16:51:09 +08:00
Johannes Spohr
fea3069360
Parallel array rendering (#7136) 2023-06-02 16:46:12 +08:00
André Alves
dff0d0dda2
Fix sitemap filter (#7263) 2023-06-02 16:07:44 +08:00
Thiti Yamsung
5156c4f90e
fix: build fail upon have 'process.env' in *.md file. (#7257) 2023-06-01 10:34:02 -04:00
Ben Holmes
339529fc82
Markdoc asset bleed, second try (#7185)
* Revert "revert: markdoc asset bleed (#7178)"

This reverts commit 57e65d247f.

* fix: missing result param on `renderUniqueStylesheet`

* test: bundled styles (fails!)

* fix: use `type: 'external'` for links

* fix: split Astro components from markdoc config

* test: style bleed (it fails...)

* chore: remove unused util

* fix: revert entry change

* Stop traversing the graph when you encounter a propagated asset

* chore: cleanup unused `entry` prop

* refactor: add isPropagatedAssetsMod check

* chore: remove unused import

* chore: changeset

* Normalize path using vite

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

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

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
2023-05-31 19:18:07 -04:00
Nate Moore
e0ca0d8c8a
Revert "feat(hybrid): unflag hybrid output (#7255)" (#7259)
This reverts commit bc5d6ed39f.
2023-05-31 12:06:24 -05:00
Nate Moore
bc5d6ed39f
feat(hybrid): unflag hybrid output (#7255) 2023-05-31 11:47:25 -05:00
Ben Holmes
563293c5d6
Markdoc: strip HTML comments from output (#7224)
* feat: strip HTML comments from output

* chore: changeset
2023-05-31 10:09:49 -04:00
Houston (Bot)
ba865f5d64
[ci] release (#7190)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-30 16:53:55 -04:00
Ben Holmes
f5063d0a01
Content collections - fix .json collection errors (#7246)
* fix: avoid error on collectionType === 'unknown'

* fix: ignore underscores in file globs

* chore: clarify [!_]

* fix: mismatch error not throwing

* fix: bad collectionType var

* test: no error for empty collection

* chore: changeset
2023-05-30 16:27:47 -04:00
Ben Holmes
bef3a75dbc
Markdoc - remove $entry variable (#7244)
* refactor: remove entry prop from `getRenderModule()`

* refactor: remove `$entry` from markdoc

* test: update entry-prop -> variables test

* refactor: unify `getEntryConfigByExt`

* chore: clean up shared content / data get logic

* docs: update `$entry` recommendation

* chore: rename entry-prop -> variables

* chore: changeset

* chore: missed a spot
2023-05-30 16:18:20 -04:00
Happydev
ee2aca80a7
fix: prioritize dynamic prerendered routes over dynamic server routes (#7235)
* test: add unit tests

* fix: prioritize prerendered routes

* chore: fix test

* add comment

* test: try avoiding race condition

* chore: changeset

* try avoiding race conditions attempt #2

* try avoiding race conditions (attempt 3)

* final fix hopefuly

* tet: add more tests

* sort conflicting dynamic routes aplhabetically

* test: fix test
2023-05-30 14:12:16 +00:00
wulinsheng123
cf621340b0
Bug 6672 (#7062)
* fix miss a head when the templaterender has a promise

* fix

* add some test

* test files move to md directory

* fix add

* delect file

---------

Co-authored-by: wuls <linsheng.wu@beantechs.com>
2023-05-30 08:05:48 -04:00