diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/.travis.yml b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/.travis.yml new file mode 100644 index 0000000..ccbb2b7 --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: node_js +node_js: + - "4" + - "5" + - "6" + - "7" + - "8" +matrix: + include: + - node_js: "7" + env: TEST_SUITE=standard +env: + - TEST_SUITE=unit +script: npm run-script $TEST_SUITE diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/LICENSE b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/LICENSE new file mode 100644 index 0000000..bba5218 --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Daniel Cousens + +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/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/README.md b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/README.md new file mode 100644 index 0000000..a1779a6 --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/README.md @@ -0,0 +1,25 @@ +# is-sorted +[![TRAVIS](https://secure.travis-ci.org/dcousens/is-sorted.png)](http://travis-ci.org/dcousens/is-sorted) +[![NPM](https://img.shields.io/npm/v/is-sorted.svg)](https://www.npmjs.org/package/is-sorted) +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +A small module to check if an Array is sorted. + + +## Example +``` javascript +var sorted = require('is-sorted') + +console.log(sorted([1, 2, 3])) +// => true + +console.log(sorted([3, 1, 2])) +// => false + +// supports custom comparators +console.log(sorted([3, 2, 1], function (a, b) { return b - a }) +// => true +``` + + +## LICENSE [MIT](LICENSE) diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/index.js b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/index.js new file mode 100644 index 0000000..be49e51 --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/index.js @@ -0,0 +1,14 @@ +function defaultComparator (a, b) { + return a - b +} + +module.exports = function checksort (array, comparator) { + if (!Array.isArray(array)) throw new TypeError('Expected Array, got ' + (typeof array)) + comparator = comparator || defaultComparator + + for (var i = 1, length = array.length; i < length; ++i) { + if (comparator(array[i - 1], array[i]) > 0) return false + } + + return true +} diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/package.json b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/package.json new file mode 100644 index 0000000..b283fd2 --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/package.json @@ -0,0 +1,34 @@ +{ + "name": "is-sorted", + "version": "1.0.5", + "description": "A small module to check if an Array is sorted", + "main": "index.js", + "scripts": { + "standard": "standard", + "test": "npm run-script unit", + "unit": "tape test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/dcousens/is-sorted.git" + }, + "bugs": { + "url": "https://github.com/dcousens/is-sorted/issues" + }, + "homepage": "https://github.com/dcousens/is-sorted", + "keywords": [ + "is-sorted", + "sorting", + "sort", + "sorted", + "array", + "list", + "comparison" + ], + "author": "Daniel Cousens", + "license": "MIT", + "devDependencies": { + "standard": "*", + "tape": "^4.8.0" + } +} diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/test/fixtures.json b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/test/fixtures.json new file mode 100644 index 0000000..581986c --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/test/fixtures.json @@ -0,0 +1,53 @@ +[ + { + "array": [], + "expected": true + }, + { + "array": [1], + "expected": true + }, + { + "array": [5], + "expected": true + }, + { + "array": [1, 5], + "expected": true + }, + { + "array": [1, 2, 3, 4, 5], + "expected": true + }, + { + "array": [1, 1, 3, 4, 5], + "expected": true + }, + { + "array": [1, 1.5, 3, 4, 5], + "expected": true + }, + { + "array": [1, 2, 3, 4, 6], + "expected": true + }, + { + "array": [5, 4, 3, 1, 1], + "comparator": "descending", + "expected": true + }, + { + "array": [5, 4, 3, 2, 1], + "comparator": "descending", + "expected": true + }, + { + "array": [1, 5, 2, 3, 4], + "expected": false + }, + { + "array": [5, 4, 3, 1, 2], + "comparator": "descending", + "expected": false + } +] diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/test/index.js b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/test/index.js new file mode 100644 index 0000000..b542c4c --- /dev/null +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/node_modules/is-sorted/test/index.js @@ -0,0 +1,22 @@ +var sorted = require('../') +var fixtures = require('./fixtures') +var tape = require('tape') +var comparators = { + descending: function (a, b) { return b - a } +} + +fixtures.forEach(function (f) { + tape('returns ' + f.expected + ' for ' + f.array, function (t) { + t.plan(1) + + var actual = sorted(f.array, comparators[f.comparator]) + t.equal(actual, f.expected) + }) +}) + +tape('throws on non-Array inputs', function (t) { + t.plan(1) + t.throws(function () { + sorted('foobar') + }, /Expected Array, got string/) +}) diff --git a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/package.json b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/package.json index e2de6b6..0f0f623 100644 --- a/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/package.json +++ b/packages/analyzer/fixtures/02-inheritance/05-external-in-monorepo/monorepo/packages/to-be-analyzed-pkg/package.json @@ -4,11 +4,12 @@ "type": "module", "dependencies": { "@mono/sibling-pkg": "0.2.0", - "ext-pkg-without-export-map": "0.1.0" + "ext-pkg-without-export-map": "0.1.0", + "is-sorted": "1.0.5" }, "exports": { ".": "./index.js", "./custom-elements.json": "./custom-elements.json" }, "customElements": "custom-elements.json" -} \ No newline at end of file +} diff --git a/packages/analyzer/src/utils/cli-helpers.js b/packages/analyzer/src/utils/cli-helpers.js index 30cfee9..8670d8c 100644 --- a/packages/analyzer/src/utils/cli-helpers.js +++ b/packages/analyzer/src/utils/cli-helpers.js @@ -9,7 +9,7 @@ const require = createRequire(import.meta.url); const { version } = require('../../package.json'); const IGNORE = [ - '!node_modules/**/*.*', + '!**/node_modules/**', '!bower_components/**/*.*', '!**/*.test.{js,ts}', '!**/*.suite.{js,ts}', @@ -160,4 +160,4 @@ Available commands: Examples: custom-elements-manifest analyze --litelement --globs "**/*.js" --exclude "foo.js" "bar.js" -` \ No newline at end of file +` diff --git a/yarn.lock b/yarn.lock index 6a63663..c8aa8ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1401,19 +1401,6 @@ "@babel/helper-module-imports" "^7.10.4" "@rollup/pluginutils" "^3.1.0" -"@rollup/plugin-commonjs@^19.0.0": - version "19.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.0.tgz#8c3e71f9a66908e60d70cc1be205834ef3e45f71" - integrity sha512-adTpD6ATGbehdaQoZQ6ipDFhdjqsTgpOAhFiPwl+dzre4pPshsecptDPyEFb61JMJ1+mGljktaC4jI8ARMSNyw== - dependencies: - "@rollup/pluginutils" "^3.1.0" - commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - "@rollup/plugin-node-resolve@^11.0.1": version "11.2.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" @@ -1426,18 +1413,6 @@ is-module "^1.0.0" resolve "^1.19.0" -"@rollup/plugin-node-resolve@^13.0.0": - version "13.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.0.tgz#352f07e430ff377809ec8ec8a6fd636547162dc4" - integrity sha512-41X411HJ3oikIDivT5OKe9EZ6ud6DXudtfNrGbC4nniaxx2esiWjkLOzgnZsWq1IM8YIeL2rzRGLZLBjlhnZtQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" - deepmerge "^4.2.2" - is-module "^1.0.0" - resolve "^1.19.0" - "@rollup/plugin-replace@^2.4.2": version "2.4.2" resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" @@ -1534,11 +1509,6 @@ resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.6.tgz#0b7018723084918a865eff99249c490505df2163" integrity sha512-7fDOJFA/x8B+sO1901BmHlf5dE1cxBU8mRXj8QOEDnn16hhGJv/IHxJtZhvsabZsIMn0eLIyeOKAeqSNJJYTpA== -"@types/estree@*": - version "0.0.50" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== - "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" @@ -2738,11 +2708,6 @@ comment-parser@1.2.4: resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.2.4.tgz#489f3ee55dfd184a6e4bffb31baba284453cb760" integrity sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw== -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -4375,13 +4340,6 @@ is-promise@^2.0.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== -is-reference@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - is-regex@^1.0.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" @@ -6587,7 +6545,7 @@ resolve-path@^1.4.0: http-errors "~1.6.2" path-is-absolute "1.0.1" -resolve@^1.1.6, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0: +resolve@^1.1.6, resolve@^1.14.2, resolve@^1.19.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -6670,7 +6628,7 @@ rollup-plugin-terser@^7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup@^2.35.1, rollup@^2.52.8: +rollup@^2.35.1: version "2.53.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.53.1.tgz#b60439efd1eb41bdb56630509bd99aae78b575d3" integrity sha512-yiTCvcYXZEulNWNlEONOQVlhXA/hgxjelFSjNcrwAAIfYx/xqjSHwqg/cCaWOyFRKr+IQBaXwt723m8tCaIUiw==