Skip to content

Commit

Permalink
Refactor package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 28, 2024
1 parent e1be4fe commit b51a375
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
44 changes: 29 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
{
"name": "rehype-starry-night",
"type": "module",
"version": "1.0.2",
"description": "syntaxhighlight using starry-night",
"homepage": "https://github.com/y-nk/rehype-starry-night",
"description": "rehype plugin to highlight code with `starry-night`",
"license": "MIT",
"keywords": [
"rehype",
"hast",
"highlight",
"html",
"night",
"plugin",
"rehype",
"rehype-plugin",
"starry-night",
"starry",
"syntax",
"hightlight"
"unified"
],
"author": "Julien Barbay <[email protected]>",
"license": "MIT",
"repository": "rehypejs/rehype-starry-night",
"main": "index.js",
"bugs": "https://github.com/rehypejs/rehype-starry-night/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Julien Barbay <[email protected]>",
"contributors": [
"Julien Barbay <[email protected]>",
"Titus Wormer <[email protected]> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"files": [
"./index.js"
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/hast": "^3.0.0",
"@wooorm/starry-night": "^3.0.0",
"hast-util-to-string": "^3.0.0",
"levenshtein-edit-distance": "^3.0.0",
"remark-rehype": "^11.1.0",
"unist-util-visit-parents": "^6.0.0",
"vfile": "^6.0.0"
},
Expand All @@ -44,6 +61,7 @@
"scripts": {
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix",
"prepack": "npm run build && npm run format",
"test": "npm run build && npm run format && npm run test-coverage",
"test-api": "node --conditions development test/index.js",
"test-coverage": "c8 --100 --check-coverage --reporter lcov npm run test-api"
Expand All @@ -59,11 +77,7 @@
"remarkConfig": {
"plugins": [
"remark-preset-wooorm",
"remark-api",
[
"remark-lint-no-html",
false
]
"remark-api"
]
},
"typeCoverage": {
Expand Down
6 changes: 2 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import test from 'node:test'
import {common} from '@wooorm/starry-night'
import sourceTsx from '@wooorm/starry-night/source.tsx'
import rehypeParse from 'rehype-parse'
import rehypeStarryNight from 'rehype-starry-night'
import rehypeStringify from 'rehype-stringify'
import {read, write} from 'to-vfile'
import {unified} from 'unified'
import {VFile} from 'vfile'
import rehypeStarryNight from '../index.js'

// To do: export map and import self.

test('rehypeStarryNight', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
assert.deepEqual(Object.keys(await import('rehype-starry-night')).sort(), [
'default'
])
})
Expand Down

0 comments on commit b51a375

Please sign in to comment.