Skip to content

Commit

Permalink
Refactor module
Browse files Browse the repository at this point in the history
* Add throw on invalid node;
* Update dev-dependencies;
* Rewrite tests to use tape;
* Remove `bower`, `component`, `duo` support;
* Add distribution files to releases;
* Update code-style.
  • Loading branch information
wooorm committed Jun 21, 2016
1 parent bc7480e commit 55b8fda
Show file tree
Hide file tree
Showing 18 changed files with 219 additions and 490 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,svg,mdastrc,eslintrc}]
[*.{json,remarkrc,eslintrc,sh}]
indent_size = 2

[*.md]
Expand Down
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
build/
components/
coverage/
build.js
example.js
nlcst-to-string.js
nlcst-to-string.min.js
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
*.log
build/
components/
coverage/
node_modules/
build.js
nlcst-to-string.js
nlcst-to-string.min.js
146 changes: 22 additions & 124 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
{
"excludeFiles": [
"build/",
"components/",
"coverage/",
"node_modules/",
"build.js",
"example.js",
"nlcst-to-string.js",
"nlcst-to-string.min.js"
],
"preset": "crockford",
"requireMultipleVarDecl": false,
"disallowDanglingUnderscores": false,
"disallowQuotedKeysInObjects": {
"allExcept": [
"reserved"
]
},
"disallowKeywords": [
"with"
],
"maximumLineLength": {
"value": 79,
"allExcept": [
"regex",
"urlComments"
]
},
"jsDoc": {
"checkAnnotations": "jsdoc3",
"checkParamExistence": true,
"checkParamNames": true,
"checkRedundantAccess": true,
"checkRedundantParams": true,
Expand All @@ -20,126 +35,9 @@
"enforceExistence": true,
"requireHyphenBeforeDescription": true,
"requireNewlineAfterDescription": true,
"requireParamTypes": true,
"requireParamDescription": true,
"requireParamTypes": true,
"requireReturnDescription": true,
"requireReturnTypes": true
},
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireBlocksOnNewline": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideObjectBrackets": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"requireSpacesInsideObjectBrackets": "all",
"disallowDanglingUnderscores": true,
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"requireOperatorBeforeLineBreak": [
"?",
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"requireSpaceBeforeBinaryOperators": [
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!=="
],
"requireSpaceAfterBinaryOperators": [
"+",
"-",
"/",
"*",
"=",
"==",
"===",
"!=",
"!=="
],
"disallowSpaceAfterPrefixUnaryOperators": [
"++",
"--",
"+",
"-",
"~",
"!"
],
"disallowSpaceBeforePostfixUnaryOperators": [
"++",
"--"
],
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary",
"string"
],
"requireCamelCaseOrUpperCaseIdentifiers": true,
"disallowKeywords": [
"with"
],
"disallowMultipleLineStrings": true,
"disallowMultipleLineBreaks": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywordsOnNewLine": [
"else"
],
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"safeContextKeyword": "self",
"requireDotNotation": true,
"disallowYodaConditions": true
}
}
2 changes: 0 additions & 2 deletions .mdastignore

This file was deleted.

5 changes: 3 additions & 2 deletions .mdastrc → .remarkrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"output": true,
"plugins": [
"comment-config",
"lint",
"github",
"slug",
"validate-links"
"validate-links",
"usage"
],
"settings": {
"bullet": "*"
Expand Down
27 changes: 22 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
language: node_js
script: npm run-script test-travis
node_js:
- '0.10'
- '0.11'
- '0.12'
- iojs
sudo: false
after_script: npm install codecov.io && cat ./coverage/lcov.info | codecov
- '4.0'
- '5.0'
- '6.0'
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
- provider: npm
email: [email protected]
api_key:
secure: EV/6FQQM4A3Y4FB1BiLEaci8VXj+ZLF7hqIGhhhypZ+ur1mgFLqBtqY/WJit2iOD9xexleuzKlDVc8nsh8ctlA7WYtVdE3RpNVj7JT3AYf3tS0F9+s/aH3Mmup5zZ6qRNhy5hjr5pJFqXswC0BnNFxfDLAmKJYfm2NI5QUtTy40=
on:
tags: true
node: '5.0'
- provider: releases
api_key:
secure: GdojWZH0uCo2DguOuk7Zg2okWRsllUFj1Dr9SYAyDYuqSk8kebGtVFhCVVgqdRtQbeARrH8fFJ3r37/ab/1WImfHjru9R0I18udjELbA3nN1FyVyynlSzBhofBzzBSlUQP3RoC1n4zroUuZWTz3h6PQiCwK2jV74/R2a54scQqQ=
file:
- "nlcst-to-string.js"
- "nlcst-to-string.min.js"
on:
tags: true
node: '6.0'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2014-2015 Titus Wormer <[email protected]>
Copyright (c) 2014 Titus Wormer <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
34 changes: 0 additions & 34 deletions bower.json

This file was deleted.

16 changes: 0 additions & 16 deletions component.json

This file was deleted.

16 changes: 16 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Dependencies:
var toString = require('./index.js');

// Stringify:
var node = {
type: 'WordNode',
children: [
{ type: 'TextNode', value: 'AT' },
{ type: 'PunctuationNode', value: '&' },
{ type: 'TextNode', value: 'T' }
]
};
var value = toString(node);

// Yields:
console.log('text', value);
40 changes: 1 addition & 39 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--mdast setext-->
<!--remark setext-->

<!--lint disable no-multiple-toplevel-headings-->

Expand All @@ -9,41 +9,3 @@

1.0.0 / 2015-08-23
==================

* Add support for passing a list of nodes ([9be56e9](https://github.com/wooorm/nlcst-to-string/commit/9be56e9))
* Refactor project ([e2f1d0b](https://github.com/wooorm/nlcst-to-string/commit/e2f1d0b))

0.1.5 / 2015-01-18
==================

* Update copyright notice in `LICENSE` to include 2015 ([b8ab750](https://github.com/wooorm/nlcst-to-string/commit/b8ab750))
* Add links to installation methods in `Readme.md` ([a816354](https://github.com/wooorm/nlcst-to-string/commit/a816354))
* Refactor npm scripts for changes in npm ([2072ebf](https://github.com/wooorm/nlcst-to-string/commit/2072ebf))

0.1.4 / 2014-12-09
==================

* Fix to be more forgiving when stringifying ([1f446f8](https://github.com/wooorm/nlcst-to-string/commit/1f446f8))

0.1.3 / 2014-12-05
==================

* Refactor npm script targets in `package.json` ([21c92fa](https://github.com/wooorm/nlcst-to-string/commit/21c92fa))
* Add link to personal website to copyright in `Readme.md` ([06e7cc6](https://github.com/wooorm/nlcst-to-string/commit/06e7cc6))
* Fix incorrect executive rights on `test.js` ([a4c84e8](https://github.com/wooorm/nlcst-to-string/commit/a4c84e8))

0.1.2 / 2014-11-06
==================

* Refactor test ([c0cfbc3](https://github.com/wooorm/nlcst-to-string/commit/c0cfbc3))
* Refactor npm script target order in `package.json` ([db0e147](https://github.com/wooorm/nlcst-to-string/commit/db0e147))

0.1.1 / 2014-10-20
==================

* Update .gitignore, .npmignore, bower ignore ([15bb72e](https://github.com/wooorm/nlcst-to-string/commit/15bb72e))

0.1.0 / 2014-10-07
==================

* Add mention of NLCST to Readme.md ([f3246b6](https://github.com/wooorm/nlcst-to-string/commit/f3246b6))
Loading

0 comments on commit 55b8fda

Please sign in to comment.