From 91fb1aff346ce8f1d77002b3cd19f7ef59546051 Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 9 Nov 2019 20:00:54 -0600 Subject: [PATCH] adopt everything but rollup config (#118) --- .dockerignore | 7 ++ .github/ISSUE_TEMPLATE/type_bug.md | 40 +++++++ .github/ISSUE_TEMPLATE/type_feature.md | 33 ++++++ .github/PULL_REQUEST_TEMPLATE.md | 21 ++++ .gitignore | 7 +- .npmignore | 23 ++-- Makefile | 1 - config/tsconfig.json | 9 +- config/tslint.cc.json | 153 ------------------------- config/tslint.json | 12 -- scripts/ci-project-path.sh | 2 +- scripts/github-status.sh | 10 +- src/lib.ts | 5 + src/resource/json.json | 3 + src/resource/yaml.yml | 1 + test/helpers/async.ts | 6 +- vendor/rollup-resources/index.d.ts | 9 ++ 17 files changed, 160 insertions(+), 182 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/ISSUE_TEMPLATE/type_bug.md create mode 100644 .github/ISSUE_TEMPLATE/type_feature.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100755 config/tslint.cc.json delete mode 100755 config/tslint.json create mode 100644 src/lib.ts create mode 100644 src/resource/json.json create mode 100644 src/resource/yaml.yml create mode 100644 vendor/rollup-resources/index.d.ts diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5bab92f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.nyc_output/ +docs/api/ +node_modules/ +out/api +out/cache/ +out/coverage/ +out/tmp/ \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/type_bug.md b/.github/ISSUE_TEMPLATE/type_bug.md new file mode 100644 index 0000000..d8ec08f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/type_bug.md @@ -0,0 +1,40 @@ +--- +name: Bug Report +about: report a problem +title: '' +labels: status/new, type/bug +assignees: '' + +--- + +# Bug + +Something is broken! + +## Summary + +(quick summary of the issue) + +## Steps to Reproduce + +- install +- configure +- run +- ... +- :( + +## Actual Behavior + +```none +example +``` + +## Expected Behavior + +```none +example +``` + +## Details + +(detailed description of the expected behavior and what goes wrong) diff --git a/.github/ISSUE_TEMPLATE/type_feature.md b/.github/ISSUE_TEMPLATE/type_feature.md new file mode 100644 index 0000000..d3c1b08 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/type_feature.md @@ -0,0 +1,33 @@ +--- +name: Feature Suggestion +about: Suggest an idea for this project +title: '' +labels: status/new, type/feature +assignees: '' + +--- + +# Feature + +Something is missing! + +## Summary + +An elevator pitch of the feature and why it will be useful. + +## Scope + +- [ ] items to be implemented + - [ ] additional details + +## Use Case + +At least one concrete use case for the feature, ideally with step-by-step example. + +Bonus points if you can refer to another issue here. + +## Questions + +Outstanding questions, potential problems, and further research that might be needed. + +New or updated dependencies should be noted here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ff0894e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +# Merge + +Something is ready to be merged! + +## Issues + +List the issue(s) resolved or addressed by this change. + +Changes MUST be related to an issue. If one does not exist, please create one with +[the appropriate issue type](https://github.com/ssube/isolex/blob/master/docs/workflow.md#type). + +## Checks + +Before creating a PR, please ensure +[all merge requirements](https://github.com/ssube/isolex/blob/master/docs/workflow.md#merges) +are met: + +- [ ] Gitlab pipeline has passed +- [ ] lint warnings have not increased +- [ ] documentation has been updated +- [ ] tests have been added and consistently pass diff --git a/.gitignore b/.gitignore index 0c72c08..f377c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,12 @@ .nyc_output/ node_modules/ out/ -package-lock.json -yarn-error.log +temp/ +# types *.bak *.swp *.tmp + +package-lock.json +yarn-error.log diff --git a/.npmignore b/.npmignore index c217dfb..9535f29 100644 --- a/.npmignore +++ b/.npmignore @@ -1,23 +1,28 @@ +.awcache/ .github/ +.nyc_output/ config/ deploy/ node_modules/ out/cache/ -out/src/ -out/test/ +out/coverage/ +out/coverage-* +out/docs/ +out/typings/ +out/*.db +out/*.html +out/*.json +out/test-* +out/tmp/ scripts/ src/ +temp/ test/ vendor/ -out/*.html -out/*.json -out/*.map -out/entry-* -out/test.* - .codeclimate.yml +.dockerignore .gitlab-ci.yml .gitmodules .mdlrc @@ -25,8 +30,6 @@ out/test.* Dockerfile licensed.yml Makefile -package-lock.json renovate.json tsconfig.json yarn-* -yarn.lock diff --git a/Makefile b/Makefile index fdd2cdf..f2ba722 100755 --- a/Makefile +++ b/Makefile @@ -44,7 +44,6 @@ NODE_INFO := $(shell node -v) # Tool options COVER_OPTS ?= --reporter=lcov --reporter=text-summary --reporter=html --report-dir="$(TARGET_PATH)/coverage" --exclude-after-remap -DOCKER_IMAGE ?= ssube/salty:master MOCHA_OPTS ?= --check-leaks --colors --sort --ui bdd RELEASE_OPTS ?= --commit-all diff --git a/config/tsconfig.json b/config/tsconfig.json index 77c5f53..88624f9 100755 --- a/config/tsconfig.json +++ b/config/tsconfig.json @@ -15,14 +15,21 @@ ], "module": "es6", "moduleResolution": "node", + "noImplicitAny": true, "noImplicitReturns": true, + "noImplicitThis": true, "outDir": "../out", "sourceMap": true, "strict": true, + "strictNullChecks": true, "target": "es2017", "types": [ + "chai-as-promised", "jsonpath-plus", - "mocha" + "mocha", + "node", + "rollup-resources", + "sinon-chai" ], "typeRoots": [ "../node_modules/@types", diff --git a/config/tslint.cc.json b/config/tslint.cc.json deleted file mode 100755 index 81b32b6..0000000 --- a/config/tslint.cc.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "extends": ["tslint:latest"], - "rules": { - "adjacent-overload-signatures": true, - "array-type": [ - true, - "generic" - ], - "arrow-parens": true, - "arrow-return-shorthand": true, - "await-promise": true, - "ban": [true, { - "message": "use lodash isString", - "name": ["util", "isString"] - }, { - "message": "use lodash isNil", - "name": ["util", "isNullOrUndefined"] - }], - "ban-comma-operator": true, - "ban-types": true, - "class-name": true, - "curly": true, - "cyclomatic-complexity": [ - true, - 12 - ], - "deprecation": true, - "eofline": true, - "increment-decrement": true, - "indent": [true, "spaces", 2], - "interface-name": [ - true, - "never-prefix" - ], - "max-classes-per-file": [ - false, - 1 - ], - "max-file-line-count": 250, - "max-line-length": [ - true, - 180 - ], - "member-access": true, - "member-ordering": [ - true, - { - "order": [ - "public-static-method", - "public-static-field", - "public-instance-field", - "protected-instance-field", - "public-constructor", - "public-instance-method", - "protected-instance-method" - ] - } - ], - "new-parens": true, - "no-angle-bracket-type-assertion": true, - "no-arg": true, - "no-bitwise": false, - "no-boolean-literal-compare": true, - "no-conditional-assignment": true, - "no-console": true, - "no-construct": true, - "no-dead-store": false, - "no-debugger": true, - "no-default-export": true, - "no-default-import": true, - "no-duplicate-super": true, - "no-duplicate-variable": true, - "no-empty-interface": true, - "no-floating-promises": true, - "no-for-in-array": true, - "no-implicit-dependencies": false, - "no-inferred-empty-object-type": true, - "no-inferrable-types": [ - true, - "ignore-params", - "ignore-properties" - ], - "no-internal-module": true, - "no-invalid-this": true, - "no-irregular-whitespace": true, - "no-magic-numbers": [ - true, - -1, 0, - 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 20, 30, 40, 50, 60, 70, 80, 90, - 100 - ], - "no-misused-new": true, - "no-namespace": true, - "no-non-null-assertion": true, - "no-null-keyword": true, - "no-parameter-properties": true, - "no-parameter-reassignment": true, - "no-return-await": true, - "no-shadowed-variable": true, - "no-sparse-arrays": true, - "no-string-literal": true, - "no-string-throw": true, - "no-submodule-imports": false, - "no-unbound-method": true, - "no-unused-expression": true, - "no-var-keyword": true, - "no-void-expression": true, - "prefer-conditional-expression": false, - "prefer-const": true, - "prefer-for-of": true, - "prefer-readonly": true, - "prefer-switch": true, - "quotemark": [ - true, - "single", - "jsx-double", - "avoid-escape" - ], - "radix": true, - "restrict-plus-operands": true, - "strict-boolean-expressions": true, - "strict-type-predicates": true, - "switch-default": true, - "trailing-comma": [ - true, - { - "multiline": "always", - "singleline": "never" - } - ], - "triple-equals": true, - "unnecessary-constructor": true, - "use-default-type-parameter": true, - "use-isnan": true, - "variable-name": [ - true, - "ban-keywords", - "check-format" - ] - }, - "jsRules": { - "curly": true, - "trailing-comma": [ - true, - { - "multiline": "never", - "singleline": "never" - } - ] - }, - "rulesDirectory": [] -} diff --git a/config/tslint.json b/config/tslint.json deleted file mode 100755 index 7626af0..0000000 --- a/config/tslint.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": ["./tslint.cc.json", "tslint-clean-code", "tslint-sonarts"], - "rulesDirectory": ["../node_modules/tslint-microsoft-contrib"], - "rules": { - "mocha-unneeded-done": true, - "no-banned-terms": true, - "no-delete-expression": true, - "no-for-in": true, - "no-relative-imports": false, - "no-small-switch": false - } -} diff --git a/scripts/ci-project-path.sh b/scripts/ci-project-path.sh index e0195ca..f941420 100755 --- a/scripts/ci-project-path.sh +++ b/scripts/ci-project-path.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash PROJECT="${ROOT_PATH}" PARENT="$(dirname "${PROJECT}")" diff --git a/scripts/github-status.sh b/scripts/github-status.sh index 284dd72..a0db255 100755 --- a/scripts/github-status.sh +++ b/scripts/github-status.sh @@ -3,7 +3,15 @@ STATUS="${1}" CI_COMMIT_SHA="${CI_COMMIT_SHA:-$(git rev-parse HEAD)}" -STATUS_BODY="{\"state\": \"${STATUS}\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"CI pipeline ${STATUS}!\", \"context\": \"gitlab/build\"}" +STATUS_BODY="$(cat < Promise; type AsyncMochaSuite = (this: Mocha.Suite) => Promise; +function isNil(val: T | null | undefined): val is null | undefined { + /* eslint-disable-next-line no-null/no-null */ + return val === null || val === undefined; +} + export interface TrackedResource { source: string; triggerAsyncId: number; diff --git a/vendor/rollup-resources/index.d.ts b/vendor/rollup-resources/index.d.ts new file mode 100644 index 0000000..1e52a09 --- /dev/null +++ b/vendor/rollup-resources/index.d.ts @@ -0,0 +1,9 @@ +declare module "*.json" { + export const data: unknown; + export default data; +} + +declare module "*.yml" { + export const data: unknown; + export default data; +}