Skip to content

Commit

Permalink
Changed packaging from javascript to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
DxCx committed Sep 13, 2016
1 parent 7e7b682 commit fdf6ea8
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "stage-0"]
"presets": ["es2015"]
}
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
npm-debug.log
coverage
npm-debug.log
dist
*.tgz
10 changes: 6 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
src
test
coverage
resources
*
!dist/
!dist/*
!package.json
!*.md
!*.png
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ node_js:
- "5.1"
- "4.4"
install:
- npm config set spin=false
- npm install -g coveralls
- npm install

script:
- npm test
- npm run coverage
- coveralls < ./coverage/lcov.info || true # if coveralls doesn't have it covered

# Allow Travis tests to run in containers.
Expand Down
68 changes: 0 additions & 68 deletions index.d.ts

This file was deleted.

52 changes: 34 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
"version": "0.6.6",
"description": "A set of useful GraphQL tools",
"main": "dist/index.js",
"typings": "index.d.ts",
"typings": "dist/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
},
"directories": {
"test": "test"
},
"scripts": {
"test": "istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter spec --full-trace test/index.js && npm run lint",
"lint": "eslint .",
"testonly": "mocha test/index.js",
"prepublish": "rm -rf ./dist && babel ./src --ignore test --out-dir ./dist"
"compile": "tsc",
"typings": "typings install",
"pretest": "npm run compile",
"test": "npm run testonly --",
"posttest": "npm run lint",
"lint": "tslint ./src/**/*.ts",
"watch": "tsc -w",
"testonly": "mocha --compilers js:babel-core/register --reporter spec --full-trace ./dist/test/tests.js",
"coverage": "babel-node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js",
"postcoverage": "remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info",
"prepublish": "npm run compile"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,21 +50,23 @@
"graphql": "^0.5.0 || ^0.6.0 || ^0.7.0"
},
"devDependencies": {
"babel-cli": "^6.6.5",
"babel-core": "^6.9.1",
"babel-eslint": "^6.0.0-beta.6",
"babel-loader": "6.2.5",
"babel-polyfill": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"@types/bluebird": "^3.0.32",
"@types/chai": "^3.4.32",
"@types/lodash": "^4.14.34",
"@types/mocha": "^2.2.31",
"@types/node": "^6.0.38",
"@types/node-uuid": "0.0.27",
"@types/request": "0.0.30",
"@types/request-promise": "^3.0.30",
"babel-cli": "^6.14.0",
"babel-core": "^6.14.0",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.14.0",
"body-parser": "^1.15.0",
"chai": "^3.5.0",
"dataloader": "^1.1.0",
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
"eslint-plugin-import": "^1.1.0",
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0",
"delete-empty": "^0.1.3",
"dts-bundle": "^0.5.0",
"express": "^4.13.4",
"express3": "0.0.0",
"fs": "0.0.2",
Expand All @@ -65,10 +77,14 @@
"mocha": "^3.0.1",
"multer": "^1.0.3",
"nodemon": "^1.9.1",
"remap-istanbul": "^0.6.4",
"request": "^2.72.0",
"request-promise": "^4.1.0",
"source-map-support": "^0.4.2",
"supertest": "^2.0.0",
"supertest-as-promised": "^4.0.0",
"webpack": "^1.13.1"
"tslint": "^3.15.1",
"tslint-loader": "^2.1.5",
"typescript": "2.0.0"
}
}
27 changes: 27 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"sourceMap": true,
"declaration": true,
"rootDir": "./src",
"outDir": "./dist",
"removeComments": false,
"typeRoots": [
"node_modules/@types"
],
"types": [
"@types/node",
"graphql-typings"
]
},
"exclude": [
"node_modules"
]
}
142 changes: 142 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"rules": {
"align": [
false,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"spaces"
],
"interface-name": false,
"jsdoc-format": true,
"label-position": true,
"label-undefined": true,
"max-line-length": [
true,
140
],
"member-access": true,
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"no-console": [
true,
"log",
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-null-keyword": false,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unreachable": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-finally",
"check-whitespace"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"radix": true,
"semicolon": [
true,
"always"
],
"switch-default": true,
"trailing-comma": [
true,
{
"multiline": "always",
"singleline": "never"
}
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef": [
false,
"call-signature",
"parameter",
"arrow-parameter",
"property-declaration",
"variable-declaration",
"member-variable-declaration"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "space",
"index-signature": "space",
"parameter": "space",
"property-declaration": "space",
"variable-declaration": "space"
}
],
"use-strict": [
false
],
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"ban-keywords",
"allow-pascal-case"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}

0 comments on commit fdf6ea8

Please sign in to comment.