astro 1.0.0-beta.7 → 1.0.0-beta.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/LICENSE +61 -0
  2. package/README.md +28 -88
  3. package/astro-jsx.d.ts +853 -474
  4. package/astro.js +1 -1
  5. package/client.d.ts +207 -0
  6. package/components/Code.astro +1 -1
  7. package/components/Markdown.astro +7 -0
  8. package/components/Shiki.js +24 -0
  9. package/components/{index.js → index.ts} +0 -0
  10. package/dist/cli/check.js +2 -2
  11. package/dist/cli/index.js +81 -75
  12. package/dist/cli/telemetry.js +38 -0
  13. package/dist/core/add/babel.js +2 -2
  14. package/dist/core/add/index.js +208 -84
  15. package/dist/core/app/common.js +8 -23
  16. package/dist/core/app/index.js +37 -27
  17. package/dist/core/app/node.js +1 -1
  18. package/dist/core/build/add-rollup-input.js +14 -27
  19. package/dist/core/build/generate.js +26 -23
  20. package/dist/core/build/graph.js +27 -0
  21. package/dist/core/build/index.js +12 -29
  22. package/dist/core/build/internal.js +35 -4
  23. package/dist/core/build/page-data.js +23 -54
  24. package/dist/core/build/static-build.js +62 -67
  25. package/dist/{@types/serialize-javascript.d.js → core/build/types.js} +0 -0
  26. package/dist/core/build/vite-plugin-analyzer.js +93 -0
  27. package/dist/core/build/vite-plugin-hoisted-scripts.js +31 -7
  28. package/dist/core/build/vite-plugin-pages.js +7 -10
  29. package/dist/core/build/vite-plugin-ssr.js +52 -20
  30. package/dist/core/config.js +144 -65
  31. package/dist/core/create-vite.js +46 -14
  32. package/dist/core/dev/index.js +22 -5
  33. package/dist/core/endpoint/dev/index.js +3 -21
  34. package/dist/core/endpoint/index.js +1 -20
  35. package/dist/core/errors.js +38 -0
  36. package/dist/core/logger/console.js +2 -2
  37. package/dist/core/logger/core.js +2 -13
  38. package/dist/core/logger/node.js +4 -4
  39. package/dist/core/messages.js +94 -45
  40. package/dist/core/path.js +14 -10
  41. package/dist/core/preview/index.js +3 -3
  42. package/dist/core/render/core.js +15 -42
  43. package/dist/core/render/dev/css.js +22 -6
  44. package/dist/core/render/dev/index.js +42 -98
  45. package/dist/core/render/dev/resolve.js +11 -0
  46. package/dist/core/render/paginate.js +11 -27
  47. package/dist/core/render/result.js +45 -52
  48. package/dist/core/render/route-cache.js +5 -11
  49. package/dist/core/render/ssr-element.js +18 -1
  50. package/dist/core/render/util.js +39 -2
  51. package/dist/core/request.js +3 -21
  52. package/dist/core/routing/index.js +1 -1
  53. package/dist/core/routing/manifest/create.js +72 -27
  54. package/dist/core/routing/manifest/generator.js +15 -0
  55. package/dist/core/routing/manifest/serialization.js +16 -16
  56. package/dist/core/routing/params.js +12 -1
  57. package/dist/core/routing/validation.js +7 -0
  58. package/dist/core/util.js +32 -2
  59. package/dist/events/error.js +42 -0
  60. package/dist/events/index.js +21 -0
  61. package/dist/events/session.js +66 -0
  62. package/dist/integrations/index.js +55 -29
  63. package/dist/jsx/babel.js +122 -0
  64. package/dist/jsx/renderer.js +21 -0
  65. package/dist/jsx/server.js +40 -0
  66. package/dist/jsx-runtime/index.js +84 -0
  67. package/dist/runtime/client/events.js +21 -0
  68. package/dist/runtime/client/hmr.js +94 -6
  69. package/dist/{@types/shorthash.d.js → runtime/client/hydration-directives.d.js} +0 -0
  70. package/dist/runtime/client/idle.js +3 -23
  71. package/dist/runtime/client/idle.prebuilt.js +4 -0
  72. package/dist/runtime/client/load.js +5 -23
  73. package/dist/runtime/client/load.prebuilt.js +4 -0
  74. package/dist/runtime/client/media.js +3 -23
  75. package/dist/runtime/client/media.prebuilt.js +4 -0
  76. package/dist/runtime/client/only.js +5 -23
  77. package/dist/runtime/client/only.prebuilt.js +4 -0
  78. package/dist/runtime/client/visible.js +7 -29
  79. package/dist/runtime/client/visible.prebuilt.js +4 -0
  80. package/dist/runtime/server/astro-island.js +83 -0
  81. package/dist/runtime/server/astro-island.prebuilt.js +4 -0
  82. package/dist/runtime/server/hydration.js +29 -22
  83. package/dist/runtime/server/index.js +300 -127
  84. package/dist/runtime/server/jsx.js +86 -0
  85. package/dist/runtime/server/metadata.js +9 -38
  86. package/dist/runtime/server/response.js +80 -0
  87. package/dist/runtime/server/scripts.js +55 -0
  88. package/dist/runtime/server/serialize.js +57 -0
  89. package/dist/runtime/server/shorthash.js +62 -0
  90. package/dist/runtime/server/util.js +1 -5
  91. package/dist/template/5xx.js +2 -2
  92. package/dist/types/@types/astro.d.ts +168 -120
  93. package/dist/types/cli/index.d.ts +1 -1
  94. package/dist/types/cli/telemetry.d.ts +7 -0
  95. package/dist/types/core/add/babel.d.ts +1 -1
  96. package/dist/types/core/add/index.d.ts +4 -1
  97. package/dist/types/core/app/common.d.ts +1 -1
  98. package/dist/types/core/app/index.d.ts +3 -1
  99. package/dist/types/core/app/node.d.ts +1 -1
  100. package/dist/types/core/app/types.d.ts +14 -6
  101. package/dist/types/core/build/graph.d.ts +7 -0
  102. package/dist/types/core/build/index.d.ts +3 -1
  103. package/dist/types/core/build/internal.d.ts +22 -10
  104. package/dist/types/core/build/page-data.d.ts +2 -2
  105. package/dist/types/core/build/types.d.ts +34 -0
  106. package/dist/types/core/build/vite-plugin-analyzer.d.ts +4 -0
  107. package/dist/types/core/build/vite-plugin-hoisted-scripts.d.ts +1 -1
  108. package/dist/types/core/build/vite-plugin-pages.d.ts +0 -2
  109. package/dist/types/core/build/vite-plugin-ssr.d.ts +2 -1
  110. package/dist/types/core/config.d.ts +85 -44
  111. package/dist/types/core/dev/index.d.ts +5 -1
  112. package/dist/types/core/errors.d.ts +8 -0
  113. package/dist/types/core/messages.d.ts +11 -8
  114. package/dist/types/core/path.d.ts +4 -3
  115. package/dist/types/core/preview/index.d.ts +2 -0
  116. package/dist/types/core/render/core.d.ts +6 -10
  117. package/dist/types/core/render/dev/css.d.ts +5 -1
  118. package/dist/types/core/render/dev/index.d.ts +6 -13
  119. package/dist/types/core/render/dev/resolve.d.ts +1 -0
  120. package/dist/types/core/render/result.d.ts +6 -3
  121. package/dist/types/core/render/route-cache.d.ts +1 -2
  122. package/dist/types/core/render/ssr-element.d.ts +8 -0
  123. package/dist/types/core/render/util.d.ts +4 -1
  124. package/dist/types/core/routing/index.d.ts +1 -1
  125. package/dist/types/core/routing/manifest/generator.d.ts +2 -0
  126. package/dist/types/core/routing/manifest/serialization.d.ts +2 -2
  127. package/dist/types/core/routing/params.d.ts +6 -0
  128. package/dist/types/core/routing/validation.d.ts +2 -0
  129. package/dist/types/core/util.d.ts +2 -0
  130. package/dist/types/events/error.d.ts +30 -0
  131. package/dist/types/events/index.d.ts +4 -0
  132. package/dist/types/events/session.d.ts +26 -0
  133. package/dist/types/integrations/index.d.ts +8 -1
  134. package/dist/types/jsx/babel.d.ts +2 -0
  135. package/dist/types/jsx/renderer.d.ts +9 -0
  136. package/dist/types/jsx/server.d.ts +13 -0
  137. package/dist/types/jsx-runtime/index.d.ts +11 -0
  138. package/dist/types/runtime/client/events.d.ts +1 -0
  139. package/dist/types/runtime/client/idle.d.ts +0 -6
  140. package/dist/types/runtime/client/idle.prebuilt.d.ts +7 -0
  141. package/dist/types/runtime/client/load.d.ts +0 -5
  142. package/dist/types/runtime/client/load.prebuilt.d.ts +7 -0
  143. package/dist/types/runtime/client/media.d.ts +0 -5
  144. package/dist/types/runtime/client/media.prebuilt.d.ts +7 -0
  145. package/dist/types/runtime/client/only.d.ts +0 -5
  146. package/dist/types/runtime/client/only.prebuilt.d.ts +7 -0
  147. package/dist/types/runtime/client/visible.d.ts +0 -7
  148. package/dist/types/runtime/client/visible.prebuilt.d.ts +7 -0
  149. package/dist/types/runtime/server/astro-island.d.ts +4 -0
  150. package/dist/types/runtime/server/astro-island.prebuilt.d.ts +7 -0
  151. package/dist/types/runtime/server/hydration.d.ts +2 -3
  152. package/dist/types/runtime/server/index.d.ts +15 -14
  153. package/dist/types/runtime/server/jsx.d.ts +1 -0
  154. package/dist/types/runtime/server/metadata.d.ts +0 -10
  155. package/dist/types/runtime/server/response.d.ts +3 -0
  156. package/dist/types/runtime/server/scripts.d.ts +6 -0
  157. package/dist/types/runtime/server/serialize.d.ts +1 -0
  158. package/dist/types/runtime/server/shorthash.d.ts +31 -0
  159. package/dist/types/runtime/server/util.d.ts +0 -6
  160. package/dist/types/vite-plugin-astro/compile.d.ts +14 -4
  161. package/dist/types/vite-plugin-astro/hmr.d.ts +2 -2
  162. package/dist/types/vite-plugin-astro/query.d.ts +3 -2
  163. package/dist/types/vite-plugin-astro/styles.d.ts +3 -1
  164. package/dist/types/vite-plugin-astro/types.d.ts +8 -0
  165. package/dist/types/vite-plugin-build-css/index.d.ts +2 -5
  166. package/dist/types/vite-plugin-build-css/resolve.d.ts +2 -2
  167. package/dist/types/vite-plugin-utils/index.d.ts +5 -0
  168. package/dist/vite-plugin-astro/compile.js +50 -14
  169. package/dist/vite-plugin-astro/hmr.js +20 -15
  170. package/dist/vite-plugin-astro/index.js +136 -52
  171. package/dist/vite-plugin-astro/styles.js +4 -3
  172. package/dist/{core/build/types.d.js → vite-plugin-astro/types.js} +0 -0
  173. package/dist/vite-plugin-astro-server/index.js +79 -31
  174. package/dist/vite-plugin-build-css/index.js +100 -177
  175. package/dist/vite-plugin-config-alias/index.js +6 -21
  176. package/dist/vite-plugin-env/index.js +9 -3
  177. package/dist/vite-plugin-jsx/index.js +15 -8
  178. package/dist/vite-plugin-markdown/index.js +95 -71
  179. package/dist/vite-plugin-utils/index.js +13 -0
  180. package/env.d.ts +16 -1
  181. package/package.json +56 -50
  182. package/dist/core/add/consts.js +0 -36
  183. package/dist/core/render/dev/html.js +0 -90
  184. package/dist/core/render/pretty-feed.js +0 -103
  185. package/dist/core/render/rss.js +0 -119
  186. package/dist/types/core/add/consts.d.ts +0 -11
  187. package/dist/types/core/render/dev/html.d.ts +0 -7
  188. package/dist/types/core/render/pretty-feed.d.ts +0 -2
  189. package/dist/types/core/render/rss.d.ts +0 -14
  190. package/dist/types/vite-plugin-build-html/add-rollup-input.d.ts +0 -2
  191. package/dist/types/vite-plugin-build-html/extract-assets.d.ts +0 -20
  192. package/dist/types/vite-plugin-build-html/index.d.ts +0 -18
  193. package/dist/types/vite-plugin-build-html/util.d.ts +0 -7
  194. package/dist/vite-plugin-build-html/add-rollup-input.js +0 -50
  195. package/dist/vite-plugin-build-html/extract-assets.js +0 -202
  196. package/dist/vite-plugin-build-html/index.js +0 -427
  197. package/dist/vite-plugin-build-html/util.js +0 -44
package/LICENSE ADDED
@@ -0,0 +1,61 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Fred K. Schott
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
24
+ """
25
+ This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
26
+
27
+ Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
30
+
31
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
+ """
35
+
36
+
37
+ """
38
+ This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
39
+
40
+ MIT License
41
+
42
+ Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
43
+
44
+ Permission is hereby granted, free of charge, to any person obtaining a copy
45
+ of this software and associated documentation files (the "Software"), to deal
46
+ in the Software without restriction, including without limitation the rights
47
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
+ copies of the Software, and to permit persons to whom the Software is
49
+ furnished to do so, subject to the following conditions:
50
+
51
+ The above copyright notice and this permission notice shall be included in all
52
+ copies or substantial portions of the Software.
53
+
54
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
+ SOFTWARE.
61
+ """
package/README.md CHANGED
@@ -1,106 +1,46 @@
1
- <a href="https://astro.build">
2
- <img src="https://raw.githubusercontent.com/withastro/astro/main/assets/social/banner.svg" />
3
- </a>
1
+ <br/>
2
+ <p align="center">
3
+ <img src="../../assets/social/banner-minimal.png" alt="Astro logo">
4
+ <br/><br/>
5
+ <a href="https://astro.build">Astro</a> is a website build tool for the modern web &mdash;
6
+ <br/>
7
+ powerful developer experience meets lightweight output.
8
+ <br/><br/>
9
+ </p>
4
10
 
5
- <div center>
6
11
 
7
- **Astro** is a new kind of static site builder for the modern web&mdash;powerful developer experience meets lightweight output.
12
+ ## Install
8
13
 
9
- </div>
10
14
 
11
- ### [🚀 Read the launch post →](https://astro.build/blog/introducing-astro)
15
+ ```bash
16
+ # Recommended!
17
+ npm create astro@latest
12
18
 
13
- ### [📚 Learn Astro →](https://docs.astro.build/en/getting-started/)
19
+ # Manual:
20
+ npm install --save-dev astro
21
+ ```
14
22
 
15
- ## Project Status
23
+ Looking for help? Start with our [Getting Started](https://docs.astro.build/en/getting-started/) guide.
16
24
 
17
- ⚠️ **Astro is still beta software&mdash;missing features and bugs are to be expected!** We are quickly working our way towards a stable, production-ready v1.0 release, but we are still finalizing some of Astro's APIs.
25
+ Looking for quick examples? [Open a starter project](https://astro.new/) right in your browser.
18
26
 
19
- That being said, there are quite a few Astro sites in production already. We're incredibly grateful to everyone who has made an early bet on Astro!
27
+ ## Documentation
20
28
 
21
- ## Quick Start
29
+ Visit our [offical documentation](https://docs.astro.build/).
22
30
 
23
- <table>
24
- <tbody>
25
- <tr>
26
- <td>
27
- <img width="441" height="1px">
28
- <strong>👾 Online</strong>
29
- </td>
30
- <td>
31
- <img width="441" height="1px">
32
- <strong>📦 Local</strong>
33
- </td>
34
- </tr>
35
- <tr>
36
- <td>
31
+ ## Support
37
32
 
38
- Try Astro in your browser!
33
+ Having trouble? Get help in the official [Astro Discord](https://astro.build/chat).
34
+ ## Contributing
39
35
 
40
- [Launch astro.new →](https://astro.new)
36
+ **New contributors welcome!** Check out our [Contributors Guide](CONTRIBUTING.md) for help getting started.
41
37
 
42
- </td>
43
- <td>
38
+ Join us on [Discord](https://astro.build/chat) to meet other maintainers. We'll help you get your first contribution in no time!
44
39
 
45
- Get started with Astro using our interactive CLI!
40
+ ## Sponsors
46
41
 
47
- ```bash
48
- npm init astro my-astro-project
49
- ```
42
+ Astro is generously supported by [Netlify](https://www.netlify.com/), [Vercel](https://vercel.com/), and several other amazing organizations [listed here.](https://astro.build/)
50
43
 
51
- </td>
52
- </tr>
53
- </tbody>
54
- </table>
44
+ [❤️ Sponsor Astro! ❤️](https://github.com/withastro/.github/blob/main/FUNDING.md)
55
45
 
56
- ## Sponsors
57
46
 
58
- You can sponsor Astro's development on [Open Collective](https://opencollective.com/astrodotbuild). Astro is generously supported by the following companies and individuals:
59
-
60
- ### Platinum Sponsors
61
-
62
- <table>
63
- <tbody>
64
- <tr>
65
- <td align="center"><a href="https://www.netlify.com/#gh-light-mode-only" target="_blank"><img width="147" height="40" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/netlify.svg#gh-light-mode-only" alt="Netlify" /></a><a href="https://www.netlify.com/#gh-dark-mode-only" target="_blank"><img width="147" height="40" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/netlify-dark.svg#gh-dark-mode-only" alt="Netlify" />
66
- </a></td>
67
- <td align="center"><a href="https://www.vercel.com/#gh-light-mode-only" target="_blank"><img width="150" height="34" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/vercel.svg#gh-light-mode-only" alt="Vercel" /></a><a href="https://www.vercel.com/#gh-dark-mode-only"><img width="150" height="34" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/vercel-dark.svg#gh-dark-mode-only" alt="Vercel" />
68
- </a></td>
69
- </tr>
70
- </tbody>
71
- </table>
72
-
73
- ### Gold Sponsors
74
-
75
- <table>
76
- <tbody>
77
- <tr>
78
- <td align="center">
79
- <a href="https://divRIOTS.com#gh-light-mode-only" target="_blank">
80
- <img width="150" height="40" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/divriots.svg#gh-light-mode-only" alt="‹div›RIOTS" />
81
- </a>
82
- <a href="https://divRIOTS.com#gh-dark-mode-only" target="_blank">
83
- <img width="150" height="40" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/divriots-dark.svg#gh-dark-mode-only" alt="‹div›RIOTS" />
84
- </a>
85
- </td>
86
- <td align="center">
87
- <a href="https://stackupdigital.co.uk/#gh-light-mode-only" target="_blank">
88
- <img width="162" height="40" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/stackup.svg#gh-light-mode-only" alt="StackUp Digital" />
89
- </a>
90
- <a href="https://stackupdigital.co.uk/#gh-dark-mode-only" target="_blank">
91
- <img width="130" height="32" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/stackup-dark.svg#gh-dark-mode-only" alt="StackUp Digital" />
92
- </a>
93
- </td>
94
- </tr>
95
- </tbody>
96
- </table>
97
-
98
- ### Sponsors
99
-
100
- <table>
101
- <tbody>
102
- <tr>
103
- <td align="center"><a href="https://sentry.io" target="_blank"><img width="147" height="40" src="https://raw.githubusercontent.com/withastro/astro/main/.github/assets/sentry.svg" alt="Sentry" /></a></td><td align="center"><a href="https://qoddi.com" target="_blank"><img width="147" height="40" src="https://devcenter.qoddi.com/wp-content/uploads/2021/11/blog-transparent-logo-1.png" alt="Qoddi App Platform" /></a></td>
104
- </tr>
105
- </tbody>
106
- </table>