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>`}
```
This commit is contained in:
Matthew Phillips 2021-04-06 15:27:42 -04:00 committed by GitHub
parent 1acd5ee310
commit 7240f0d677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 61 additions and 11 deletions

View file

@ -1,16 +1,16 @@
{
"name": "prism-astro",
"name": "astro-prism",
"version": "1.0.0",
"description": "",
"description": "This is not published at this time.",
"main": "index.mjs",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"exports": {
".": "./index.mjs",
"./Prism.astro": "./Prism.astro"
".": "./index.mjs"
},
"keywords": [],
"private": true,
"author": "",
"license": "ISC",
"devDependencies": {

View file

@ -1,6 +1,6 @@
---
import Prism from 'prismjs';
import { addAstro } from './index.mjs';
import { addAstro } from '../astro-prism/index.mjs';
addAstro(Prism);

46
package-lock.json generated
View file

@ -1030,6 +1030,17 @@
"resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.0.tgz",
"integrity": "sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q=="
},
"clipboard": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz",
"integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==",
"optional": true,
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
@ -1295,6 +1306,12 @@
"integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==",
"dev": true
},
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
"optional": true
},
"dequal": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz",
@ -1961,6 +1978,15 @@
"slash": "^3.0.0"
}
},
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"optional": true,
"requires": {
"delegate": "^3.1.2"
}
},
"got": {
"version": "9.6.0",
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
@ -3119,6 +3145,14 @@
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
"integrity": "sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U="
},
"prismjs": {
"version": "1.23.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz",
"integrity": "sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==",
"requires": {
"clipboard": "^2.0.0"
}
},
"progress": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
@ -3410,6 +3444,12 @@
"kind-of": "^6.0.0"
}
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
"optional": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
@ -3717,6 +3757,12 @@
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
"dev": true
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"optional": true
},
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",

View file

@ -7,14 +7,18 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./mastro.mjs",
".": "./astro.mjs",
"./snowpack-plugin": "./snowpack-plugin.cjs",
"./h": "./lib/h.js",
"./render/preact": "./lib/render/preact.js"
"./components/*.astro": "./components/*.astro"
},
"bin": {
"astro": "astro.mjs"
},
"files": [
"components",
"lib",
"prism-astro"
],
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
@ -57,6 +61,7 @@
"postcss-icss-keyframes": "^0.2.1",
"preact": "^10.5.13",
"preact-render-to-string": "^5.1.18",
"prismjs": "^1.23.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rollup": "^2.43.1",

View file

@ -2,7 +2,7 @@
layout: ../layouts/index.astro
title: Astro
import:
Prism: prism-astro/Prism.astro
Prism: astro/components/Prism.astro
---
## Links

View file

@ -1,5 +1,5 @@
---
import Prism from 'prism-astro/Prism.astro';
import Prism from 'astro/components/Prism.astro';
import 'prismjs/themes/prism-tomorrow.css';
let title = 'Astro Build';

View file

@ -12,7 +12,6 @@
"license": "ISC",
"devDependencies": {
"astro": "file:../",
"prism-astro": "file:../prism-astro/",
"prismjs": "^1.23.0"
}
}