@datocms/astro 0.1.0
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.
- package/README.md +54 -0
- package/components/Foobar.astro +1 -0
- package/lib/astro.d.ts +9 -0
- package/lib/index.ts +1 -0
- package/lib/types.ts +1 -0
- package/lib/utils.ts +3 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Astro Starter Kit: Basics
|
|
2
|
+
|
|
3
|
+
```sh
|
|
4
|
+
npm create astro@latest -- --template basics
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
|
|
8
|
+
[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
|
|
9
|
+
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
|
|
10
|
+
|
|
11
|
+
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## 🚀 Project Structure
|
|
16
|
+
|
|
17
|
+
Inside of your Astro project, you'll see the following folders and files:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
/
|
|
21
|
+
├── public/
|
|
22
|
+
│ └── favicon.svg
|
|
23
|
+
├── src/
|
|
24
|
+
│ ├── components/
|
|
25
|
+
│ │ └── Card.astro
|
|
26
|
+
│ ├── layouts/
|
|
27
|
+
│ │ └── Layout.astro
|
|
28
|
+
│ └── pages/
|
|
29
|
+
│ └── index.astro
|
|
30
|
+
└── package.json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
|
34
|
+
|
|
35
|
+
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
|
36
|
+
|
|
37
|
+
Any static assets, like images, can be placed in the `public/` directory.
|
|
38
|
+
|
|
39
|
+
## 🧞 Commands
|
|
40
|
+
|
|
41
|
+
All commands are run from the root of the project, from a terminal:
|
|
42
|
+
|
|
43
|
+
| Command | Action |
|
|
44
|
+
| :------------------------ | :----------------------------------------------- |
|
|
45
|
+
| `npm install` | Installs dependencies |
|
|
46
|
+
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
|
47
|
+
| `npm run build` | Build your production site to `./dist/` |
|
|
48
|
+
| `npm run preview` | Preview your build locally, before deploying |
|
|
49
|
+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
50
|
+
| `npm run astro -- --help` | Get help using the Astro CLI |
|
|
51
|
+
|
|
52
|
+
## 👀 Want to learn more?
|
|
53
|
+
|
|
54
|
+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>Foobar</h1>
|
package/lib/astro.d.ts
ADDED
package/lib/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Foobar } from "../components/Foobar.astro";
|
package/lib/types.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Foo = '1';
|
package/lib/utils.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@datocms/astro",
|
|
3
|
+
"description": "A set of components and utilities to work faster with DatoCMS in Astro projects.",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git://github.com/datocms/astro-datocms.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/datocms/astro-datocms",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Stefano Verna <s.verna@datocms.com>",
|
|
14
|
+
"contributors": ["Silvano Stralla <silvano@datocms.com>"],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"astro",
|
|
17
|
+
"withastro",
|
|
18
|
+
"astro-component",
|
|
19
|
+
"datocms",
|
|
20
|
+
"typescript",
|
|
21
|
+
"ui"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./lib/index.ts",
|
|
25
|
+
"./types": "./lib/types.ts",
|
|
26
|
+
"./utils": "./lib/utils.ts"
|
|
27
|
+
},
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
"*": {
|
|
30
|
+
"*": ["lib/*"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18.0.0"
|
|
35
|
+
},
|
|
36
|
+
"files": ["components", "lib"],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"check": "astro check --root components"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@astrojs/check": "^0.9.1",
|
|
42
|
+
"typescript": "^5.5.4"
|
|
43
|
+
}
|
|
44
|
+
}
|