0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
Commit graph

1041 commits

Author SHA1 Message Date
Matthew Phillips
ea857e675d
Fix visible components (#112)
* Fix visible components

The wrapper component is grabbed with querySelector, so no need for `.item()` call which was throwing.

* Add back in display contents
2021-04-19 15:14:53 -04:00
matthewp
46a6ba6093 [ci] npm run format 2021-04-19 18:41:37 +00:00
Matthew Phillips
eb984559a8
Fix dynamic React components (#111)
Another change in snowpack@3 caused this bug. It's not actually a bug in snowpack. Previously snowpack was keeping its list of installed packages in a global cache. In 3.3 it stopped doing so. We were accidentally relying on that global cache to be able to resolve dynamic components.

This fixes it so that we use the frontend snowpack instance to resolve dynamic components. Doing so means they are available when we try to load them.
2021-04-19 14:41:06 -04:00
Nate Moore
188541260a
chore: remove github banner, add to banner to README (#108)
Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-16 12:51:30 -05:00
Nate Moore
11bebe2d27
Add assets (#107)
* fix(www): link styles (#100)

Co-authored-by: Nate Moore <nate@skypack.dev>

* chore: add assets

* docs: update readme

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-16 12:48:59 -05:00
matthewp
e43d98d6f3 [ci] npm run format 2021-04-16 17:15:59 +00:00
Matthew Phillips
58c499dc85
Pass mode into snowpack runtime (#99)
* Pass the `mode` through to snowpack

This allows the production packages to be prepared.

* Use snowpack 3.3.1

* Update path to prism loadComponents external ref

* Upgrade to snowpack 3.3.2
2021-04-16 13:15:27 -04:00
natemoo-re
2a7aa765b4 [ci] npm run format 2021-04-15 15:56:27 +00:00
Nate Moore
22ca9e0aac
Support children inside of components (#72)
* chore(examples): add kitchen-sink

* feat: support children in rendered components

* feat: add support for rendering children in Svelte

* fix: cleanup p/react fragment children

* chore: add @ts-nocheck to svelte files

* chore: update lockfiles

* fix: types

* feat: memoize frontend/renderer/utils

* fix: disable eslint for compiled SvelteWrapper

* fix: add missing dep

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-15 10:55:50 -05:00
Nate Moore
ea33d7b2ab style(www): small style tweaks 2021-04-14 22:11:04 -05:00
Drew Powers
f28cebcf61
Add collections to build (#94) 2021-04-14 17:24:34 -06:00
Nate Moore
077fceabcb fix: update og image 2021-04-14 18:09:30 -05:00
Nate Moore
8472b374b3
New landing page (#95)
* feat: new www

* fix: add svg favicon

* fix: small tweaks

* fix: Drew's nitpicks

* fix: sizing, tagline

* copy: add "astronauts" :)

* fix: astro logo color

* fix: overflow

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-14 18:01:51 -05:00
Drew Powers
034674c88c
Add Windows Support (#93)
* Add Windows to test suite

* Try implicit URL
2021-04-14 13:21:25 -06:00
Drew Powers
ec75312a15
Improve Tailwind docs & Tailwind support (#92) 2021-04-14 10:36:00 -06:00
Drew Powers
3d0d53486c
Add Astro.fetchContent API (#91) 2021-04-13 18:08:32 -06:00
Drew Powers
4a71de9e3d
Add CODEOWNERS (#88) 2021-04-13 12:02:46 -06:00
Matt Mulder
ac22d94e11
fix: bundle client-side code for components used in .md pages (#78) 2021-04-13 13:04:01 -04:00
duncanhealy
b588581396
set node version in nvmrc & engines to lts (#87)
* node lts version for nvmrc v14.16.1

* node lts version for nvmrc v14.16.1

* engine version set to to 14.x.x and npm >=6 < 7
2021-04-13 13:03:26 -04:00
Jonathan Neal
740a6b73e0
add content-type to astro html (#85) 2021-04-13 13:01:42 -04:00
Drew Powers
3639190b4e
Renaming to import.meta.fetchContent (#70)
* Change to import.meta.glob()

Change of plans—maintain parity with Snowpack and Vite because our Collections API will use a different interface

* Get basic pagination working

* Get params working

* Rename to import.meta.fetchContent

* Upgrade to fdir
2021-04-12 17:21:29 -06:00
duncanhealy
687ff5bacd
chore fix lint reduce errors generated (#83)
* add dep domhandler imported in in src/build/static

* lint and jsDoc error

* move domhandler to devDep

* chore: add package lock

* escape string jsDoc

* chore: add astro dep in until prism import is refactored

* chore: add snowpack example package lock
2021-04-12 16:20:58 +01:00
Matthew Phillips
cffde0192b
Add back in astro as a dependency of the snowpack example (#81)
Removing the dependency breaks the site as using Markdown creates an import to a builtin Astro component. So we need astro as a dep. Not sure why it was changed anyways.
2021-04-12 08:26:59 -04:00
Fred K. Schott
8e4b201c1b
Update README.md 2021-04-11 22:31:50 -07:00
Fred K. Schott
4107a53757
Update README.md 2021-04-11 08:45:57 -07:00
Fred K. Schott
faae08712e 0.0.5 2021-04-10 22:02:34 -07:00
Fred K. Schott
a17bafbb5a update snowpack plugin 2021-04-10 22:02:19 -07:00
Fred K. Schott
1355d570f5 add astro bin to files array 2021-04-10 21:59:59 -07:00
Fred K. Schott
c923f1793d 0.0.4 2021-04-10 21:58:59 -07:00
Fred K. Schott
a66fd3272b add publish script 2021-04-10 21:58:57 -07:00
Fred K. Schott
887ee982d8 fix plugins relative issue 2021-04-10 21:57:40 -07:00
Fred K. Schott
24f50220e1 update package.json 2021-04-10 13:17:31 -07:00
Fred K. Schott
4e7ae2075d small size change 2021-04-10 13:02:07 -07:00
Fred K. Schott
d3f8efbf6e cleanup landing page, and small fix 2021-04-10 13:00:50 -07:00
Fred K. Schott
1712f9edb6 add counter component 2021-04-10 12:35:25 -07:00
Drew Powers
e3ca67d6dc
Use import specifier rather than filename (#71) 2021-04-09 14:23:25 -06:00
matthewp
62924b3162 [ci] npm run format 2021-04-09 18:09:44 +00:00
Matthew Phillips
ad9c3b1d8d
Parse inner JSX as Astro (#67)
* Parse inner JSX as Astro

This completes the compiler changes, updating the parser so that it parses inner "JSX" as Astro. It does this by finding the start and end of HTML tags and feeds that back into the parser.

The result is a structure like this:

```
{
  type: 'MustacheTag',
  expression: [
    {
      type: 'Expression',
      codeStart: 'colors.map(color => (',
      codeEnd: '}}'
      children: [ {
        type: 'Fragment',
        children: [ {
          type: 'Element',
          name: 'div'
        } ]
      } ]
    }
  ]
}
```

There is a new Node type, `Expression`.  Note that `MustacheTag` remains in the tree, all it contains is an Expression though. I could spend some time trying to remove it, there's just a few places that expect it to exist.

* Update import to the transform

* Transform prism components into expressions
2021-04-09 14:09:13 -04:00
matthewp
084845f79d [ci] npm run format 2021-04-09 17:04:00 +00:00
Matthew Phillips
185a267133
Improve renderer types (#69)
* Improve renderer types

Looking at the render code I noticed that the Component rendering is not typed. This adds that, might help prevent a bug in the future.

* Create the supported renderer type
2021-04-09 13:03:27 -04:00
matthewp
4ccf4196e3 [ci] npm run format 2021-04-08 19:17:34 +00:00
Matthew Phillips
72ae661e9e
Add support for syntax highlighting of code blocks (#65)
* Add support for syntax highlighting of code blocks

* Escape usage of backtick strings

* Add workspace root for snowpack

* Use prismjs/components as an external module
2021-04-08 15:17:00 -04:00
Drew Powers
2b346d7a4c
Blog Support 1/3: Data fetching (#62)
* Add example blog

* Add author data

* Improve navigation

* Style nav

* Add friendly error message

* Throw error if import glob used for non-Markdown files

* Use import.meta.collection() API instead

* README fixes
2021-04-06 15:54:55 -06:00
matthewp
3adb9ea87c [ci] npm run format 2021-04-06 20:15:14 +00:00
Matthew Phillips
72d9ece6db
Compiler cleanup (#64)
* Compiler cleanup

This is general compiler cleanup, especially around the codegen part. Goals here were too:

1. Make it possible to compile HTML recursively (needed for future astro-in-expressions work) by moving that work into its own function.
1. Get rid of collectionItems and have compiling the HTML return just a source string.

Also not planned, this change gets rid of the different between components and pages. All Astro components compile to the same JavaScript.

* Remove unused node types
2021-04-06 16:14:42 -04:00
Matthew Phillips
7240f0d677
Create a astro/components/ folder (#63)
This adds astro/components/ and moves the Prism.astro component into there. So to use in a project you can do:

```html
---
import Prism from 'astro/components/Prism.astro';
---

<Prism lang="html" code={`<html> ... </html>`}
```
2021-04-06 15:27:42 -04:00
Drew Powers
1acd5ee310
Allow no config (#61)
* Allow no config

* Update README
2021-04-05 15:56:46 -06:00
matthewp
71e5de76f1 [ci] npm run format 2021-04-05 18:18:39 +00:00
Matthew Phillips
c9bc6ffef7
Improve searching for pages (#60)
This improves the algorithm for searching for pages. It now works like:

1. If pathname ends with /
  1. Look for PATHNAME/index.astro
  1. Look for PATHNAME/index.md
1. else
  1. Look for PATHNAME.astro
  1. Look for PATHNAME.md
1. Look for PATHNAME/index.astro
  1. 301
1. Look for PATHNAME/index.md
  1. 301
1. 404
2021-04-05 14:18:09 -04:00
Drew Powers
d9733e8d42
Add type declarations (#59) 2021-04-02 21:01:57 -06:00