summaryrefslogtreecommitdiff
path: root/test (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-30Migrate to `yarn` monorepo (#157)Gravatar Nate Moore 86-1743/+0
* chore: use monorepo * chore: scaffold astro-scripts * chore: move tests inside packages/astro * chore: refactor tests, add scripts * chore: move parser to own module * chore: move runtime to packages/astro * fix: move parser to own package * test: fix prettier-plugin-astro tests * fix: tests * chore: update package-lock * chore: add changesets * fix: cleanup examples * fix: starter example * chore: update changeset config * chore: update changeset config * chore: setup changeset release workflow * chore: bump lockfiles * chore: prism => astro-prism * fix: tsc --emitDeclarationOnly * chore: final cleanup, switch to yarn * chore: add lerna * chore: update workflows to yarn * chore: update workflows * chore: remove lint workflow * chore: add astro-dev script * chore: add symlinked README
2021-04-30Fix RSS dategen (#156)Gravatar Drew Powers 2-3/+4
2021-04-30chore fix tests (#149)Gravatar duncanhealy 1-2/+2
* chore: fix import of astro/parser -> relative import * chore: fix snapshot for rss
2021-04-28Fix: plain string children bug (#138)Gravatar Nate Moore 8-0/+163
* fix: string children bug * test: add string children test * test: add other child test scenarios
2021-04-27Move the `request` object from import.meta to Astro (#134)Gravatar Matthew Phillips 3-5/+5
* Move the `request` object from import.meta to Astro This moves the `request` object to the Astro "global" (really just a render-level variable). * Document Astro.request
2021-04-26Update defaults directory structure to `src` and `dist` (#132)Gravatar Nate Moore 51-10/+10
* chore: update defaults in docs * chore: update config defaults * test: update tests to config defaults * chore: update gitignore to new defaults * docs: update readme to new defaults * chore: update examples to new defaults * chore: update default exclude in lang server * chore: update tests * test: fix failing tests * chore: update www defaults
2021-04-23Add RSS generation (#123)Gravatar Drew Powers 9-2/+144
2021-04-22Allow multiple JSX children appear in Mustache tag (#125)Gravatar Kevin (Kun) "Kassimo" Qian 5-17/+38
* fix(www): link styles (#100) Co-authored-by: Nate Moore <nate@skypack.dev> * Add `assets/` (#102) * chore: add assets * docs: update readme Co-authored-by: Nate Moore <nate@skypack.dev> * docs: fix readme * docs: fix readme * chore: remove github banner * Allow multiple JSX in mustache * Manually discard package-lock update (due to local use of npm v7) * Tidy up * Revert mode ts-ignore Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-22CLI docs (#121)Gravatar Matthew Phillips 5-0/+73
* Start of cli docs * Document the CLI Also adds support for the `--config` option and `--port` option for the dev server. * Add tests for --config and --port flags * Add port to validateConfig
2021-04-21Add sitemap generation (#120)Gravatar Drew Powers 2-0/+4
* Add sitemap generation * Update README * Fix index handling, sort sitemap * Add --no-sitemap CLI flag (and config option)
2021-04-21Prettier support for `.astro` files (#106)Gravatar Nate Moore 9-1/+172
* docs: fix readme * chore: scaffold prettier plugin * chore(prettier): switch to cjs * test(prettier): scaffold prettier tests * test(prettier): add simple prettier tests * feat(prettier): first pass * refactor: expose parser as CJS export * test(prettier): add long expression * refactor(prettier): use Astro parser + built-in prettier doc for prettier plugin * chore: remove parser from git * chore: add prettier-plugin-astro `build` to workflow * chore: update package-lock * chore: do not build prettier-plugin-astro * fix: update engines * chore: remove NPM restriction * chore: fix workflow paths * chore: update build script * test: fix prettier expr test * chore: fix parser build on windows * refactor: add parser tsconfig, extending base config * chore: relax ban-ts-comment * chore: fix lint issue Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-20Update Snowpack, Add CSS Modules SSR (#116)Gravatar Drew Powers 8-7/+30
* Add CSS Modules SSR * Update docs
2021-04-19[ci] npm run formatGravatar matthewp 2-2/+2
2021-04-19Fix building of dynamic Svelte components (#115)Gravatar Matthew Phillips 4-2/+63
Svelte component resolution wasn't handled correctly during the build. Note that in the future we need to consolidate a "framework" API, so this stuff is not sprinkled throughout the codebase.
2021-04-19[ci] npm run formatGravatar matthewp 1-3/+3
2021-04-19Fix dynamic React components (#111)Gravatar Matthew Phillips 3-0/+48
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-16Pass mode into snowpack runtime (#99)Gravatar Matthew Phillips 1-1/+0
* 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-14Add Windows Support (#93)Gravatar Drew Powers 6-11/+24
* Add Windows to test suite * Try implicit URL
2021-04-13Add Astro.fetchContent API (#91)Gravatar Drew Powers 7-22/+88
2021-04-13fix: bundle client-side code for components used in .md pages (#78)Gravatar Matt Mulder 4-16/+28
2021-04-12chore fix lint reduce errors generated (#83)Gravatar duncanhealy 3-4/+6
* 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-09Use import specifier rather than filename (#71)Gravatar Drew Powers 4-7/+29
2021-04-09[ci] npm run formatGravatar matthewp 1-8/+8
2021-04-09Parse inner JSX as Astro (#67)Gravatar Matthew Phillips 7-5/+92
* 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-06[ci] npm run formatGravatar matthewp 1-1/+1
2021-04-06Compiler cleanup (#64)Gravatar Matthew Phillips 4-0/+51
* 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-05Allow no config (#61)Gravatar Drew Powers 7-34/+2
* Allow no config * Update README
2021-04-05[ci] npm run formatGravatar matthewp 1-1/+1
2021-04-05Improve searching for pages (#60)Gravatar Matthew Phillips 7-24/+94
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-02Fix scoping issues (#58)Gravatar Drew Powers 1-18/+22
2021-04-02Fix body from being scoped (#56)Gravatar Drew Powers 1-0/+1
2021-04-02Get CSS Modules working in Vue (#53)Gravatar Drew Powers 8-10/+59
2021-04-01Fix complex MDX parsing (#50)Gravatar Matthew Phillips 3-0/+24
* Fix complex MDX parsing This allows fully MDX support using the micromark MDX extension. One caveat is that if you do something like use the less than sign, you need to escape it because the parser expects these to be tags otherwise. * Move micromark definition
2021-03-31Implements import.meta.request (#46)Gravatar Matthew Phillips 3-0/+34
This adds `import.meta.request` to pages (not components).
2021-03-31Implement fallback capability (#44)Gravatar Matthew Phillips 5-0/+83
* Implement fallback capability This makes it possible for a dynamic component to render fallback content on the server. The mechanism is a special `static` prop passed to the component. If `static` is true then the component knows it can render static content. Putting aside the word `static`, is this the right approach? I think giving components the flexibility to make the decision themselves *is* the right approach. However in this case we have a special property that is passed in non-explicitly. I think we have to do it this way because if the caller passes in a prop it will get serialized and appear on the client. By making this something we *add* during rendering, it only happens on the server (and only when using `:load`). Assuming this is the right approach, is `static` the right name for this prop? Other candidates: * `server` That's all I have! * Use `import.meta.env.astro` to tell if running in SSR mode. * Run formatter
2021-03-31Extract Astro styles to external stylesheets (#43)Gravatar Drew Powers 2-8/+21
* Extract Astro styles to external stylesheets * Require relative URLs in Markdown layouts
2021-03-30Fix nested parens bug (#39)Gravatar Drew Powers 1-0/+1
2021-03-30Convert CSS Modules to scoped styles (#38)Gravatar Drew Powers 3-1/+56
* Convert CSS Modules to scoped styles * Update README * Move class scoping into HTML walker * Fix SSR styles test * Fix mustache tags * Update PostCSS plugin name * Add JSDoc comment * Update test
2021-03-30[ci] npm run formatGravatar matthewp 6-9/+7
2021-03-30Add support for doctype (#37)Gravatar Matthew Phillips 9-10/+83
* Add support for doctype * Automatically prepend doctype
2021-03-26Add SSR Styles test (#35)Gravatar Drew Powers 7-0/+100
2021-03-26Absorb Snowpack config inside Astro (#32)Gravatar Drew Powers 11-44/+26
* Absorb Snowpack config inside Astro * Add basic README * Format tests * Update esbuild * Format tests
2021-03-24Redesign pages, remove layout nesting (#24)Gravatar Fred K. Schott 5-26/+37
* wip * new svelte-style prop declaration is working * got it working! * revert h changes * format * style lang update
2021-03-24hmx ☞ astro (#22)Gravatar Matthew Phillips 15-16/+16
This changes all hmx files to astro files and updates all code to not reference hmx any more.
2021-03-23add support for frontmatter scriptsGravatar Fred K. Schott 3-6/+6
2021-03-23Allow HMX components in markdown (#19)Gravatar Matthew Phillips 9-4/+105
* Allow HMX components in markdown This adds support for HMX components in markdown. The mechanism for importing is via frontmatter. We could do this differently (setup script maybe?) but since this was the easiest to implement I thought it was a good first-pass option. * Remove node-fetch from snowpack config * Assert that the runtime is created successfully * Add back in the micromark extension for encoding entities * Encode both codeTextData and codeFlowValue * Install snowpack app's deps
2021-03-23Add support for React components. (#18)Gravatar Matthew Phillips 6-10/+81
* Add support for React components. This adds support for react components via a new `extensions` config in astro.config.mjs. In the future we can extend this to do things like look at the import statements, as Snowpack does. * Fix the tests
2021-03-22fix broken testGravatar Fred K. Schott 1-1/+1
2021-03-22fix broken testsGravatar Fred K. Schott 1-1/+1
2021-03-21another pass at head/body handling in pagesGravatar Fred K. Schott 2-7/+10