Skip to content

Commit 55b8fda

Browse files
committed
Refactor module
* 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.
1 parent bc7480e commit 55b8fda

18 files changed

+219
-490
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11-
[*.{json,svg,mdastrc,eslintrc}]
11+
[*.{json,remarkrc,eslintrc,sh}]
1212
indent_size = 2
1313

1414
[*.md]

.eslintignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
build/
2-
components/
31
coverage/
4-
build.js
52
example.js
63
nlcst-to-string.js
74
nlcst-to-string.min.js

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.DS_Store
22
*.log
3-
build/
4-
components/
53
coverage/
64
node_modules/
7-
build.js
5+
nlcst-to-string.js
6+
nlcst-to-string.min.js

.jscs.json

Lines changed: 22 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
{
22
"excludeFiles": [
3-
"build/",
4-
"components/",
53
"coverage/",
64
"node_modules/",
7-
"build.js",
8-
"example.js",
95
"nlcst-to-string.js",
106
"nlcst-to-string.min.js"
117
],
8+
"preset": "crockford",
9+
"requireMultipleVarDecl": false,
10+
"disallowDanglingUnderscores": false,
11+
"disallowQuotedKeysInObjects": {
12+
"allExcept": [
13+
"reserved"
14+
]
15+
},
16+
"disallowKeywords": [
17+
"with"
18+
],
19+
"maximumLineLength": {
20+
"value": 79,
21+
"allExcept": [
22+
"regex",
23+
"urlComments"
24+
]
25+
},
1226
"jsDoc": {
1327
"checkAnnotations": "jsdoc3",
28+
"checkParamExistence": true,
1429
"checkParamNames": true,
1530
"checkRedundantAccess": true,
1631
"checkRedundantParams": true,
@@ -20,126 +35,9 @@
2035
"enforceExistence": true,
2136
"requireHyphenBeforeDescription": true,
2237
"requireNewlineAfterDescription": true,
23-
"requireParamTypes": true,
2438
"requireParamDescription": true,
39+
"requireParamTypes": true,
40+
"requireReturnDescription": true,
2541
"requireReturnTypes": true
26-
},
27-
"requireCurlyBraces": [
28-
"if",
29-
"else",
30-
"for",
31-
"while",
32-
"do",
33-
"try",
34-
"catch"
35-
],
36-
"requireSpaceAfterKeywords": [
37-
"if",
38-
"else",
39-
"for",
40-
"while",
41-
"do",
42-
"switch",
43-
"return",
44-
"try",
45-
"catch"
46-
],
47-
"requireSpaceBeforeBlockStatements": true,
48-
"requireParenthesesAroundIIFE": true,
49-
"requireSpacesInConditionalExpression": true,
50-
"requireSpacesInFunctionExpression": {
51-
"beforeOpeningCurlyBrace": true
52-
},
53-
"requireSpacesInAnonymousFunctionExpression": {
54-
"beforeOpeningRoundBrace": true,
55-
"beforeOpeningCurlyBrace": true
56-
},
57-
"requireSpacesInNamedFunctionExpression": {
58-
"beforeOpeningRoundBrace": true,
59-
"beforeOpeningCurlyBrace": true
60-
},
61-
"requireBlocksOnNewline": true,
62-
"disallowEmptyBlocks": true,
63-
"disallowSpacesInsideObjectBrackets": true,
64-
"disallowSpacesInsideArrayBrackets": true,
65-
"disallowSpacesInsideParentheses": true,
66-
"requireSpacesInsideObjectBrackets": "all",
67-
"disallowDanglingUnderscores": true,
68-
"disallowSpaceAfterObjectKeys": true,
69-
"requireCommaBeforeLineBreak": true,
70-
"requireOperatorBeforeLineBreak": [
71-
"?",
72-
"+",
73-
"-",
74-
"/",
75-
"*",
76-
"=",
77-
"==",
78-
"===",
79-
"!=",
80-
"!==",
81-
">",
82-
">=",
83-
"<",
84-
"<="
85-
],
86-
"requireSpaceBeforeBinaryOperators": [
87-
"+",
88-
"-",
89-
"/",
90-
"*",
91-
"=",
92-
"==",
93-
"===",
94-
"!=",
95-
"!=="
96-
],
97-
"requireSpaceAfterBinaryOperators": [
98-
"+",
99-
"-",
100-
"/",
101-
"*",
102-
"=",
103-
"==",
104-
"===",
105-
"!=",
106-
"!=="
107-
],
108-
"disallowSpaceAfterPrefixUnaryOperators": [
109-
"++",
110-
"--",
111-
"+",
112-
"-",
113-
"~",
114-
"!"
115-
],
116-
"disallowSpaceBeforePostfixUnaryOperators": [
117-
"++",
118-
"--"
119-
],
120-
"disallowImplicitTypeConversion": [
121-
"numeric",
122-
"boolean",
123-
"binary",
124-
"string"
125-
],
126-
"requireCamelCaseOrUpperCaseIdentifiers": true,
127-
"disallowKeywords": [
128-
"with"
129-
],
130-
"disallowMultipleLineStrings": true,
131-
"disallowMultipleLineBreaks": true,
132-
"validateLineBreaks": "LF",
133-
"validateQuoteMarks": "'",
134-
"disallowMixedSpacesAndTabs": true,
135-
"disallowTrailingWhitespace": true,
136-
"disallowTrailingComma": true,
137-
"disallowKeywordsOnNewLine": [
138-
"else"
139-
],
140-
"requireLineFeedAtFileEnd": true,
141-
"requireCapitalizedConstructors": true,
142-
"safeContextKeyword": "self",
143-
"requireDotNotation": true,
144-
"disallowYodaConditions": true
42+
}
14543
}

.mdastignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.mdastrc renamed to .remarkrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"output": true,
33
"plugins": [
44
"comment-config",
5+
"lint",
56
"github",
6-
"slug",
7-
"validate-links"
7+
"validate-links",
8+
"usage"
89
],
910
"settings": {
1011
"bullet": "*"

.travis.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
language: node_js
2-
script: npm run-script test-travis
32
node_js:
4-
- '0.10'
53
- '0.11'
64
- '0.12'
7-
- iojs
8-
sudo: false
9-
after_script: npm install codecov.io && cat ./coverage/lcov.info | codecov
5+
- '4.0'
6+
- '5.0'
7+
- '6.0'
8+
after_success:
9+
- bash <(curl -s https://codecov.io/bash)
10+
deploy:
11+
- provider: npm
12+
13+
api_key:
14+
secure: EV/6FQQM4A3Y4FB1BiLEaci8VXj+ZLF7hqIGhhhypZ+ur1mgFLqBtqY/WJit2iOD9xexleuzKlDVc8nsh8ctlA7WYtVdE3RpNVj7JT3AYf3tS0F9+s/aH3Mmup5zZ6qRNhy5hjr5pJFqXswC0BnNFxfDLAmKJYfm2NI5QUtTy40=
15+
on:
16+
tags: true
17+
node: '5.0'
18+
- provider: releases
19+
api_key:
20+
secure: GdojWZH0uCo2DguOuk7Zg2okWRsllUFj1Dr9SYAyDYuqSk8kebGtVFhCVVgqdRtQbeARrH8fFJ3r37/ab/1WImfHjru9R0I18udjELbA3nN1FyVyynlSzBhofBzzBSlUQP3RoC1n4zroUuZWTz3h6PQiCwK2jV74/R2a54scQqQ=
21+
file:
22+
- "nlcst-to-string.js"
23+
- "nlcst-to-string.min.js"
24+
on:
25+
tags: true
26+
node: '6.0'

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(The MIT License)
22

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

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

bower.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

component.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

example.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Dependencies:
2+
var toString = require('./index.js');
3+
4+
// Stringify:
5+
var node = {
6+
type: 'WordNode',
7+
children: [
8+
{ type: 'TextNode', value: 'AT' },
9+
{ type: 'PunctuationNode', value: '&' },
10+
{ type: 'TextNode', value: 'T' }
11+
]
12+
};
13+
var value = toString(node);
14+
15+
// Yields:
16+
console.log('text', value);

history.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--mdast setext-->
1+
<!--remark setext-->
22

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

@@ -9,41 +9,3 @@
99

1010
1.0.0 / 2015-08-23
1111
==================
12-
13-
* Add support for passing a list of nodes ([9be56e9](https://github.com/wooorm/nlcst-to-string/commit/9be56e9))
14-
* Refactor project ([e2f1d0b](https://github.com/wooorm/nlcst-to-string/commit/e2f1d0b))
15-
16-
0.1.5 / 2015-01-18
17-
==================
18-
19-
* Update copyright notice in `LICENSE` to include 2015 ([b8ab750](https://github.com/wooorm/nlcst-to-string/commit/b8ab750))
20-
* Add links to installation methods in `Readme.md` ([a816354](https://github.com/wooorm/nlcst-to-string/commit/a816354))
21-
* Refactor npm scripts for changes in npm ([2072ebf](https://github.com/wooorm/nlcst-to-string/commit/2072ebf))
22-
23-
0.1.4 / 2014-12-09
24-
==================
25-
26-
* Fix to be more forgiving when stringifying ([1f446f8](https://github.com/wooorm/nlcst-to-string/commit/1f446f8))
27-
28-
0.1.3 / 2014-12-05
29-
==================
30-
31-
* Refactor npm script targets in `package.json` ([21c92fa](https://github.com/wooorm/nlcst-to-string/commit/21c92fa))
32-
* Add link to personal website to copyright in `Readme.md` ([06e7cc6](https://github.com/wooorm/nlcst-to-string/commit/06e7cc6))
33-
* Fix incorrect executive rights on `test.js` ([a4c84e8](https://github.com/wooorm/nlcst-to-string/commit/a4c84e8))
34-
35-
0.1.2 / 2014-11-06
36-
==================
37-
38-
* Refactor test ([c0cfbc3](https://github.com/wooorm/nlcst-to-string/commit/c0cfbc3))
39-
* Refactor npm script target order in `package.json` ([db0e147](https://github.com/wooorm/nlcst-to-string/commit/db0e147))
40-
41-
0.1.1 / 2014-10-20
42-
==================
43-
44-
* Update .gitignore, .npmignore, bower ignore ([15bb72e](https://github.com/wooorm/nlcst-to-string/commit/15bb72e))
45-
46-
0.1.0 / 2014-10-07
47-
==================
48-
49-
* Add mention of NLCST to Readme.md ([f3246b6](https://github.com/wooorm/nlcst-to-string/commit/f3246b6))

0 commit comments

Comments
 (0)