Skip to content

Commit

Permalink
Improve npm search ranking of individual packages
Browse files Browse the repository at this point in the history
* Quality: Add changelogs (increase score from 92% to 100%)
* Tests: Add test script to individual packages (increase score
  from 70% to 100%)
* Health: Update unified (see c77d24f, increase score from 75%
  to 100%)
* Branding: Add another badge (increase score from 85% to 100%)
  • Loading branch information
wooorm committed Oct 21, 2018
1 parent 4e24d52 commit e7f509f
Show file tree
Hide file tree
Showing 19 changed files with 800 additions and 685 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

See [GitHub Releases][releases] for the changelog.

[releases]: https://github.com/remarkjs/remark/releases
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"browserify": "^16.0.0",
"bundle-collapser": "^1.3.0",
"camelcase": "^5.0.0",
"chalk": "^2.0.0",
"clone": "^2.0.0",
"execa": "^1.0.0",
"extend": "^3.0.0",
"lerna": "^3.0.0",
"mdast-util-assert": "^1.0.0",
"mdast-util-compact": "^1.0.0",
Expand All @@ -24,9 +21,6 @@
"tinyify": "^2.4.3",
"unist-builder": "^1.0.2",
"unist-util-remove-position": "^1.1.0",
"unist-util-visit": "^1.1.0",
"vfile": "^3.0.0",
"wcwidth": "^1.0.1",
"xo": "^0.23.0"
},
"scripts": {
Expand All @@ -35,10 +29,9 @@
"build-bundle": "browserify packages/remark -s remark > remark.js",
"build-mangle": "browserify packages/remark -s remark -p tinyify > remark.min.js",
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test/api",
"test-api-extensive": "TEST_EXTENDED=true node test/api",
"test-cli": "node test/cli.js",
"test-coverage": "nyc --reporter lcov tape test",
"test-api": "tape packages/*/test.js test/index.js",
"test-api-extensive": "TEST_EXTENDED=true npm run test-api",
"test-coverage": "nyc --reporter lcov tape \"test/index.js\" \"packages/*/test.js\"",
"test": "npm run format && npm run build && npm run test-coverage"
},
"nyc": {
Expand Down
18 changes: 12 additions & 6 deletions packages/remark-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"cli",
"bin"
],
"dependencies": {
"markdown-extensions": "^1.1.0",
"remark": "^9.0.0",
"unified-args": "^6.0.0"
},
"homepage": "http://remark.js.org",
"repository": "https://github.com/remarkjs/remark/tree/master/packages/remark-cli",
"bugs": "https://github.com/remarkjs/remark/issues",
Expand All @@ -27,6 +22,17 @@
"files": [
"cli.js"
],
"scripts": {},
"dependencies": {
"markdown-extensions": "^1.1.0",
"remark": "^9.0.0",
"unified-args": "^6.0.0"
},
"devDependencies": {
"execa": "^1.0.0",
"tape": "^4.9.1"
},
"scripts": {
"test": "tape test.js"
},
"xo": false
}
6 changes: 5 additions & 1 deletion packages/remark-cli/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# remark-cli [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
# remark-cli [![Travis][build-badge]][build-status] [![Coverage][coverage-badge]][coverage-status] [![Downloads][dl-badge]][dl] [![Chat][chat-badge]][chat]

Command-line interface for [**remark**][remark].

Expand Down Expand Up @@ -89,6 +89,10 @@ Examples:

[coverage-status]: https://codecov.io/github/remarkjs/remark

[dl-badge]: https://img.shields.io/npm/dm/remark-cli.svg

[dl]: https://www.npmjs.com/package/remark-cli

[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg

[chat]: https://gitter.im/remarkjs/Lobby
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions packages/remark-parse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,13 @@
"vfile-location": "^2.0.0",
"xtend": "^4.0.1"
},
"devDependencies": {
"tape": "^4.9.1",
"unified": "^7.0.0",
"vfile": "^3.0.0"
},
"scripts": {
"test": "tape test.js"
},
"xo": false
}
10 changes: 9 additions & 1 deletion packages/remark-parse/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# remark-parse [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
# remark-parse [![Travis][build-badge]][build-status] [![Coverage][coverage-badge]][coverage-status] [![Downloads][dl-badge]][dl] [![Size][size-badge]][size] [![Chat][chat-badge]][chat]

[Parser][] for [**unified**][unified]. Parses markdown to an
[**MDAST**][mdast] syntax tree. Used in the [**remark**
Expand Down Expand Up @@ -421,6 +421,14 @@ Preferably, just use [this plugin](https://github.com/zestedesavoir/zmarkdown/tr

[coverage-status]: https://codecov.io/github/remarkjs/remark

[dl-badge]: https://img.shields.io/npm/dm/remark-parse.svg

[dl]: https://www.npmjs.com/package/remark-parse

[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-parse.svg

[size]: https://bundlephobia.com/result?p=remark-parse

[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg

[chat]: https://gitter.im/remarkjs/Lobby
Expand Down
43 changes: 30 additions & 13 deletions test/remark-parse.js → packages/remark-parse/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ var path = require('path')
var fs = require('fs')
var test = require('tape')
var vfile = require('vfile')
var remark = require('../packages/remark')
var Parser = require('../packages/remark-parse').Parser
var unified = require('unified')
var parse = require('.')

var Parser = parse.Parser

test('remark().parse(file)', function(t) {
t.equal(
remark().parse('Alfred').children.length,
unified()
.use(parse)
.parse('Alfred').children.length,
1,
'should accept a `string`'
)

t.throws(
function() {
remark()
unified()
.use(parse)
.data('settings', {position: 0})
.parse('')
},
Expand All @@ -40,7 +45,8 @@ test('remark().parse(file)', function(t) {

t.throws(
function() {
remark()
unified()
.use(parse)
.data('settings', {gfm: Infinity})
.parse('')
},
Expand All @@ -50,7 +56,8 @@ test('remark().parse(file)', function(t) {

t.throws(
function() {
remark()
unified()
.use(parse)
.data('settings', {footnotes: 1})
.parse('')
},
Expand All @@ -60,7 +67,8 @@ test('remark().parse(file)', function(t) {

t.throws(
function() {
remark()
unified()
.use(parse)
.data('settings', {pedantic: {}})
.parse('')
},
Expand All @@ -69,7 +77,8 @@ test('remark().parse(file)', function(t) {
)

t.deepEqual(
remark()
unified()
.use(parse)
.data('settings', {position: false})
.parse('<foo></foo>'),
{
Expand All @@ -88,7 +97,8 @@ test('remark().parse(file)', function(t) {
)

t.deepEqual(
remark()
unified()
.use(parse)
.data('settings', {position: false, blocks: ['foo']})
.parse('<foo></foo>'),
{
Expand All @@ -99,7 +109,9 @@ test('remark().parse(file)', function(t) {
)

t.test('should throw parse errors', function(st) {
var processor = remark().use(plugin)
var processor = unified()
.use(parse)
.use(plugin)

st.plan(5)

Expand Down Expand Up @@ -130,7 +142,9 @@ test('remark().parse(file)', function(t) {
})

t.test('should warn when missing locators', function(st) {
var processor = remark().use(plugin)
var processor = unified()
.use(parse)
.use(plugin)

st.throws(function() {
processor.parse(vfile('Hello *World*!'))
Expand Down Expand Up @@ -161,7 +175,9 @@ test('remark().parse(file)', function(t) {
var notTerminated =
'Named character references must be terminated by a semicolon'

remark().parse(file)
unified()
.use(parse)
.parse(file)

st.deepEqual(file.messages.map(String), [
'1:13: Named character references must be known',
Expand All @@ -187,7 +203,8 @@ test('remark().parse(file)', function(t) {
})

t.test('should be able to set options', function(st) {
var tree = remark()
var tree = unified()
.use(parse)
.use(plugin)
.parse(['<!-- commonmark -->', '', '1) Hello World', ''].join('\n'))

Expand Down
10 changes: 10 additions & 0 deletions packages/remark-stringify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,15 @@
"unherit": "^1.0.4",
"xtend": "^4.0.1"
},
"devDependencies": {
"tape": "^4.9.1",
"unified": "^7.0.0",
"unist-builder": "^1.0.3",
"unist-util-visit": "^1.4.0",
"wcwidth": "^1.0.1"
},
"scripts": {
"test": "tape test.js"
},
"xo": false
}
10 changes: 9 additions & 1 deletion packages/remark-stringify/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# remark-stringify [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
# remark-stringify [![Travis][build-badge]][build-status] [![Coverage][coverage-badge]][coverage-status] [![Downloads][dl-badge]][dl] [![Size][size-badge]][size] [![Chat][chat-badge]][chat]

[Compiler][] for [**unified**][unified]. Stringifies an
[**MDAST**][mdast] syntax tree to markdown. Used in the [**remark**
Expand Down Expand Up @@ -234,6 +234,14 @@ Stringify `node`.

[coverage-status]: https://codecov.io/github/remarkjs/remark

[dl-badge]: https://img.shields.io/npm/dm/remark-stringify.svg

[dl]: https://www.npmjs.com/package/remark-stringify

[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-stringify.svg

[size]: https://bundlephobia.com/result?p=remark-stringify

[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg

[chat]: https://gitter.im/remarkjs/Lobby
Expand Down
Loading

0 comments on commit e7f509f

Please sign in to comment.