Commit graph

1677 commits

Author SHA1 Message Date
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
hippotastic
5c73f614e8
Fix remarkMdxish performance issue on huge sites (#3572) 2022-06-10 17:32:23 -05:00
natemoo-re
43dda86ce2 [ci] format 2022-06-10 18:20:21 +00:00
Nate Moore
3ec41f284c
Improve YAML error handling (#3557)
* chore: improve YAML errors

* chore: add changeset
2022-06-10 13:18:29 -05:00
Tony Sullivan
99ee40ced0
Disabling unreliable E2E test for further investigation (#3560)
* fixing reliability issue in component HMR tests

* fix: test change snuck into the last commit

* TEMP: logging to track down ubuntu CI failure

* disabling svelte test for now

* reverting unrelated .d.ts change
2022-06-10 13:18:11 -05:00
Félix Sanz
6e8391365a
Changed astro.config.js text to a link to the supported config file types (#3565)
Changed astro.config.js text to a link to the supported config file types, since above it appears astro.config.mjs and mixing extensions could lead to confusion (plus in that page linked we can see the valid extensions)
2022-06-10 13:17:52 -05:00
Oleksii Tymoshenko
098031294f
unused dependency 'sitemap', 'filter' option should return boolean (#3563)
* refactor: @astrojs/sitemap does't use 'sitemap' pkg

* refactor: 'filter' option should return boolean instead of string

* fix: forgotten `pnpm install`

* chore: add changeset

Co-authored-by: Nate Moore <nate@skypack.dev>
2022-06-10 13:16:08 -05:00
matthewp
72587eccc5 [ci] format 2022-06-10 16:40:13 +00:00
Matthew Phillips
614769a39b
Preoptimize renderers and hydration directives (#3568)
* Preoptimize renderers and hydration directives

* Adds a changeset

* Upgrade to Vite 2.9.12
2022-06-10 12:38:19 -04:00
github-actions[bot]
d02578fd4c
[ci] release (#3549)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-10 15:03:52 +00:00
natemoo-re
4eb39d57b9 [ci] format 2022-06-10 03:33:13 +00:00
Nate Moore
7f5e71982d
chore: update types (#3558) 2022-06-09 22:31:48 -05:00
hippotastic
76fb01cff1
Fix autolinking of URLs inside links in Markdown (#3564) 2022-06-09 22:31:36 -05:00
natemoo-re
c15e7ebc5e [ci] format 2022-06-08 17:43:10 +00:00
hippotastic
c549f161ca
Allow AlpineJS syntax extensions in Markdown (#3554)
* Allow AlpineJS syntax extensions in Markdown

* Remove unwanted MDX ESM import/export support
2022-06-08 12:41:36 -05:00
natemoo-re
073bab5ec1 [ci] format 2022-06-08 15:09:17 +00:00
Caio Ferrarezi
c601ce59b5
Prevent sitemap URLs without pathname (#3553)
* fix(@astrojs/sitemap): handle base/pathname correctly

* chore: add changeset
2022-06-08 10:07:12 -05:00
tony-sull
47d15870ff [ci] format 2022-06-07 21:22:13 +00:00
Tony Sullivan
3eb96a7ab7
Fix: Astro.site should default to localhost if not provided in config (#3552)
* Astro.site should be defaulted to localhost

* test: verify Astro.site default value

* chore: add changeset

* test: matching a URL regex to ignore specific port numbers
2022-06-07 21:20:20 +00:00
bholmesdev
c5db640dd2 [ci] format 2022-06-07 21:14:44 +00:00
Ben Holmes
a83d581714
Fix: --host flag logs when no network IPs are found (#3547)
* feat: add fallback log if no network interfaces found

* fix: extra newline on missing network log

* chore: changeset
2022-06-07 17:12:35 -04:00
Tony Sullivan
7816403306
Fix: bubbling up a more useful error message for unresolve imports in Astro components (#3540)
* vite-astro-plugin should ignore unresolved relative imports

* test: add error test for unresolved imports

* chore: add changeset

* moving the test to it's own describe

* chore: cleaning up the test's dev server

* TEMP: skipping the old test again to see if that's breaking CI

* test: verifying the dev server recovers

* TEMP: is it the new test breaking ubuntu CI?

* testing whether the errors suite only handles one test case in ubuntu

* disabling the Errors suite on linux for now to avoid reliability issues
2022-06-07 17:53:15 +00:00
github-actions[bot]
ec89def67d
[ci] release (#3534)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-07 12:45:50 -04:00
matthewp
0a978e22fd [ci] format 2022-06-07 15:43:33 +00:00
Matthew Phillips
f3ab822e32
Allow dynamic imports when using Netlify Edge Functions (#3535)
* Allow dynamic imports when using Netlify Edge Functions

* Update deno test script and changeset
2022-06-07 11:41:32 -04:00
matthewp
e8b2d829b4 [ci] format 2022-06-06 22:28:04 +00:00
Matthew Phillips
51c60de76c
Fix importing CSS packages in frontmatter (#3537)
* Fix importing CSS packages in frontmatter

* Formatting

* Only update if the source code contains the import

* Consolidate the two plugins

* we do need a pre and a post

* Adds a changeset
2022-06-06 18:26:15 -04:00
matthewp
88974f8b40 [ci] format 2022-06-06 18:48:00 +00:00
Matthew Phillips
d7688f05c2
Prevent minifying server JS (#3533)
* Prevent minifying server JS

* Add a changeset
2022-06-06 14:45:58 -04:00
tony-sull
2aa43549e0 [ci] format 2022-06-06 18:41:58 +00:00
Nate Moore
a87ce4412c
Improve HMR handling for styles, persisted islands (#3492)
* feat: improve HMR handling for styles, persisted islands

* Also using data-persist to keep injected <style>'s during HMR

* Updating E2E tests to validate that .astro HMR doesn't blow away component styles

* chore: add changeset

* copy/paste error when cleaning up tests

* big change - using inline <style> blocks instead of <link>s in dev

* Updating tests that were expecting <link> stylesheets in dev

* updating all E2E tests to use workspace versions for astro deps

* TEMP: adding debug logging to see why the Ubuntu test only fails in CI

* fix: Svelte styles are automatically handled by Vite, we can skip them in dev

* fix: svelte is more interesting, we need Astro to inject styles only until hydration

* avoiding extra HMTL noise by only including the data-astro-injected URL for svelte components

* TEMP: ubuntu CI doesn't like the svelte HMR test...

* disabling the svelte component test on ubuntu for now

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-06-06 18:39:48 +00:00
FredKSchott
f0f6a3332f [ci] format 2022-06-06 16:49:53 +00:00
Fred K. Schott
5b06398b7b
format: automatically organize imports and removed unused (#3499)
* add import formatting

* chore: update lockfile

Co-authored-by: Nate Moore <nate@skypack.dev>
2022-06-06 09:47:28 -07:00
matthewp
8bb28b48ee [ci] format 2022-06-06 16:03:17 +00:00
Matthew Phillips
c22a07db13
Fix use of dynamic imports / Astro.glob with Deno Deploy (#3532)
* Fix use of dynamic imports / Astro.glob with Deno Deploy

* Adds a changeset

* Mark the markdown package as external
2022-06-06 12:02:13 -04:00
github-actions[bot]
9029c43549
[ci] release (#3512)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-06 09:40:09 -04:00
bholmesdev
ff6c9490a0 [ci] format 2022-06-06 13:28:30 +00:00
Ben Holmes
85b905495d
Fix: refusing to accept isSelfAccepting for JSX (#3521)
* fix: generate client directive scripts from metadata

* chore: changeset

* feat: add all runtime client scripts to optimized deps

* fix: remove hmr.js from optimized deps (monorepo-specific issue)

* Revert "fix: generate client directive scripts from metadata"

This reverts commit 56530a86ef.

* refactor: move optimizedeps to dev only

* docs: add comment on why optimizdeps

* nit: indentation
2022-06-06 09:27:35 -04:00
matthewp
2dbf2234ae [ci] format 2022-06-03 17:01:54 +00:00
Fred K. Schott
25fa0f527d
[ci] update lockfile (#3515)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-03 13:00:47 -04:00
Matthew Phillips
df7c43df63
Allow importing .ts files with .js extension (#3518)
* Allow importing .ts files with .js extension

* Adds a changeset

* Make it also work in .md files
2022-06-03 13:00:28 -04:00
natemoo-re
d9a67d36dc [ci] format 2022-06-03 13:54:25 +00:00
Maurer Krisztian
93d0225ade
refactor(config): refactor duplicated default config values (#3504)
* refactor(config): refactor duplicated default configs

* refactor(config): constant CONSTANT_CASE, remove export
2022-06-03 08:53:38 -05:00
natemoo-re
ae14595407 [ci] format 2022-06-03 13:39:43 +00:00
hippotastic
6c955ca643
Fix Markdown errors missing source filename (#3514) 2022-06-03 08:38:57 -05:00
hippotastic
3057801591
Fix: Allow self-closing tags in Markdown (#3516) 2022-06-03 08:38:45 -05:00
nokazn
939fe15925
Fix cases for JSX-like expressions in code blocks of headings (#3502)
* chore: fix typo in remark tests

* test: add test cases for markdown expressions in header

* fix: avoid evaluating JSX-like expressions inside inline code in heading

* fix: generate slug for id including values in backtick blocks
2022-06-03 08:26:39 -04:00
Nate Moore
2fedb97489
Patch Lit server shim to fix sass compatability (#3511)
* fix(#2623, #3508): patch lit server shim to allow sass compat

* chore: add changeset
2022-06-02 14:45:11 -05:00
github-actions[bot]
a74cf98002
[ci] release (#3509)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-02 15:31:44 -04:00
Fred K. Schott
88cd7525be
[ci] update lockfile (#3501)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-02 15:30:46 -04:00
Matthew Phillips
4a23b5aaed
provide import.meta.env.SITE when there are private envs (#3498)
* provide import.meta.env.SITE when there are private envs

* Adds a changeset

* Handle destructing of import.meta.env.SITE
2022-06-02 13:21:10 -05:00
natemoo-re
c6e7355468 [ci] format 2022-06-02 18:04:50 +00:00
Nate Moore
cf2fb3004e
Pass optimizeDeps.include to silence build warning (#3507)
* fix(build): pass `optimizeDeps.include` to silence build warning

* chore: add changeset
2022-06-02 13:03:59 -05:00
Nate Moore
d41540cc77
Fix <link> tag not being self-closing (#3506)
* fix(#392): ensure link tags are rendered as void elements

* test: ensure html does not include a `</link>` end tag

* chore: add changeset
2022-06-02 13:03:37 -05:00
William Tetlow
207f58d171
fix: alias astro to @types/astro (#3503)
* fix: alias astro to @types/astro

* fix: handle resolve.alias being array

* chore: add integrations patch to changeset

* chore: remove empty file
2022-06-02 12:54:35 -05:00
github-actions[bot]
67ad33debf
[ci] release (#3488)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-02 13:42:18 -04:00
bholmesdev
b6b045c3f1 [ci] format 2022-06-02 17:35:51 +00:00
Ben Holmes
2b35650b5d
Fix: newline characters in Solid (#3505)
* fix: remove source map consumption from babel transform

* refactor: move inputSourceMap to integration option

* tests: add newline ex to test build and dev

* chore: change back to babel.transformAsync

* chore: changeset
2022-06-02 13:35:03 -04:00
natemoo-re
6b54eb460f [ci] format 2022-06-01 22:33:18 +00:00
Ben Holmes
9c2ba13748
Add console warning on fs.strict=false (#3464)
* chore: add warning on fs.strict=false

* chore: add changeset

Co-authored-by: Nate Moore <nate@skypack.dev>
2022-06-01 17:32:29 -05:00
Dan Jutan
5c32c7a4c3
Integration Docs: Tailwind (#3429)
* test commi

* add video

* test video include

* actually close the tag

* try directly pasting the video link

* remove the quote I forgot about

* figured out how to properly upload a video to github

* remove unneeded media directory

* why tailwind

* Installation and Usage

* Troubleshooting

* Add examples section

* Update packages/integrations/tailwind/README.md

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

* Update packages/integrations/tailwind/README.md

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

* Update packages/integrations/tailwind/README.md

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

* Update packages/integrations/tailwind/README.md

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

* TOC + layout tweaks

* separated, and example re: warning to not use Tailwind with other styling method

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-06-01 17:30:36 -05:00
Matthew Phillips
d588bc4a9c
Update rollup to prevent empty slot bug (#3496)
* Update rollup to prevent empty slot bug

* Adds a changeset

* Updated lockfile

* provide import.meta.env.SITE when there are private envs
2022-06-01 12:21:32 -04:00
Fred K. Schott
cfb85ee10e
[ci] update lockfile (#3495)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-01 10:39:32 -05:00
tony-sull
74a034c2cd [ci] format 2022-05-31 18:13:53 +00:00
Tony Sullivan
10b2589093
Fixing HMR for hoisted scripts (#3427)
* WIP: the leading /@fs broke script HMR

* Revert "WIP: the leading /@fs broke script HMR"

This reverts commit 84fce366268033261369aed48f909e59e78bf3e4.

* Metadata needs to strip off /@fs from hoisted script URLs

* adding a test for hoisted script HMR support

* removing 2 second timeout on navigation, allow default 30 seconds

* simplifying the hoisted script test sync

* TEMP: bubbling up console logs to track down windows failure

* removing temp logging

* disabling the test on windows for now

* chore: adding changeset
2022-05-31 18:13:05 +00:00
github-actions[bot]
b2f955ec1b
[ci] release (#3485)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-05-31 13:40:19 -04:00
natemoo-re
9a31e6f1d5 [ci] format 2022-05-31 17:17:36 +00:00
hippotastic
119ecf8d46
Fix components in markdown regressions (#3486)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-05-31 12:16:43 -05:00
natemoo-re
e02c72f445 [ci] format 2022-05-31 16:47:13 +00:00
Fred K. Schott
c9d8b10a85
[ci] update lockfile (#3448)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-05-31 11:46:13 -05:00
Nate Moore
e9a77d8619
Improve nested and client:only hydration (#3455)
* wip: fix nested islands

* fix: improve hydration for dynamic content

* chore: fix bundle-size script for new files

* chore: allow-list client:* directive files

* fix(#3362): fix client:only behavior for React, Vue, Solid

* test: add client-only e2e test

* chore: update lockfile

* test: fix e2e tests

* test: add framework nesting e2e tests

* Update packages/astro/src/runtime/client/events.ts

Co-authored-by: Matthew Phillips <matthew@skypack.dev>

* chore: add changeset

* fix(preact): ignore hydrate roots

* chore: remove `ssr` check in integrations

* Revert "chore: remove `ssr` check in integrations"

This reverts commit ba27eaae55.

* chore: add changeset

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-05-31 11:29:36 -05:00
bholmesdev
40614597cc [ci] format 2022-05-31 16:09:23 +00:00
Ben Holmes
d145b8689c
Chore: remove rss helper from getStaticPaths (#3462)
* chore: remove rss() with helpful error message

* docs: add context on "getStaticPaths" removal

* chore: changeset

* deps: remove fast-xml-parser from core!

* chore: update lockfile
2022-05-31 12:08:09 -04:00
Matěj Volf
b795a085f0
Load environment variables in deno SSR (#3483)
* Properly shim env in Deno

* Add test for loading env vars in Deno

* Add changeset
2022-05-31 11:41:33 -04:00
matthewp
1aeb1d0a00 [ci] format 2022-05-31 15:41:24 +00:00
Matthew Phillips
efccebb964
Set the correct content-type for CSS HMR (#3459)
* Set the correct content-type for CSS HMR

* Adds a changeset
2022-05-31 11:40:34 -04:00
Matthew Phillips
55820fa784
Lit polyfill - wait to polyfill on DOMContentLoaded (#3484)
* Lit polyfill - wait to polyfill on DOMContentLoaded

* Adds changeset
2022-05-31 11:40:26 -04:00
matthewp
5e66ffb3a0 [ci] format 2022-05-31 14:12:38 +00:00
Rafid Muhymin Wafi
0ead51ae9c
fixed APIRoute type (#3365)
* fixed APIRoute type

* fixed EndpointHandler type
2022-05-31 10:10:57 -04:00
github-actions[bot]
16345032aa
[ci] release (#3479)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-05-30 13:06:41 -04:00
bholmesdev
d195f583e3 [ci] format 2022-05-30 16:19:39 +00:00
hippotastic
75fa58f13f
Fix using Vite env var names in Markdown (#3412) (#3471) 2022-05-30 12:18:43 -04:00