From a1f45b01951bc3a7cfb4a4db6734fa34615d667d Mon Sep 17 00:00:00 2001 From: James Messinger Date: Sat, 2 Feb 2019 05:27:10 -0600 Subject: [PATCH] Initial commit of tooling config files --- .editorconfig | 27 ++++++++++++++++++ .gitattributes | 25 +++++++++++++++++ .gitignore | 43 +++++++++++++++++++++++++++++ .travis.yml | 42 ++++++++++++++++++++++++++++ LICENSE | 21 ++++++++++++++ README.md | 4 +++ package.json | 68 ++++++++++++++++++++++++++++++++++++++++++++++ test/.eslintrc.yml | 12 ++++++++ test/mocha.opts | 2 ++ tsconfig.json | 35 ++++++++++++++++++++++++ tslint.yaml | 8 ++++++ 11 files changed, 287 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 package.json create mode 100644 test/.eslintrc.yml create mode 100644 test/mocha.opts create mode 100644 tsconfig.json create mode 100644 tslint.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7f37c99 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,27 @@ +# Editor config +# http://EditorConfig.org + +# This EditorConfig overrides any parent EditorConfigs +root = true + +# Default rules applied to all file types +[*] + +# No trailing spaces, newline at EOF +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf + +# 2 space indentation +indent_style = space +indent_size = 2 + +# JavaScript-specific settings +[*.{js,ts}] +quote_type = double +continuation_indent_size = 2 +curly_bracket_next_line = false +indent_brace_style = BSD +spaces_around_operators = true +spaces_around_brackets = none diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4ca9ecd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,25 @@ +# Git attributes +# https://git-scm.com/docs/gitattributes +# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes + +# Normalize line endings for all files that git determines to be text. +# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvalueauto +* text=auto + +# Normalize line endings to LF on checkin, and do NOT convert to CRLF when checking-out on Windows. +# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvaluelf +*.txt text eol=lf +*.html text eol=lf +*.md text eol=lf +*.css text eol=lf +*.scss text eol=lf +*.map text eol=lf +*.js text eol=lf +*.jsx text eol=lf +*.ts text eol=lf +*.tsx text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.xml text eol=lf +*.svg text eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb76002 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Git ignore +# https://git-scm.com/docs/gitignore + +# Miscellaneous +*~ +*# +.DS_STORE +Thumbs.db +.netbeans +nbproject +.node_history + +# IDEs & Text Editors +.idea +.sublime-* +.vscode +.netbeans +nbproject + +# Temporary files +.tmp +.temp +.grunt +.lock-wscript + +# Logs +/logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Dependencies +node_modules + +# Test output +/.nyc_output +/coverage + +# Build output +/lib diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..80c6cef --- /dev/null +++ b/.travis.yml @@ -0,0 +1,42 @@ +# Travis CI config +# http://docs.travis-ci.com/user/languages/javascript-with-nodejs/ +# https://docs.travis-ci.com/user/customizing-the-build/ +# https://docs.travis-ci.com/user/migrating-from-legacy/ + +filter_secrets: false +language: node_js + +node_js: + - 10 + - 8 + - 6 + +os: + - linux + - osx + - windows + +before_script: + - npm run lint + - npm run build + +script: + - npm run coverage + +after_success: + - cat ./coverage/lcov.info | coveralls + +jobs: + include: + - stage: Deploy + name: Publish to npm + script: true + after_success: true + deploy: + provider: npm + email: $NPM_EMAIL + api_key: $NPM_API_KEY + skip_cleanup: true + on: + tags: true + branch: master diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..853473a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 James Messinger + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..104f1af --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +Istanbul Code Coverage Loader for Webpack +============================================== + +## ⚠ Work in Progress - Not ready to use yet ⚠ diff --git a/package.json b/package.json new file mode 100644 index 0000000..547a393 --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "coverage-istanbul-loader", + "version": "0.0.1", + "description": "A Webpack loader that uses Istanbul to add code coverage instrumentation", + "keywords": [ + "webpack-loader", + "webpack", + "loader", + "istanbul", + "coverage", + "code coverage", + "instrumentation", + "instrumenter", + "sourcemap", + "source-map", + "sourcemaps", + "source-maps" + ], + "author": { + "name": "James Messinger", + "url": "https://jamesmessinger.com" + }, + "license": "(MIT OR CC-BY-NC-SA-4.0)", + "homepage": "https://jsdevtools.org/coverage-istanbul-loader", + "repository": { + "type": "git", + "url": "https://github.com/JS-DevTools/coverage-istanbul-loader.git" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib" + ], + "scripts": { + "clean": "shx rm -rf .nyc_output coverage lib", + "lint": "npm run lint:typescript && npm run lint:javascript", + "lint:typescript": "tslint -p tsconfig.json", + "lint:javascript": "eslint test", + "build": "npm run clean && tsc", + "test": "mocha && npm run lint", + "coverage": "nyc --reporter=text --reporter=lcov mocha", + "upgrade": "npm-check -u", + "bump": "bump --prompt --tag --push --all", + "release": "npm run upgrade && npm run build && npm test && npm run bump" + }, + "dependencies": { + "convert-source-map": "^1.6.0", + "istanbul-lib-instrument": "^3.0.0", + "loader-utils": "^1.2.3" + }, + "devDependencies": { + "@types/node": "^10.12.21", + "@types/webpack": "^4.4.24", + "chai": "^4.2.0", + "coveralls": "^3.0.2", + "eslint": "^5.6.1", + "eslint-config-modular": "^6.0.0", + "mocha": "^5.2.0", + "npm-check": "^5.9.0", + "nyc": "^13.1.0", + "shx": "^0.3.2", + "tslint": "^5.12.0", + "tslint-modular": "^1.1.7", + "typescript": "^3.2.2", + "typescript-tslint-plugin": "^0.3.1", + "version-bump-prompt": "^4.2.1" + } +} diff --git a/test/.eslintrc.yml b/test/.eslintrc.yml new file mode 100644 index 0000000..d3711c4 --- /dev/null +++ b/test/.eslintrc.yml @@ -0,0 +1,12 @@ +# ESLint config +# http://eslint.org/docs/user-guide/configuring +# https://github.com/JS-DevTools/eslint-config-modular + +root: true + +extends: + - modular/best-practices + - modular/style + - modular/node + - modular/es6 + - modular/test diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..a1a1056 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,2 @@ +--bail +test/specs/**/*.spec.js diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d0a1a5a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node", + "esModuleInterop": true, + "lib": [ + "esnext", + ], + + "outDir": "lib", + "sourceMap": true, + "declaration": true, + + "newLine": "LF", + "forceConsistentCasingInFileNames": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictBindCallApply": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "noFallthroughCasesInSwitch": true, + + "plugins": [ + { "name": "typescript-tslint-plugin" } + ] + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/tslint.yaml b/tslint.yaml new file mode 100644 index 0000000..84827da --- /dev/null +++ b/tslint.yaml @@ -0,0 +1,8 @@ +# TSLint config +# https://palantir.github.io/tslint/usage/configuration/ +# https://github.com/JS-DevTools/tslint-modular + +extends: + - tslint-modular/best-practices + - tslint-modular/style + - tslint-modular/node