Skip to content

Commit fedccbc

Browse files
author
Jed Mao
committed
Support deeply nested properties
1 parent b7f9896 commit fedccbc

35 files changed

+3929
-25
lines changed

.codeclimate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
languages:
2+
JavaScript: true
3+
exclude_paths:
4+
- "gulpfile.js"
5+
- ".tasks/*.js"
6+
- "js/*.spec.js"

.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module 'postcss-nested-props' {
2+
import plugin = require('d.ts/plugin');
3+
export = plugin;
4+
}

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
root = true;
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
trim_trailing_whitespace = true
7+
end_of_line = lf
8+
insert_final_newline = true
9+
10+
[*.{json,yml}]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[js/**/*.js]
15+
indent_style = space
16+
indent_size = 4
17+
18+
[README.md]
19+
indent_style = ignore
20+
indent_size = ignore
21+
trim_trailing_whitespace = ignore
22+
23+
[*.{DotSettings,suo}]
24+
insert_final_newline = ignore

.eslintrc

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"rules": {
6+
"comma-dangle": [2, "never"],
7+
"no-cond-assign": 2,
8+
"no-constant-condition": 2,
9+
"no-control-regex": 2,
10+
"no-debugger": 2,
11+
"no-dupe-args": 2,
12+
"no-dupe-keys": 2,
13+
"no-duplicate-case": 2,
14+
"no-empty": 2,
15+
"no-empty-character-class": 2,
16+
"no-ex-assign": 2,
17+
"no-extra-boolean-cast": 2,
18+
"no-extra-parens": 2,
19+
"no-extra-semi": 2,
20+
"no-func-assign": 2,
21+
"no-inner-declarations": 2,
22+
"no-invalid-regexp": 2,
23+
"no-irregular-whitespace": 2,
24+
"no-negated-in-lhs": 2,
25+
"no-obj-calls": 2,
26+
"no-regex-spaces": 2,
27+
"no-reserved-keys": 2,
28+
"no-sparse-arrays": 2,
29+
"no-unexpected-multiline": 2,
30+
"no-unreachable": 2,
31+
"use-isnan": 2,
32+
"valid-typeof": 2,
33+
34+
"block-scoped-var": 2,
35+
"consistent-return": 2,
36+
"curly": 2,
37+
"dot-notation": 2,
38+
"eqeqeq": 2,
39+
"guard-for-in": 2,
40+
"no-alert": 2,
41+
"no-caller": 2,
42+
"no-div-regex": 2,
43+
"no-else-return": 2,
44+
"no-eval": 2,
45+
"no-extend-native": 2,
46+
"no-extra-bind": 2,
47+
"no-floating-decimal": 2,
48+
"no-implied-eval": 2,
49+
"no-iterator": 2,
50+
"no-labels": 2,
51+
"no-lone-blocks": 2,
52+
"no-loop-func": 2,
53+
"no-multi-spaces": 2,
54+
"no-multi-str": 2,
55+
"no-native-reassign": 2,
56+
"no-new-func": 2,
57+
"no-new-wrappers": 2,
58+
"no-new": 2,
59+
"no-octal-escape": 2,
60+
"no-octal": 2,
61+
"no-param-reassign": 2,
62+
"no-proto": 2,
63+
"no-redeclare": 2,
64+
"no-return-assign": 2,
65+
"no-script-url": 2,
66+
"no-self-compare": 2,
67+
"no-sequences": 2,
68+
"no-throw-literal": 2,
69+
"no-unused-expressions": 2,
70+
"no-with": 2,
71+
"radix": 2,
72+
"wrap-iife": 2,
73+
"yoda": 2,
74+
75+
"strict": [2, "global"],
76+
77+
"no-delete-var": 2,
78+
"no-shadow-restricted-names": 2,
79+
"no-shadow": 2,
80+
"no-undef-init": 2,
81+
"no-undef": 2,
82+
"no-undefined": 2,
83+
"no-unused-vars": 2,
84+
"no-use-before-define": 0,
85+
86+
"array-bracket-spacing": [2, "never"],
87+
"brace-style": [2, "stroustrup"],
88+
"camelcase": 2,
89+
"comma-spacing": 2,
90+
"eol-last": 2,
91+
"func-style": [2, "declaration"],
92+
"indent": [2, "tab"],
93+
"key-spacing": 2,
94+
"lines-around-comment": 2,
95+
"linebreak-style": 2,
96+
"new-cap": 2,
97+
"new-parens": 2,
98+
"no-array-constructor": 2,
99+
"no-inline-comments": 2,
100+
"no-lonely-if": 2,
101+
"no-mixed-spaces-and-tabs": 2,
102+
"no-multiple-empty-lines": 2,
103+
"no-nested-ternary": 2,
104+
"no-new-object": 2,
105+
"no-spaced-func": 2,
106+
"no-trailing-spaces": 2,
107+
"no-underscore-dangle": 2,
108+
"no-unneeded-ternary": 2,
109+
"object-curly-spacing": [2, "always", {
110+
"objectsInObjects": false,
111+
"arraysInObjects": false
112+
}],
113+
"one-var": 2,
114+
"operator-assignment": 2,
115+
"padded-blocks": [2, "never"],
116+
"quote-props": [2, "as-needed"],
117+
"quotes": [2, "single"],
118+
"semi-spacing": 2,
119+
"semi": 2,
120+
"space-after-keywords": 2,
121+
"space-before-blocks": 2,
122+
"space-before-function-paren": [2, "never"],
123+
"space-in-parens": 2,
124+
"space-infix-ops": 2,
125+
"space-return-throw-case": 2,
126+
"space-unary-ops": 2
127+
}
128+
}

.gitignore

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
# Logs
2-
logs
31
*.log
4-
5-
# Runtime data
6-
pids
7-
*.pid
8-
*.seed
9-
10-
# Directory for instrumented libs generated by jscoverage/JSCover
11-
lib-cov
12-
13-
# Coverage directory used by tools like istanbul
142
coverage
15-
16-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17-
.grunt
18-
19-
# node-waf configuration
20-
.lock-wscript
21-
22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
24-
25-
# Dependency directory
26-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
273
node_modules

.npmignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.*
2+
.tasks/
3+
*.sln*
4+
*.suo
5+
gulpfile.js
6+
tslint.json
7+
coverage/
8+
d.ts/**/*.spec.d.ts
9+
d.ts/test/
10+
js/**/*.spec.js
11+
lib/

.tasks/gulp-clean.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
var del = require('del');
3+
4+
module.exports = function(done) {
5+
del(['js', 'd.ts'], done);
6+
};

.tasks/gulp-eslint.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
var gulp = require('gulp');
3+
var eslint = require('gulp-eslint');
4+
var plumber = require('gulp-plumber');
5+
6+
module.exports = function() {
7+
return gulp.src(['*.js', '.tasks/*.js'])
8+
.pipe(plumber())
9+
.pipe(eslint())
10+
.pipe(eslint.format())
11+
.pipe(eslint.failOnError());
12+
};

.tasks/gulp-scripts.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use strict';
2+
var eventStream = require('event-stream');
3+
var gulp = require('gulp');
4+
var os = require('os');
5+
var through = require('through2');
6+
var ts = require('gulp-typescript');
7+
8+
var project = ts.createProject({
9+
target: 'es5',
10+
module: 'commonjs',
11+
declarationFiles: true,
12+
noExternalResolve: true
13+
});
14+
15+
function istanbulIgnoreTypeScriptExtend() {
16+
var tsExtends = /^var __extends =/;
17+
return through.obj(function(file, enc, done) {
18+
if (file.isBuffer() && tsExtends.test(file.contents)) {
19+
file.contents = Buffer.concat([
20+
new Buffer('/* istanbul ignore next: TypeScript extend */' + os.EOL),
21+
file.contents
22+
]);
23+
}
24+
this.push(file);
25+
done();
26+
});
27+
}
28+
29+
module.exports = function() {
30+
var result = gulp.src([
31+
'typings/**/*.d.ts',
32+
'lib/**/*.ts'
33+
], {
34+
base: './lib'
35+
})
36+
.pipe(ts(project));
37+
38+
return eventStream.merge(
39+
result.dts.pipe(gulp.dest('d.ts')),
40+
result.js
41+
.pipe(istanbulIgnoreTypeScriptExtend())
42+
.pipe(gulp.dest('js'))
43+
);
44+
};

.tasks/gulp-test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
var gulp = require('gulp');
3+
var istanbul = require('gulp-istanbul');
4+
var mocha = require('gulp-mocha');
5+
var plumber = require('gulp-plumber');
6+
7+
module.exports = function(done) {
8+
gulp.src('js/**/*.js')
9+
.pipe(istanbul())
10+
.pipe(istanbul.hookRequire())
11+
.on('finish', function() {
12+
gulp.src(['js/**/*.spec.js'], { read: false })
13+
.pipe(plumber())
14+
.pipe(mocha({
15+
reporter: 'spec',
16+
clearRequireCache: true
17+
}))
18+
.pipe(istanbul.writeReports({
19+
reporters: ['lcov']
20+
}))
21+
.on('end', done);
22+
});
23+
};

.tasks/gulp-tslint.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
var gulp = require('gulp');
3+
var plumber = require('gulp-plumber');
4+
var tslint = require('gulp-tslint');
5+
6+
module.exports = function() {
7+
return gulp.src(['lib/**/*.ts'])
8+
.pipe(plumber())
9+
.pipe(tslint())
10+
.pipe(tslint.report('verbose'));
11+
};

.tasks/gulp-watch.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
var gulp = require('gulp');
3+
4+
module.exports = function() {
5+
gulp.watch(['*.js', '.tasks/*.js'], ['eslint']);
6+
gulp.watch(['lib/**/*.ts'], ['test']);
7+
};

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: node_js
2+
3+
node_js:
4+
- '0.12'
5+
6+
script:
7+
- gulp test:ci
8+
9+
after_success:
10+
- npm install codeclimate-test-reporter
11+
- codeclimate-test-reporter < coverage/lcov.info
12+
13+
notifications:
14+
email:
15+
on_success: change
16+
on_failure: always

0 commit comments

Comments
 (0)